Get CI relationship details

 

To read relationship between CIs use the following URL format:

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

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

http://localhost:8080/api/cmdb/cirelatiionships/CI Name/

 


Keypoints:

  1. The operation name "read"  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

 

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 )

 

Sample XML Output for Read CI Relationship

 

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

<API version="1.0">

    <response>

            <result>

                <statuscode>200</statuscode>

                <status>Success</status>

                <message>Successfully fetched.</message>

                <created-date>Mar 22, 2013 12:10 PM</created-date>

                       <relationships for="sdpvm-w2k8.zohocorpin.com.">

                           <relationship>

                            <name>Managed by</name>

                              <ci>

                                  <type>Technician</type>

                                   <name>Charles</name>

                                   <relattributes/>

                               </ci>

                           </relationship>

                           <relationship>

                           <name>Runs</name>

                              <ci>

                                  <type>Operating System</type>

                                  <name>Microsoft® Windows Server® 2008 Standard (sdpvm-w2k8.zohocorpin.com.)</name>

                              </ci>

                        </relationship>

                        <relationship>

                        <name>Uses</name>

                          <ci>

                                <type>Storage Device</type>

                                 <name>san-1</name>

                           </ci>

                         </relationship>

                         <relationship>

                        <name>Hosts</name>

                           <ci>

                               <type>IT Service</type>

                                <name>E-mail</name>

                                <relattributes/>

                          </ci>

                           </relationship>

                       </relationships>

            </result>        

    </response>

</API>


 

 

 

 

Sample JSON Output for Read CI Relationship

 

 

 

Note: Please note that the Input and Output XML formats have been changed.

 

{

    "API": {

        "response": {

            "result": {

                "created-date": "Sep 2, 2013 01:09 PM",

                "message": "Successfully fetched.",

                "status": "Success",

                "statuscode": "200",

                "relationships": {

                    "relationship": {

                        "ci": {

                            "type": "Operating System",

                            "relattributes": {

                                "attribute": [

                                    {

                                        "value": "-",

                                        "name": "Installed On"

                                    },

                                    {

                                        "value": "-",

                                        "name": "Version"

                                    },

                                    {

                                        "value": "-",

                                        "name": "Installation Location"

                                    }

                                ]

                            },

                            "name": "Microsoft® Windows Server® 2008 Standard (sdpvm-w2k8.zohocorpin.com.)"

                        },

                        "name": "Runs"

                    },

                    "for": "sdpvm-w2k8.zohocorpin.com."

                }

            }

        },

        "operation": {

            "name": "read"

        },

        "version": "1.0"

    }

}