APIPythonOpen-Source Solutions

  • 1.  Create a Bookmark via REST API

    Posted 08-26-2016 09:34:00 AM

    How to create Bookmark via REST API with the time flow. Please let me know the list of API I need to invoke.

    As of Now I am having the basic idea. I need a help to create the bookmark on a container with the timeflow. How to list the time flow for a specific container and which attribute I need to pass it to the post method of bookmark.

    1. GET /resources/json/delphix/jetstream/container

    reference": "JS_DATA_CONTAINER-3",
    activeBranch": "JS_BRANCH-5",

    From the above get method, I will be getting the reference and active branch and pass it to the POST method of bookmark


    2.

    POST /resources/json/delphix/jetstream/bookmark
    {
                    "type": "JSBookmarkCreateParameters",
                    "bookmark": {
                                    "type": "JSBookmark",
                                    "name": "CBK_VIA_API",
                                    "description": "bookmark created for testing",
                                    "branch": "JS_BRANCH-5",
                                    "tags": ["testtag"],
                                    "bookmarkType": "DATA_CONTAINER"
                    },
                    "timelinePointParameters": {
                                    "type": "JSTimelinePointLatestTimeInput",
                    "sourceDataLayout": "JS_DATA_CONTAINER-3"
        }         
    }


    #Tip


  • 2.  RE: Create a Bookmark via REST API
    Best Answer

    Posted 08-26-2016 11:25:00 AM
    Hello Ramesh,
                           This is absolutely right what you explained in question for creating jet stream bookmark using rest API.

    Bookmark can be created either on specific input time or on latest time of container.

    Here is sample API call for creating bookmark on LatestTime of container.

    POST /resources/json/delphix/jetstream/bookmark 
    {
        "type": "JSBookmarkCreateParameters",
        "bookmark": {
            "type": "JSBookmark",
            "name": "testbookmark",
            "branch": "JS_BRANCH-50",
            "description": "optional bookmark description"
            "tags": ["tag1","tag2","tag3","tag4","tag5"]
        },
        "timelinePointParameters": {
            "type": "JSTimelinePointLatestTimeInput",
            "sourceDataLayout": "JS_DATA_CONTAINER-20"
        }
    }

    If you want to create bookmark at specific time, you need to change timelinePointParameters.type=JSTimelinePointTimeInput

    In this case, API call will be like this:

    POST /resources/json/delphix/jetstream/bookmark 

    {
        "type": "JSBookmarkCreateParameters",
        "bookmark": {
            "type": "JSBookmark",
            "name": "testbookmark",
            "branch": "JS_BRANCH-50",
            "description": "optional bookmark description"
            "tags": ["tag1","tag2","tag3","tag4","tag5"]
        },
      "timelinePointParameters": {   
             "type": "JSTimelinePointTimeInput"   
            "sourceDataLayout": "JS_DATA_CONTAINER-20",
            "time": "2016-03-24T9:47:06.763Z",
        }
    }

    To get branch refrerence, you can login into Delphix CLI and run this command:

    jetstream branch "<branchName>" ls

    To get container refrerence, you can login into Delphix CLI and run this command:

    jetstream container "<containerName>" ls

    Hope this helps.

    Here is an excerpt to create bookmark:

    https://community.delphix.com/delphix/topics/jetstream-bookmark-create-using-the-api-to-create-a-new...">https://community.delphix.com/delphix/topics/jetstream-bookmark-create-using-the-api-to-create-a-new-bookmark">https://community.delphix.com/delphix/topics/jetstream-bookmark-create-using-the-api-to-create-a-new...



  • 3.  RE: Create a Bookmark via REST API

    Posted 08-29-2016 06:16:00 AM
    Thanks for sharing the information which I am looking for. how to get the timelinePointParameters with GET Method. Kindly share the corresponding details.


  • 4.  RE: Create a Bookmark via REST API

    Posted 08-29-2016 08:16:00 AM

    In the above Image, one can see the vertical bars over the axis. I hope each vertical bar represent a particular time. How do I list the time stamp for the respective vertical bar via API. So that I can choose based on the my situation and I create a book mark from any one of the vertical bar.



  • 5.  RE: Create a Bookmark via REST API

    Posted 08-29-2016 01:08:00 PM
    Hello Ramesh,
                           Delphix gives you ability to create bookmark at any point in time, at second level. It is not mandatory to only create bookmark with time represented with vertical bars. 

    API dont list respective vertical bars, as you have power to give any specific time on your container timeflow and create bookmark on it.



    On left side of timeflow in GUI, you can select time at more granular level.
    Similarly,in API call, you can pass the time in format, 2016-03-24T9:47:06.763Z.

    Hope this answers your question.






  • 6.  RE: Create a Bookmark via REST API

    Posted 08-29-2016 01:28:00 PM
    I got it. Thank your for the answer


  • 7.  RE: Create a Bookmark via REST API

    Posted 08-29-2016 01:30:00 PM
    Great. Enjoy your Day.

    Cheers