获取 CI 类型详细信息

获取 CI 类型详细信息

要读取 CI 类型的详细信息,请使用以下 url 格式:

http://<servername>:<portnumber>/api/cmdb/citype/<CI Type>

假设您正在获取本地服务器上端口号为 8080 的 CI 类型的详细信息,URL 应为:

http://localhost:8080/api/cmdb<CI Type>

关键字

  1. Input 是一个 XML 字符串,作为 “POST attribute”发送,关键字为 “INPUT_DATA”。

  2. 操作名称 “read”应作为 “POST attribute”发送,关键字为 “OPERATION_NAME”。

  3. 技术员密钥应以 “POST attribute”的形式发送,其关键字为 “TECHNICIAN_KEY”。

注意:  

如果未指定结果格式,API 将以 JSON 格式返回输出。

  • CI 类型 - 必填。 CI 类型名称。 (可以不区分大小写)。

  • 参数结果格式 - 可选。指定返回格式(XML 或 JSON)

XML 输出示例:

 

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

<?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>Sep 2, 2013 01:02 PM</created-date>

            <field-names>

                <name type="String">Attribute Name</name>

                <name type="String">Data Type</name>

            </field-names>

            <field-values totalRecords="10">

                <record>

                    <value>Availability Target(%)</value>

                    <value>String</value>

                </record>

                <record>

                    <value>Service Support Hours</value>

                    <value>String</value>

                </record>

                <record>

                    <value>Cost</value>

                    <value>String</value>

                </record>

                ..................................

                ..................................

                ..................................

                ..................................

                <record>

                    <value>Incident restoration target</value>

                    <value>String</value>

                </record>

                <record>

                    <value>Site</value>

                    <value>String</value>

                </record>

                <record>

                    <value>Description</value>

                    <value>String</value>

                </record>

            </field-values>

        </result>

    </response>

</API>

 

JSON 输出示例:

 

{

    "API": {

        "response": {

            "result": {

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

                "field-names": {

                    "name": [

                        {

                            "type": "String",

                            "content": "Attribute Name"

                        },

                        {

                            "type": "String",

                            "content": "Data Type"

                        }

                    ]

                },

                "message": "Successfully fetched.",

                "field-values": {

                    "record": [

                        {

                            "value": [

                                "Availability Target(%)",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Service Support Hours",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Cost",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Incident restoration target",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Owned By",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Business Impact",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "CI Name",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Site",

                                "String"

                            ]

                        },

                        {

                            "value": [

                                "Description",

                                "String"

                            ]

                        }

                    ],

                    "totalRecords": "10"

                },

                "status": "Success",

                "statuscode": "200"

            }

        },

        "version": "1.0"

    }

}