API/Python/Open-Source Solutions

Expand all | Collapse all

Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?

Jump to Best Answer
  • 1.  Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?

    Posted 04-13-2016 05:34:00 AM
    Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?


    Scenario : 
    Sent a API web service call to REWIND and we got '200 OK'  as success response ..but in the background actual request is still processing and there could be chances that the actual process may fail after receiving response as "OK" from the web service. <correct me if i am wrong>

    Team please suggest, does such scenario arises ? if so how to place check points in that case.



  • 2.  RE: Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?

    Posted 04-13-2016 06:46:00 AM
    when you obtain a 200 OK you should look for "action" reference and then call the following API:

    /resources/json/delphix/action/




  • 3.  RE: Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?
    Best Answer

    Posted 04-13-2016 06:53:00 AM
    Your observation is correct. The Delphix Engine supports the notion of Jobs. See https://docs.delphix.com/display/DOCS50/Asynchronous+Jobs

    When an API request dispatches a job (which happens for many VDB operations such as rollback/rewind and refresh), the API response code will be 200, and the content of the response will be a JSON object of the "OKResult" JSON schema, for instance:

    {   "type": "OKResult",
        "status": "OK",
        "result": "",
        "job": "JOB-21447695",
        "action": "ACTION-25474091"
    }

    The job property contains a reference to a Job, and the /resources/json/delphix/job API endpoint can be used to query the status of the job. In this example, you may issue an HTTP GET request to /resources/json/delphix/job/JOB-21447695 and look at the jobState property to determine if the job has completed (edited):

    GET /resources/json/delphix/notification?channel=JOB-21447695

    {    "type": "OKResult",
        "status": "OK",
        "result": {
            "type": "Job",
            "reference": "JOB-21447695",
            "jobState": "RUNNING",
            "startTime": "2016-04-13T07:46:49.082Z",
            "updateTime": "2016-04-13T07:46:49.092Z",
            "percentComplete": 0,
            ...
            "events": [
                {
                    "type": "JobEvent",
                    "timestamp": "2016-04-13T07:46:49.093Z",
                    ...
                    "messageDetails": "... job started for \"...\".",
                    "eventType": "INFO"
                }
            ],
            "parentActionState": "WAITING",
            "parentAction": "ACTION-25474091"
        },
        "job": null,
        "action": null
    }






  • 4.  RE: Query[API] : Does API response 200 OK is the actual success response for REWIND & REFRESH calls ?

    Posted 04-13-2016 01:22:00 PM
    Thanks Gianpiero & Eyal