The following is a sample SOAP call that establishes a given CI relationship between a parent and child CI
Release: 17.x
CA Service Desk Manager
The web services call of interest is made to the bmhier object, the Business Management Object:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
<soapenv:Header/>
<soapenv:Body>
<ser:createObject>
<sid>123456789</sid>
<objectType>bmhier</objectType>
<attrVals>
<!--Zero or more repetitions:-->
<string>parent</string>
<string>[PARENT CI UUID]</string>
<string>child</string>
<string>[CHILD CI UUID]</string>
<string>ci_rel_type</string>
<string>300016</string>
<string>delete_flag</string>
<string>0</string>
</attrVals>
<attributes>
</attributes>
<!--Optional:-->
<createObjectResult></createObjectResult>
<!--Optional:-->
<newHandle></newHandle>
</ser:createObject>
</soapenv:Body>
</soapenv:Envelope>
Of interest are the values in the attrVals parameter list:
<string>parent</string>
<string>[PARENT CI UUID]</string>
This parameter is accepting an ID value of a given CI entry construed to be the parent CI of the relationship. To list all CI's and their ID values, please run
pdm_extract -f "Select id, resource_name from ca_owned_resource"
For the specific id value described above:
pdm_extract -f "Select id, resource_name from ca_owned_resource where id = U'[PARENT CI UUID]'"
The "child" parameter is similar to the "parent" parameter in that it is also a CI that is being identified by its id value
pdm_extract -f "Select id, resource_name from ca_owned_resource where id = U'[CHILD CI UUID]'"
<string>ci_rel_type</string>
<string>300016</string>
This is the relationship parameter, identified by the ci_rel_type table, id field. To list all possible relationships that exist between parent and child CI's, please run
pdm_extract -f "Select id, parenttochild, childtoparent from ci_rel_type"
For the specific id value described above:
pdm_extract -f "Select id, parenttochild, childtoparent from ci_rel_type where id = 300016"
Executing this pdm_extract command reveals the nature of the relationship to be:
TABLE ci_rel_type
id parenttochild childtoparent
{ "300016" ,"is the child of" ,"is the parent of" }
Other relationships are possible, depending on your needs, such as "has access to" or "is clone of".
For information on using SOAPUI to interact with SDM's SOAP Web Services, please review SOAP Web Services Demo using SOAPUI
Please see List CMDB CI relationships for a specific parent CI and child Family through SOAP for the corresponding way to list relationships
All of the above pdm_extract commands should be executed from an Admin Command Prompt on the given SDM Server.
Broadcom Support is not permitted to assist you to develop your custom code. Converting the above code for use in another platform is outside the scope of Support as well.