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?

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
  • (Edited)
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.
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
  • sad

Posted 7 months ago

  • 0
  • 1
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,732 Points 4k badge 2x thumb
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/delp... \
-b ~/cookies.txt -H "Content-Type: application/json"

- Get objects on all envirnoments 

curl -X GET -k http://<DE>/resources/json/delp...\
-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/delp... \
-b ~/cookies.txt -H "Content-Type: application/json"

Regards,

Mouhssine
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
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.
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
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.
Photo of Mouhssine SAIDI

Mouhssine SAIDI

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

Try to pass the envirnoment name to this call


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


Replace "xxxxxxx" with your env name

Regards,

Mouhssine
Photo of anshul gupta

anshul gupta

  • 466 Points 250 badge 2x thumb
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 :(
(Edited)
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,732 Points 4k badge 2x thumb
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