Get All CI(s) Count



To read (obtain) the number of CIs available in your organization use the following URL format:

http://<hostname>:<port>/api/cmdb/ci/count/all/

Assuming you want to read the number of CIs associated with the local server with port number 8080, the URL should be given as:

http://localhost:8080/api/cmdb/ci/count/all


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:  

  • To read CIs count of a specific CI Type, give the CI Type's name in the URL instead of all.

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

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


Sample XML Output for Get All CI(s) Count:

 

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

<response>

<result>

<statuscode>200</statuscode>

<status>Sucess</status>

<message>Successfully fetched.</message>

<created-date>Mar 13, 2013 05:10 PM</created-date>

<field-names>

<name type="Integer">Count</name>

; </field-names>

<field-values totalRecords="1">

<record>

<value>30</value>

</record>

</field-values>

</result>

</response>



Sample JSON Output for Get All CI(s) Count:

{
    "API": {
        "response": {
            "result": {
                "created-date": "Sep 2, 2013 12:11 PM",
                "field-names": {
                    "name": {
                        "content": "Count",
                        "type": "Integer"
                    }
                },
                "field-values": {
                    "record": {
                        "value": "1"
                    },
                    "totalRecords": "1"
                },
                "message": "Successfully fetched.",
                "status": "Success",
                "statuscode": "200"
            }
        },
        "version": "1.0"
    }
}



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