APIPythonOpen-Source Solutions

  • 1.  How to know if a dSource or VDB is active using API?

    Posted 05-29-2018 06:18:00 AM
    resources/json/delphix/database
    I am using this API to fetch dSource list. It is returning inactive VDBs also.


  • 2.  RE: How to know if a dSource or VDB is active using API?
    Best Answer

    Posted 05-31-2018 09:21:00 PM
    Hey Anshul,

    Unfortunately, at this time there is no single API call that will do this for you. It would require a bit of post processing. You would need to get the list of sources (resources/json/delphix/source). Once you have the list of sources you can look at the "runtime" object, which has a property called "status".

    Below is an example of retrieving a specific source with the response. I have substituted large, unrelated chunks from the response with "..." to make it more convenient to read.

    GET /resources/json/delphix/source/ORACLE_LINKED_SOURCE-1
    RESPONSE
    {
        "type": "OKResult",
        "status": "OK",
        "result": {
            "type": "OracleLinkedSource",
            "reference": "ORACLE_LINKED_SOURCE-1",
            ...
            "runtime": {
                "type": "OracleSourceRuntime",
                "status": "RUNNING",    <------------------
                ...
            },
            ...
        },
        "job": null,
        "action": null
    }

    You could write a script that gets all sources, parses the output and filters. A command line json processor like jq (https://stedolan.github.io/jq/) can be pretty handy, but of course this can also be done in many other ways.

    Hope that helps!

    /abdullah