APIMaskingSidekickPythonOpen-Source Solutions

 View Only
  • 1.  Deleting dsource using API or CLI

    Posted 04-28-2022 07:57:00 AM
    Dear user,

    We have a use case to destroy dsource once the dsource replicated to another engine. Is it possible via API or CLI?

    ------------------------------
    Nitin Gupta
    Delphix Community Members
    ------------------------------


  • 2.  RE: Deleting dsource using API or CLI

    Posted 04-28-2022 05:32:00 PM

    Hello Nitin,
    If I understand correctly,  you want to replicate a dsource to a secondary engine and after that delete the dsource on the primary engine.
    In order to do that you need to do first a failover of that replication profile and after that you will be able to delete it with a simple api call. 

    Let me know if this is what you want to do and I will provide you with the API call.

    Thanks
    diego



    ------------------------------
    Diego Loureda
    Director, Technical Services
    Delphix
    ------------------------------



  • 3.  RE: Deleting dsource using API or CLI

    Posted 04-28-2022 05:39:00 PM
    Hi Diego,

    Yes, thats exactly what I want to achieve. 

    Thanks

    Regards,
    Nitin Gupta


    ------------------------------
    Nitin Gupta
    Delphix Community Members
    ------------------------------



  • 4.  RE: Deleting dsource using API or CLI

    Posted 04-29-2022 01:18:00 PM
    Hi Nitin,

    Below is the example for deleting the dsource from API . 

    curl -v -X POST -k --data @- http://<Delphix_eng>/resources/json/delphix/database/{ref}/delete -b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
    {
      "type": "database",
      "objectReferences" : ["DBNAME"]
    }
    EOF


    More details can be found in the below Documentation 

    https://docs.delphix.com/docs/developer-s-guide/web-services-api-guide/gui-api-mapping


    ------------------------------
    Ramasubramanian Sankaran
    Senior Principal
    Delphix
    ------------------------------



  • 5.  RE: Deleting dsource using API or CLI

    Posted 05-01-2022 11:49:00 PM
    Thanks Rama and Diego. I was able to achieve the results with DELETE API method. I tried the one you have shared but not sure what value should go as objectReference.

    ------------------------------
    Nitin Gupta
    Delphix Community Members
    ------------------------------



  • 6.  RE: Deleting dsource using API or CLI

    Posted 05-02-2022 10:38:00 AM
    Hi Nitin,

    You can get the reference from the below command and use the same container reference for your dsource on the delete dsource command. 

    curl -X GET -k http://Delphix-Engine/resources/json/delphix/database/ \
    -b ~/cookies.txt -H "Content-Type: application/json"

    {"type":"ListResult","status":"OK","result":[{"type":"OracleDatabaseContainer","reference":"ORACLE_DB_CONTAINER-5",

    "namespace":null,"name":"<Dsource_name>",......



    Delete the dsource as per below.

    curl -X POST -k http://Delphix-Engine/resources/json/delphix/database/ORACLE_DB_CONTAINER-5/delete \
    -b ~/cookies.txt -H "Content-Type: application/json"

     



    ------------------------------
    Thanks
    Ramasubramanian Sankaran
    ------------------------------