API/Python/Open-Source Solutions

Expand all | Collapse all

Rewind using APIs

Jump to Best Answer
  • 1.  Rewind using APIs

    Posted 04-18-2016 02:16:00 PM

    Can you give an example for rewind using API Note: This conversation was created from a reply on: Tip of the Day: Rewinding to a Timeflow Bookmark Using the CLI.

  • 2.  RE: Rewind using APIs
    Best Answer

    Posted 04-18-2016 07:40:00 PM
    To rewind a VDB, you need a reference to the Database object. See the topic, API Cookbook: List dSources and VDBs (https://docs.delphix.com/display/DOCS50/API+Cookbook%3A+List+dSources+and+VDBs), for information on how to obtain the database reference.

    Rewind of a VDB is done in 3 steps
    1) Create session
    2) Authenticate/Login to delphix engine
    3) Rewind VDB. This operation is named as rollback in delphix Rest API

    The following sample script includes a working example for creating a session, authenticating to the Delphix Engine, and rewinding the VDB. Please update the script variables to match your environment before using it.

    # sample script to start or stop a VDB.
    # set this to the FQDN or IP address of the Delphix Engine
    # set this to the Delphix admin user name
    # set this to the password for the Delphix admin user
    # set this to the object reference for the VDB
    # create our session
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/session \
        -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
        "type": "APISession",
        "version": {
            "type": "APIVersion",
            "major": 1,
            "minor": 4,
            "micro": 1
    # authenticate to the DE
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/login \
        -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
        "type": "LoginRequest",
        "username": "${DELPHIX_ADMIN}",
        "password": "${DELPHIX_PASS}"
    # rewind VDB
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/database/${VDB}/rollback \
        -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
        "type": "OracleRollbackParameters",
        "timeflowPointParameters": {
        "type" : "TimeflowPointSnapshot",
        "snapshot" : "ORACLE_SNAPSHOT-172"

    Note: While rewinding VDB, you can use different parameter types. In the above example "timeflowPointParameters" type is used as "TimeflowPointSnapshot" and a appropriate snapshot name is provided. Instead of "TimeflowPointSnapshot" , you can also choose from "TimeflowPointLocation" OR "TimeflowPointTimestamp" OR "TimeflowPointBookmark" etc. and pass the relevant parameters.

  • 3.  RE: Rewind using APIs

    Posted 04-19-2016 12:57:00 PM

    If you want to specify time using a TimeflowPointTimestamp type, keep in mind that timestamp in API calls has to be provided in GMT timezone like '2016-01-01T14:40:30.000Z"