Create a Bookmark via REST API

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered

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"
    }         
}

Photo of Ramesh

Ramesh

  • 518 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Jatinder Luthra

Jatinder Luthra, Employee

  • 2,754 Points 2k badge 2x thumb
Official Response
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...

(Edited)