Delphix Products

 View Only
  • 1.  API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 03-21-2019 08:11:00 AM
    Please help me with the API call to automate a report to get the VDB status , and the host/target server on which it is mounted
    #Virtualization


  • 2.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,
    Best Answer

    Posted 03-21-2019 02:44:00 PM
    Hi Anusha-

    Details on the VDB status are found under /source in the CLI and API.  Here's an example request from a CLI session collecting the values you requested. In the following output, VDBs would be indicated where "virtual" is TRUE:
    delphix-engine> source list display=name,runtime.status,runtime.activeInstances.0.hostName,mountBase,virtual
    NAME RUNTIME.STATUS RUNTIME.ACTIVEINSTANCES.0.HOSTNAME MOUNTBASE VIRTUAL DBOMSRCECB2A RUNNING gi-rh75-base - false iotest RUNNING gi-rh75-base /mnt/provision true joyful RUNNING - - false dx99vvel5XXIt95QI7keQ_joyful RUNNING - /work/4213dcf3-bfdd-3848-397b-047a98cc5714-staging-1 false
    Details on the /source API can be found on your Engine by accessing the relevant API page (note, you will need to login to the usual Admin interface first to obtain an authenticated session)

    http://delphix-engine/api/#Source

    You may also consider exploring dxToolkit, a free utility developed and supported by our Services team. One of the dxToolkit utilities, dx_get_db_env generates this report detail for you as well.  Here's an example using commands from the page at https://github.com/delphix/dxtoolkit/wiki/dx_get_db_env
    Seans-MacBook:dxtoolkit2 $ ./dx_get_db_env -engine seans-engine.delphix.com -type vdb    Appliance            Hostname             Database                       Group           Type     SourceDB                       Parent snapshot                     Used(GB)   Status     Enabled    Unique Name                    Parent time                         VDB creation time                     -------------------- -------------------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ---------- ---------- ---------- ------------------------------ ----------------------------------- -----------------------------------   seans-engine.delphix seanora122tgt        iotest                         Oracle          VDB      DBOMSRCECB2A                   2019-03-14 14:58:55 PDT             1.45       RUNNING    enabled    iotest                         N/A                                 2019-03-14 16:17:47        


  • 3.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 03-21-2019 04:18:00 PM
    Anusha make it easy on yourself and get dxtoolkit:
    https://github.com/delphix/dxtoolkit

    Please note it's an open source project, not officially supported by Delphix, but it has robust community support.



  • 4.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 03-26-2019 04:17:00 AM
    Thank you.. do i need to checkin the code in the github and use the utility


  • 5.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 03-26-2019 04:26:00 PM
    To use the utility, please consult the README which is just a little lower on the page.  There is a "releases" link which will take you to compiled code.  You do not need to checkout and compile the code yourself.  


  • 6.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 05-02-2019 07:48:00 AM
    Not able to get pre-requisites to get the dxtoolkit. Could you please help me get the details. Am trying to get the host by retrieving the result from result=$(curl -s -X GET -k https://${engine}/resources/json/delphix/sourceconfig/{ref} \ -b ~/cookies.txt -H "Content-Type: application/json") getting the complete junk, instead of the required field. Please can you help me with the command to get only the host name


  • 7.  RE: API to get VDB status(Running/Not running), host/target environment on which it is hosted,

    Posted 05-02-2019 02:46:00 PM
    Hi Anusha,

    You can't get a host name from sourceconfig but you will get an environment ref, 
    so you will need to fetch environment list and a host list.


    What prerequisites are missing for dxtoolkit ? You can download a precompiled version for your OS and use it without perl or any additional library.

    https://github.com/delphix/dxtoolkit/releases/tag/v2.3.8.1


    regards,
    Marcin