Delphix Products

 View Only
  • 1.  Provision a Oracle VDB through API call

    Posted 02-11-2019 05:30:00 PM
    Hi there, I am trying to Provision a Oracle VDB through an API call. My code is something like:
    #DB Provision

    curl -vs -X POST -k --data @- https:/URL/resources/json/delphix/database/provision \

            -b cookies.txt -H "Content-Type: application/json" <<EOF






    I am getting an error:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" ""><html><head><title>Error 403</title></head><body><h1>Error processing request</h1><p>HTTP status: 403</p><p>Message: Use &#47;resources&#47;json&#47;delphix&#47;login to log in first</p><p>Request was POST /resources/json/delphix/database/provision</p></body></html>

    My login and session is okay, I have have done a lot of other posts already.

    Can you please assist?


  • 2.  RE: Provision a Oracle VDB through API call
    Best Answer

    Posted 02-11-2019 05:38:00 PM
    Make sure your authentication call writes the cookie again. There was a recent change to Delphix where you get a new jsessionid cookie after you successfully authenticate. Look closely at #2 below


    # 1) Create Delphix API Session
    echo -e "\n\nCreating Session\n"
    curl -s -X POST -k --data @- http://${DEIP}/resources/json/delphix/session \
    -c cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "APISession",
    "version": {
    "type": "APIVersion",
    "major": 1,
    "minor": 7,
    "micro": 0

    # 2) Delphix Login
    echo -e "\n\nLogging in\n"
    curl -s -X POST -k --data @- http://${DEIP}/resources/json/delphix/login \
    -b cookies.txt -c cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "LoginRequest",
    "username": "${USER}",
    "password": "${PASS}"
    #3) List containers
    echo -e "\n\nGrabbing list of containers\n"
    curl -X GET -k "http://${DEIP}/resources/json/delphix/jetstream/container"; -b cookies.txt -H "Content-Type: application/json"

    echo -e "\n\nCurl Script Complete\n"

  • 3.  RE: Provision a Oracle VDB through API call

    Posted 02-12-2019 09:09:00 AM
    Hi Adam,
    Thanks for the swift response, works like charm now. Great!!