Add CI Relationships



To add relationship between CIs, use the following format:

http://<hostname>:<portnumber>/sdpapi/cmdb/cirelationships

Assuming you are adding relationship between two CIs in the local server with port number 8080, the URL should be given as::

http://localhost:8080/sdpapi/cmdb/cirelationships

Keypoints:

  1. The operation name "add"  should be sent as a "POST attribute" with key "OPERATION_NAME".

  2. The technician key should be sent as a "POST attribute" with key "TECHNICIAN_KEY".

Notes:

  1. Cannot add relationship attribute for software CI Type.

  2. If any error thrown by API then the remaining relationship won't get added.


Mandatory parameters:

  1. <relationships> - If not specified or empty tag then API will throw the error like ' tag cannot be empty.' with the code 3026.

  2. <addrelationship> If not specified or empty tag then API will throw the error like ' tag cannot be empty.' with the code 3026.

  3. Can specify more than one relationship using <addrelationship> tag.

  4. <toci> - Add relationship to the specified CI.

  5. <relationshiptype> - to specify the relationship type between two CI(s).

  6. <relatedcis> -  parent tag for the relationship CI(s)

  7. <citype> -  used to specify the relationship CI's  type.

  8. <ci> - used to specify the relationship CI(s)

  9. <name> - to specify the relationship ci name

  10. <relationattributes> - Used to specify the relationship attributes

Limitations:

  1. Cannot add relationship attribute for software CI Type.

  2. If any error thrown by API then the remaining relationship won't get added


Sample Input XML for adding a relationship between workstation and access point (using relationship attributes)

 

<?xml version="1.0" encoding="UTF-8"?>
<API version="1.0" locale="en">
    <records>
        <relationships>
            <addrelationship>
                <toci>balaguru.zohocorpin.com</toci>
                <relationshiptype>Connected to</relationshiptype>
                <relatedcis>
                    <citype>Printer</citype>
                    <ci>
                        <name>DLF11thFloor-I.csez.zohocorpin.com</name>
                        <relationattributes>
                            <attribute>
                                <name>AMC</name>
                                <value>5789</value>
                            </attribute>
                            <attribute>
                                <name>Maintained By</name>
                                <value>IT Department</value>
                            </attribute>
                        </relationattributes>
                    </ci>
                    <ci>
                        <name>firstfloor.zohocorpin.com</name>
                        <relationattributes>
                            <attribute>
                                <name>AMC</name>
                                <value>3789</value>
                            </attribute>
                            <attribute>
                                <name>Maintained By</name>
                                <value>IT Department</value>
                            </attribute>
                        </relationattributes>
                    </ci>
                </relatedcis>
            </addrelationship>
        </relationships>
    </records>
</API>

 



SeviceDeskPlus - 帮助台和资产管理软件
Copyright © 2006-2017 卓豪(北京)技术有限公司版权所有