API/Python/Open-Source Solutions

Expand all | Collapse all

How to provision a VDB via API - Type AppDataProvisionParameters

Jump to Best Answer
  • 1.  How to provision a VDB via API - Type AppDataProvisionParameters

    Posted 02-18-2019 06:58:00 PM
    How to provision a VDB via API using the AppDataProvisionParameters type?    Currently I am making the call to url:    https://{DELPHIX}/resources/json/delphix/database/provision    Passing the parameters:    {   "container":{    "name": "TESTECRIAVDB",    "group": "GROUP-10",    "type": "Container"   },   "source": {    "parameters": {},    "allowAutoVDBRestartOnHostReboot": false,    "type": "Source"   },   "sourceConfig": {    "type": "SourceConfig",    "name": "TEST_VDB",
      "repository": "APPDATA_REPOSITORY-168"   },   "timeflowPointParameters": {    "type": "TimeflowPointSnapshot",    "snapshot": "APPDATA_SNAPSHOT-20"   },   "type": "AppDataProvisionParameters"  }      However, when we make the request I have the following return:    {      "type": "ErrorResult",      "status": "ERROR",      "error": {          "type": "APIError",          "details": "A server error occurred while processing your request.",          "action": "Please contact Delphix support.",          "id": null,          "commandOutput": null      }  }    
    When I use the Delphix interface I can create vdb. Can someone help me?  If possible explain the JSON parameters (container, source, sourceConfig).

    #DemoEnvironment


  • 2.  RE: How to provision a VDB via API - Type AppDataProvisionParameters
    Best Answer

    Posted 02-19-2019 08:16:00 AM

    Hi Plinio,

    It seems that there is something wrong with the API call.

    The easiest way to figure out what missing or what is the meaning of each parameter, is to activate the verbose mode on the CLI and try to provision the virtual dataset.

    This way you will get the output of the API call send and returned back to/from the engine, this way you will have a working API call and manage to customize it.


    Connect to delphix via ssh with delphix_admin/admin account and run this command

    1/ setopt trace=true
    2/ try to provision your dataset
    3/ extract the API call from the engine output

    Regards,

    Mouhssine



  • 3.  RE: How to provision a VDB via API - Type AppDataProvisionParameters
    Best Answer

    Posted 02-19-2019 12:38:00 PM
    Hi Mouhssine,

    Thanks for your attention!

    I'll try to do the tip.


  • 4.  RE: How to provision a VDB via API - Type AppDataProvisionParameters
    Best Answer

    Posted 02-19-2019 12:57:00 PM
    Hi Plinio,

    Hope that this will help you fix it.

    Regards,

    Mouhssine


  • 5.  RE: How to provision a VDB via API - Type AppDataProvisionParameters

    Posted 02-19-2019 02:29:00 PM
    The response is a error:

    === RESPONSE ===
    {
        "type": "ErrorResult",
        "status": "ERROR",
        "error": {
            "type": "APIError",
            "details": {
                "postgresPort": {
                    "details": "The field \"postgresPort\" is required.",
                    "action": null,
                    "id": "exception.validation.field.missing",
                    "commandOutput": null,
                    "diagnoses": null
                }
            },
            "action": "Check your input parameters and try again.",
            "id": "exception.validation.bad.input",
            "commandOutput": null,
            "diagnoses": null
        }
    }
    === END ===
    The following validation errors are present:

        postgresPort    The field "postgresPort" is required.





    Do you know what to do?



  • 6.  RE: How to provision a VDB via API - Type AppDataProvisionParameters
    Best Answer

    Posted 02-19-2019 02:58:00 PM
    Hi,

    This means that you didn't define the parameter PostgresPort and it's required one.

    To fix the issue you have to define this parameter.

    Regards,

    Mouhssine


  • 7.  RE: How to provision a VDB via API - Type AppDataProvisionParameters

    Posted 02-19-2019 04:37:00 PM
    Thanks! 


    I found out where to put the postgresPort field. However, when I apply for Postman, an error occurs.

    Here is the correct request:

    {
    "container": {
    "sourcingPolicy": {
    "logsyncEnabled": false,
    "type": "SourcingPolicy"
    },
    "group": "GROUP-10",
    "name": "VSou_MGH",
    "type": "AppDataContainer"
    },
    "source": {
    "operations": {
    "configureClone": [],
    "preRefresh": [],
    "postRefresh": [],
    "preRollback": [],
    "postRollback": [],
    "preSnapshot": [],
    "postSnapshot": [],
    "preStart": [],
    "postStart": [],
    "preStop": [],
    "postStop": [],
    "type": "VirtualSourceOperations"
    },
    "parameters": {
    "postgresPort": 5438,
    "config_settings_stg": []
    },
    "additionalMountPoints": [],
    "allowAutoVDBRestartOnHostReboot": false,
    "logCollectionEnabled": false,
    "name": "VSou_MGH",
    "type": "AppDataVirtualSource"
    },
    "sourceConfig": {
    "path": "/mnt/provision/Source_6O1RXVSW",
    "name": "VSou_MGH",
    "repository": "APPDATA_REPOSITORY-176",
    "linkingEnabled": true,
    "environmentUser": "HOST_USER-153",
    "type": "AppDataDirectSourceConfig"
    },
    "timeflowPointParameters": {
    "snapshot": "APPDATA_SNAPSHOT-45",
    "type": "TimeflowPointSnapshot"
    },
    "masked": false,
    "type": "AppDataProvisionParameters"

    }

    Thank you very much for your help!