The Qualify the Name of the Object call specifies an object by prepending it with the name of the Domain in which it is contained. The name of the Domain should be separated from the name of the object by a period.


Example:


Development.demoenv


This specifies that the “demoenv” Environment required can be found in the “Development” Domain.


Of course, the “Development” Domain itself may not be uniquely named- especially if multiple teams are using Sub-Domains to create continuous pipelines. In this case, even Development.demoenv could be ambiguous. To work around this, you can specify as many parent Domains as are necessary to uniquely identify the object.



Example:


USA.Development.demoenv


This specifies that the “demoenv” Environment required can be found in the Divisional “Development” Sub-Domain of Domain “USA”. Divisional Domains are a DeployHub Pro feature.


Use the object’s internal ID.

Every object in DeployHub has a unique ID. This is used internally in the DeployHub database as a primary/foreign key. An object is given an ID when it is first created, and that ID never changes or is re-used, even if the object itself is deleted. Therefore, if you know the ID of the object you can specify that in the API and DeployHub will know which object you’re referring to, even if the name is not unique.


The query tools in the DeployHub API generally return the object’s internal ID as well as its name. Once you know the ID you can use it in subsequent calls to the API.


To use the ID, just place it where you would normally place the object’s name. DeployHub will assume you’re specifying an ID if the name given is fully-numeric.

NOTE: Do not create objects with fully numeric names – DeployHub will not be able to determine if this is an object id or the object name.

Query Issued:


http://dh-host:8080/dmadminweb/API/Environment/4


Result:

{

       "success": true,

       "result": {

               "Applications": [

                       {

                               "completed": "",

                               "deploymentid": 463,

                               "exitcode": 0,

                               "id": 118,

                               "name": "UNIXApp",

                               "predecessorid": 0,

                               "Versionid": 118,

                               "Versionname": "UNIXApp"

                       }

               ],

               "Domain": "GLOBAL.Test",

               "id": 4,

               "name": "UNIX_TestEnvironment",

               "ownerUser": "admin",

               "summary": ""

       }

}


Here, we asked DeployHub to return the details for Environment “4”. Since this name is fully numeric, DeployHub took this to be the internal ID and returned the results for Environment with the internal ID of 4 – this being “UNIX_TestEnvironment”.


NOTE: IDs are only unique to a specific object type. You can have an Environment, a server, a User and a User Group, all with the Internal ID of “4”. However, there can only ever be one Environment with an ID of “4”, only one server with an ID of “4” and so on.