How to provision a VDB via API - Type AppDataProvisionParameters

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
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).
Photo of Plinio

Plinio

  • 270 Points 250 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 5,816 Points 5k badge 2x thumb

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

Photo of Plinio

Plinio

  • 270 Points 250 badge 2x thumb
Hi Mouhssine,

Thanks for your attention!

I'll try to do the tip.
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 5,816 Points 5k badge 2x thumb
Hi Plinio,

Hope that this will help you fix it.

Regards,

Mouhssine
Photo of Plinio

Plinio

  • 270 Points 250 badge 2x thumb
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?

Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 5,816 Points 5k badge 2x thumb
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
Photo of Plinio

Plinio

  • 270 Points 250 badge 2x thumb
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!