How to get dynamic container name for the particular VDB

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hi Guys,

Could you please tell us how to get the container name for that particular VDB.While we are working on the API we are searching the entire database code to get the list of container available.
It is possible to get it or we can list out the detail of the selected VDB?

Thanks

Regards,
Swathy
Photo of Swathy Sukumar

Swathy Sukumar

  • 866 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Adam Bowen

Adam Bowen, Official Rep

  • 17,418 Points 10k badge 2x thumb
Official Response
Swathy, 

When you create the VDB, it returns the container name in the response. If you need to grab the container name for a VDB at a different time, like in another job, then you would get the list of VDB's and use logic to grab the one for your name. In our github repo, you can leverage the find_obj_by_name class. For example: https://github.com/CloudSurgeon/delphixpy-examples/blob/master/dx_provision_vdb.py#L398

Then your container reference is the reference of that object. 

So in the example at that link, the following would print the container id:

print vdb_obj.reference