APIPythonOpen-Source Solutions

  • 1.  How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-08-2017 07:52:00 PM
    Hi,

    I am using the VDB refresh API to kick off a VDB refresh. The API sends a JSON output in the following format;

    {    "type": "OKResult",
        "status": "OK",
        "result": "",
        "job": "JOB-12345",
        "action": "ACTION-54321"
    }

    How do i know if the Job with the Job ID i obtained above is a success or a failure?

    Is there any other API to poll the status/result of the Job using the Job ID?



  • 2.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?
    Best Answer

    Posted 08-08-2017 08:13:00 PM
    Hi, Use this URL to get job progress/status (http://delphixengineip/api/#job) you have to passe the Job reference to it that and read the object from the Delphix engine: curl -X GET -k "http://${DE}/resources/json/delphix/job/${JOBREF}" -b ~/cookies.txt -H "Content-Type: application/json" This will return the job object, you have to look on properties : jobState and percentComplete Regards, Mouhssine


  • 3.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-09-2017 12:47:00 PM
    Hi Mouhssine,

    For example lets say i have JOB-12345. 

    In this case is the below CURL the appropriate way to execute it?

    curl -X GET -k "http://51.16.109.229/resources/json/delphix/JOB-12345"">http://51.16.109.229/resources/json/delphix/JOB-13125"">http://51.16.109.229/resources/json/delphix/JOB-12345"; -b ~/cookies.txt -H "Content-Type: application/json"


  • 4.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-09-2017 06:35:00 PM
    Hi, Please find here a snipt of code in bash to check and loop on job status until finished while [ $jobState = "RUNNING" ] do sleep 1 result=$(curl -s -X GET -k http://${engine}/resources/json/delphix/job/${jobRef} \ -b ~/cookies.txt -H "Content-Type: application/json") # Get everything in the result that comes after job. temp=${result#*\"jobState\":\"} # Get rid of everything after jobState=${temp%%\"*} done if [ $jobState = "COMPLETED" ] then echo "successfully Job execution" else echo "unable to complete the job correctly" echo result fi } Regards, Mouhssine


  • 5.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-09-2017 06:40:00 PM
    Hi,

    Where do we pass the JOB ID ?

    Running in the format in the below example doesn't work

    curl -X GET -k "http:${DE}/resources/json/delphix/JOB-12345"; -b ~/cookies.txt -H "Content-Type: application/json"




  • 6.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-09-2017 06:48:00 PM
    Hi, The URL isn't the correct one use this one instead curl -X GET -k "http:${DE}/resources/json/delphix/job/JOB-12345"; -b ~/cookies.txt -H "Content-Type: application/json" Regards, Mouhssine


  • 7.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-10-2017 12:32:00 PM
    Hi,

    Thank you for your help and updating the URL. This works perfectly to get the status of any job. 


  • 8.  RE: How do i know if a VDB refresh kicked off through the VDB refresh API was successful or a failure?

    Posted 08-10-2017 01:07:00 PM

    Hi,


    happy to know that it works for you.


    Rgards,


    Mouhssine