API/Python/Open-Source Solutions

Expand all | Collapse all

How to differentiate between a VDB and a dSource while using the List Databases API ?

Jump to Best Answer
  • 1.  How to differentiate between a VDB and a dSource while using the List Databases API ?

    Posted 08-07-2017 03:02:00 PM
    I am using the List Databases API 
    $ curl -X GET -k http://delphix-server/resources/json/delphix/database \
        -b ~/cookies.txt -H "Content-Type: application/json"    I get the JSON output. I could not find a reference to a key/value pair to differentiate between a VDB and a dSource. Is there some differentiating factor to recognize if it is a VDB or dSource through the JSON output which is obtained?


  • 2.  RE: How to differentiate between a VDB and a dSource while using the List Databases API ?
    Best Answer

    Posted 08-07-2017 03:19:00 PM
    Hello,

    I think you would want to use the "source" API (http://nstack516.dcenter.delphix.com/api/#source).

    This has a column named "virtual" that shows "true" for VDBs or "false" for dSources:

    nstack516.dcenter> setopt trace=true
    nstack516.dcenter> /source list
    === GET /resources/json/delphix/source ===
    === RESPONSE ===
    {
        "type": "ListResult",
        "status": "OK",
        "result": [
            {
                "type": "MSSqlLinkedSource",
                "reference": "MSSQL_LINKED_SOURCE-5",
                "namespace": null,
                "name": "Vail",
                "description": null,
                "linked": true,
                "virtual": false,
                "restoration": false,
                "staging": false,
                "container": "MSSQL_DB_CONTAINER-53",
                "config": "MSSQL_SINGLE_CONFIG-26",
                "status": "DEFAULT",
                "runtime": {
                    "type": "MSSqlSourceRuntime",
                    "status": "RUNNING",
                    "accessible": true,
                    "databaseSize": 3145728,
                    "notAccessibleReason": null,
                    "enabled": "ENABLED"
                },
                "externalFilePath": null,
                "operations": {
                    "type": "LinkedSourceOperations",
                    "preSync": [],
                    "postSync": []
                },
                "sharedBackupLocation": "\\\\10-43-5-117\\SQLBackups\\PRDCH3BAZSQLCLU$BAZSQL_AG\\Bazooka",
                "backupLocationUser": null,
                "backupLocationCredentials": null,
                "stagingSource": "MSSQL_STAGING_SOURCE-5",
                "encryptionKey": "",
                "validatedSyncMode": "FULL_OR_DIFFERENTIAL"
            }
    ...etc...





  • 3.  RE: How to differentiate between a VDB and a dSource while using the List Databases API ?

    Posted 08-07-2017 03:30:00 PM
    You could also key off of "provisionContainer" in the /database json, as dSources would not have anything for this attribute:

    {

        "type": "ListResult",

        "status": "OK",

        "result": [

            {

                "type": "MSSqlDatabaseContainer",

                "reference": "MSSQL_DB_CONTAINER-31",

                "namespace": null,

                "name": "Dev vDB",

                "group": "GROUP-45",

                "provisionContainer": "MSSQL_DB_CONTAINER-30",

                "creationTime": "2017-08-07T15:00:06.323Z",

                "currentTimeflow": "MSSQL_TIMEFLOW-59",

                "previousTimeflow": null,

                "description": null,

                "runtime": {

                    "type": "MSSqlDBContainerRuntime",

                    "logSyncActive": false,

                    "preProvisioningStatus": null,

                    "lastRestoredBackupSetUUID": null

                },

                "restoration": false,

                "transformation": false,

                "masked": false,

                "os": "Windows",

                "processor": "x86",

                "sourcingPolicy": {

                    "type": "SourcingPolicy",

                    "logsyncEnabled": false,

                    "loadFromBackup": false

                },

                "performanceMode": "DISABLED",

                "delphixManaged": true

            },

            {

                "type": "MSSqlDatabaseContainer",

                "reference": "MSSQL_DB_CONTAINER-30",

                "namespace": null,

                "name": "AdventureWorksLT2008R2",

                "group": "GROUP-49",

                "provisionContainer": null,

                "creationTime": "2017-08-07T14:30:06.555Z",

                "currentTimeflow": "MSSQL_TIMEFLOW-56",

                "previousTimeflow": null,

                "description": null,

                "runtime": {

                    "type": "MSSqlDBContainerRuntime",

                    "logSyncActive": true,

                    "preProvisioningStatus": {

                        "type": "PreProvisioningRuntime",

                        "preProvisioningState": "ACTIVE",

                        "lastUpdateTimestamp": "Mon Aug 07 09:27:06 PDT 2017",

                        "status": "Restoring source database backup with UUID \"C4F42D79-0B69-4957-A2AF-D374DC801E67\" onto the staging database on staging host \"10.0.1.60\".",

                        "response": null,

                        "pendingAction": null

                    },

                    "lastRestoredBackupSetUUID": "C8681119-05EA-4E32-81D2-2B766313BA5B"

                },

                "restoration": false,

                "transformation": false,

                "masked": false,

                "os": "Windows",

                "processor": "x86",

                "sourcingPolicy": {

                    "type": "SourcingPolicy",

                    "logsyncEnabled": true,

                    "loadFromBackup": true

                },

                "performanceMode": "DISABLED",

                "delphixManaged": false

            },

            {

                "type": "MSSqlDatabaseContainer",

                "reference": "MSSQL_DB_CONTAINER-32",

                "namespace": null,

                "name": "QA vDB",

                "group": "GROUP-46",

                "provisionContainer": "MSSQL_DB_CONTAINER-30",

                "creationTime": "2017-08-07T15:10:02.358Z",

                "currentTimeflow": "MSSQL_TIMEFLOW-58",

                "previousTimeflow": null,

                "description": null,

                "runtime": {

                    "type": "MSSqlDBContainerRuntime",

                    "logSyncActive": false,

                    "preProvisioningStatus": null,

                    "lastRestoredBackupSetUUID": null

                },

                "restoration": false,

                "transformation": false,

                "masked": false,

                "os": "Windows",

                "processor": "x86",

                "sourcingPolicy": {

                    "type": "SourcingPolicy",

                    "logsyncEnabled": false,

                    "loadFromBackup": false

                },

                "performanceMode": "DISABLED",

                "delphixManaged": true

            }

        ],

        "job": null,

        "action": null,

        "total": 3,

        "overflow": false

    }



  • 4.  RE: How to differentiate between a VDB and a dSource while using the List Databases API ?

    Posted 08-07-2017 04:07:00 PM
    That's great. Thanks for your help Neal.


  • 5.  RE: How to differentiate between a VDB and a dSource while using the List Databases API ?

    Posted 08-07-2017 04:08:00 PM
    Just noticed that. Thanks for your help Adam.