How to provision a MSSQL database through API in delphix?

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
Delphix documentation provide a sample code to provision a Oracle database here:
https://docs.delphix.com/display/DOCS43/API+Cookbook%3A+Example+Provision+Of+An+Oracle+VDB.

While MSSQL db provisioning or any other DB provisioning might require other parameters.
example mount base path/SID/DB unique name etc are required in Oracle
while
MSSQL might require Database Instance name in the Target Environment or recovery model etc.

How to use one API call for any type of DB provisioning. If this is not possible then please share a sample API code for MSSQL provisioning.
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
  • sad

Posted 7 months ago

  • 0
  • 1
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,420 Points 10k badge 2x thumb
Hi Ashul,

We have many great example scripts that do this, in a few different languages. If you are a DBA and prefer perl, than I would suggest you take a look here:
https://github.com/delphix/dxtoolkit

If you are enterprise Architect, Automation Specialist, Developer, Tester, etc, then I would suggest you look at the python examples found here:

https://github.com/CloudSurgeon/delphixpy-examples
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
Hi Adam, I am unable to open these links due to company policy. Can you post a example similar to Oracle provisioning example given in documentation here?
I will be using JAVA to call API.
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
Even CURL command for the same can help. :/
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,420 Points 10k badge 2x thumb
Also, here is a blog and video I did a couple of years ago that walks you through how to do something in the Delphix web interface and map that to the CLI and the raw API calls. Give this a read/watch and let me know if it helps:
http://www.adam.today/2016/06/working-with-delphix-python-module.html
Photo of Stephanie Burks

Stephanie Burks, Employee

  • 160 Points 100 badge 2x thumb
Hello Anshul,
Regarding the API, we have additional information in our latest online documentation Reference section.
cli-cookbook-provisioning-a-sql-server-vdb

If you go to the CLI Cookbook section, there are other SQL Server examples under the Source Databases and dSources section.

The Web Service API Guide is also a good reference 

You can also access API/CLI information specific to your Delphix version, via the delphix_admin GUI. Once logged in, navigate to Help > API Documentation
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
I couldn't find API for provisioning of MSSQL db, only ORACLE is available in API documentation. For oracle, parameters like mount base is used, while there is no mount base in mssql db. So I wonder if API format is same or different for MSSQL. Can you provide curl command to provision MSSQL db? Thanks in advance.
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,732 Points 4k badge 2x thumb
Hi,

May be you will find your "happiness" here https://github.com/duckback00/dxapikit/tree/master/API

Regards,

Mouhssine
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,420 Points 10k badge 2x thumb
Here is an example I pulled from my environment this morning:
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #ffffff; background-color: #2b66c9}span.s1 {font-variant-ligatures: no-common-ligatures} === POST /resources/json/delphix/database/provision ===

{

    "type": "MSSqlProvisionParameters",

    "container": {

        "type": "MSSqlDatabaseContainer",

        "name": "MSSQLVDB",

        "group": "GROUP-35"

    },

    "source": {

        "type": "MSSqlVirtualSource",

        "allowAutoVDBRestartOnHostReboot": false

    },

    "sourceConfig": {

        "type": "MSSqlSIConfig",

        "repository": "MSSQL_INSTANCE-1",

        "databaseName": "MSSQLVDB"

    },

    "timeflowPointParameters": {

        "type": "TimeflowPointSemantic",

        "container": "MSSQL_DB_CONTAINER-1"

    }

}
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
Thanks!