APIPythonOpen-Source Solutions

  • 1.  Mssql Provision

    Posted 02-20-2018 11:51:00 AM
    Hi,

    I am provisioning my Mssql dsource with the below API script:


    "container": {
            "group": "GROUP-42",
            "name": "VD_20",
            "type": "MSSqlDatabaseContainer"
        },
        "recoveryModel": "SIMPLE",
        "source": {
            "type": "MSSqlVirtualSource",
            "allowAutoVDBRestartOnHostReboot": true
        },
        "sourceConfig": {
            "databaseName": "VD_20",
            "instance": {
                "host": "WINDOWS_HOST-26",
                "type": "MSSqlInstanceConfig"
            },
            "repository": "MSSQL_INSTANCE-2",
            "type": "MSSqlSIConfig"
        },
        "timeflowPointParameters": {
            "timeflow": "MSSQL-TIMEFLOW-1",
            "timestamp": "2018-02-19T04:31:39.000Z",
            "type": "MSSqlTimeflow"
            
      },
        "type": "MSSqlProvisionParameters"
    }

    after executing the code i am getting the below error:

    {"type":"ErrorResult","status":"ERROR","error":{"type":"APIError","details":{"timeflowPointParameters":{"type":{"details":"Unexpected object type \"MSSqlTimeflow\". Expected \"TimeflowPointParameters\" or sub type.","action":null,"id":"exception.validation.object.type.unexpected","commandOutput":null,"diagnoses":null}}},"action":"Check your input parameters and try again.","id":"exception.validation.bad.input","commandOutput":null,"diagnoses":null}}

    Regards,
    Swathy





  • 2.  RE: Mssql Provision

    Posted 02-20-2018 11:56:00 AM
    That section wants a Type of TimeFlowPointParameters. Look at http://<engine ip>/api/#TimeflowPointParameters for possible object types.


  • 3.  RE: Mssql Provision
    Best Answer

    Posted 02-20-2018 12:00:00 PM

    === 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"

        }

    }


  • 4.  RE: Mssql Provision

    Posted 02-20-2018 12:04:00 PM
    Hi,

    This is related to API parameters that aren't correct as per the documentation you have to use the following :

    timeflowPointParameters:
            type: TimeflowPointTimestamp (*)
            timeflow: (required)
            timestamp: (required)

    You have to change the value the parameter in bold on your code no "MSSqlTimeflow" in the API

    Regards,

    Mouhssine


  • 5.  RE: Mssql Provision
    Best Answer

    Posted 02-20-2018 12:12:00 PM
    Hi, I would recommend provisioning via the cli first. Then destroy and provision again, this time with tracing on to see the corresponding json. You turn tracing on in the cli with the following command: setopt trace=true.

    I demonstrate that in this video:

    https://vimeo.com/170187276 


  • 6.  RE: Mssql Provision

    Posted 02-21-2018 05:25:00 AM
    Thanks Adam and Mouhssine.

    I have changed the property in the code as :

    "timeflowPointParameters": {
            "type": "TimeflowPointSemantic",

            "container": "MSSQL_DB_CONTAINER-254"
            
      },

    Regards,
    Swathy