Delete CI relationship

To delete a CI Relationship, use the following URL format:

http://<servername>:<portnumber>/api/cmdb/cirelationships

Assuming you are adding a change in the local server with port number 8080, the URL should be given as::

http://localhost:8080/api/cmdb/cirelationshipss

Keypoints:

  1. Input is an XML string sent as "POST attribute" with key "INPUT_DATA".

  2. The operation name "delete"  should be sent as a "POST attribute" with key "OPERATION_NAME".

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

Note:  

If no result format specified then API will return output in JSON format.

  • Parameter Result Format - Optional. specifies the return format ( XML or JSON )

 

Mandatory Parameters:  

  • Deleting CI relationships for a CI

  • Use * to delete all relationships with a CI, but this can be used by specifying the relationship type.

 

Sample Input XML
 

<API version="1.0" locale="en">

    <relationships>

            <deleterelationship>

                <fromci>sd-test5.zohocorpin.com</fromci>

                <relationshiptype>runs</relationshiptype>

                <relatedcis>

                        <ci>SSL_Reports_sd-test5.zohocorpin.com</ci>

                        <!--Syntax to delete all ci <ci>*</ci> -->

                </relatedcis>

            </deleterelationship>

     </relationships>

</API>

 

 

 

Sample Output: Success
 

<?xml version="1.0" encoding="UTF-8"?>

<API locale="en" version="1.0">

            <result>

                <statuscode>200</statuscode>

                <status>Success</status>

                <message>1 records removed successfully.</message>

                <created-date>Mar 22, 2013 10:58 AM</created-date>

            </result>

</API>

 

 


Sample Output: Failure

 

<?xml version="1.0" encoding="UTF-8"?>

<API locale="1.0">

<response>

            <result>

                <statuscode>200</statuscode>

                <status>No rows matched to delete.</status>

                <message>No relationship is defined for the CI(s) [SSL_Reports_sd-test5.zohocorpin.com] </message>

            </result>

</response>

</API>