APIPythonOpen-Source Solutions

  • 1.  Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?

    Posted 02-27-2018 05:59:00 AM
    Question 1) I have list of machine IPs with me in my application. When user select a IP(host address), I want to fetch available dSources using APIs. Any API or curl command will help.
    Also, If there is any API which fetches all the dSource list with details(including IP) that can also help.


    Question 2)  I can fetch list of environments through API :
    http://10.130.25.228/resources/json/delphix/host and this brings me environments with their IPs.
    Can we find what dSource and VDB are created using this environment (So I can actually map which IP/Host address  is tagged with which dSource/VDB)


    Thanks in advance.
    #dxToolkit
    #Virtualization


  • 2.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?
    Best Answer

    Posted 02-27-2018 07:50:00 AM
    Hi Anshul,

    For both questions you will have to play with those calls

    - List all envirnoments declared on the engine

     curl -X GET -k http://<DE>/resources/json/delphix/environment \
    -b ~/cookies.txt -H "Content-Type: application/json"

    - Get objects on all envirnoments 

    curl -X GET -k http://<DE>/resources/json/delphix/sourceconfig\
    -b ~/cookies.txt -H "Content-Type: application/json"

    - Get the status of the object if it's virtual or not

    curl -X GET -k http://<DE>/resources/json/delphix/source \
    -b ~/cookies.txt -H "Content-Type: application/json"

    Regards,

    Mouhssine




  • 3.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?

    Posted 02-27-2018 08:50:00 AM
    From this: http://10.130.25.228/resources/json/delphix/sourceconfig
    I am getting IP and dSource/VDB name for ORACLE databases:

    "jdbcConnectionString":"jdbc:oracle:thin:@10.120.25.175:1521:orcl"

    But for MSSQL DBs we are not getting any IP.



  • 4.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?

    Posted 02-27-2018 09:41:00 AM
    Hi,

    Try to pass the envirnoment name to this call


    curl -X GET -k http://<DE>/resources/json/delphix/sourceconfig?environment=xxxxxxx \
    -b ~/cookies.txt -H "Content-Type: application/json"


    Replace "xxxxxxx" with your env name

    Regards,

    Mouhssine


  • 5.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?

    Posted 02-27-2018 10:28:00 AM
    For oracle i used this API:

    http://server/resources/json/delphix/sourceconfig?environment=OracleEnvRefrence

    Response:

    {"type":"ListResult","status":"OK","result":[{"type":"OracleSIConfig","reference":"ORACLE_SINGLE_CONFIGXX","namespace":null,"name":"orclX","linkingEnabled":true,"discovered":false,"environmentUser":"HOST_USER-XX","repository":"ORACLE_INSTALL-XX","user":"XXX","credentials":{"type":"PasswordCredential","password":"********"},"services":[{"type":"OracleService","jdbcConnectionString":"jdbc:oracle:thin:@10.10.10.10:1521:oXX","discovered":false}],"databaseName":"oXX","uniqueName":"oXX","cdbType":"NON_CDB","nonSysUser":null,"nonSysCredentials":null,"instance":{"type":"OracleInstance","instanceNumber":1.0,"instanceName":"oXX"}}],"job":null,"action":null,"total":1,"overflow":false}

    So here I got my IP as JDBC connection String^

    For MSSQL:

    API
    http://server/resources/json/delphix/sourceconfig?environment=WINDOWS_HOST_ENVIRONMENT-XX

    Response:
    {"type":"ListResult","status":"OK","result":[{"type":"MSSqlSIConfig","reference":"MSSQL_SINGLE_CONFIG-XX","namespace":null,"name":"VD_XX","linkingEnabled":true,"discovered":false,"environmentUser":"HOST_USER-XX","repository":"MSSQL_INSTANCE-XX","databaseName":"VD_XX","user":null,"credentials":null,"recoveryModel":"SIMPLE"}

    Here I don't get any IP :(


  • 6.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?
    Best Answer

    Posted 02-27-2018 10:51:00 AM
    I think I can do it by getting all host first, which brings me IP with host reference:  http://server/resources/json/delphix/host
    Then using host reference i get environment and environment reference:
    http://server/resources/json/delphix/environment
    Then with environment reference I get all VDB and dSources:
     http://server/resources/json/delphix/sourceconfig?environment=WINDOWS_HOST_ENVIRONMENT-XX

    This is how I get IP of source mapped with dSources and VDBs.

    Thanks Mouhssine for your help.


  • 7.  RE: Is there any way I can get list of dSources through APIs providing IP address of the source environment as parameter? Or Can I find out which dSource and VDB are created from which Environment?

    Posted 02-27-2018 10:57:00 AM
    Hi Anshul,

    The idea to get the type and name values from "dsourceconfig" and store that on a matrix and loop on valuse to crosscheck with the output of "source" output where virtualized=false.

    This way you get the list of all dsources stored on a given envirnoment

    Regards,

    Mouhssine