要将CI属性添加到CI类型,请使用以下URL格式:
http://<hostname>:<port>/api/cmdb/ci/citypeattributes
假设要在端口号为8080的本地服务器中将CI属性添加到CI类型,则URL应指定为:
http://localhost:8080/api/cmdb/ci/citypeattributes
关键点:
输入是以密钥"INPUT_DATA"作为"POST attribute"发送的XML字符串。
操作名"add"应通过密钥"OPERATION_NAME"作为"POST attribute"发送。
技术员密钥应通过密钥"TECHNICIAN_KEY"作为"POST attribute"发送。
注意事项: 如果未指定结果格式,则API将以JSON格式返回输出。
|
用于将CI类型属性添加到CI类型访问点的XML输入示例:
<?xml version="1.0" encoding="UTF-8"?>
<API version="1.0" locale="en">
<addattribute>
<tocitype>Access Point</tocitype>
<attributes>
<attribute>
<parameter><name>Attribute Name</name><value>Cost Center</value></parameter>
<parameter><name>Description</name><value>Access Point coverage area in meters</value></parameter>
<parameter><name>Type</name><value>single-line</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Account Number</value></parameter>
<parameter><name>Description</name><value>Issues in business service for mulit line</value></parameter>
<parameter><name>Type</name><value>single-line</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Resolution</value></parameter>
<parameter><name>Description</name><value>Issues in business service for mulit line</value></parameter>
<parameter><name>Type</name><value>multi-line</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Bank Account</value></parameter>
<parameter><name>Description</name><value>number of issues while creating business service</value></parameter>
<parameter><name>Type</name><value>number</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Depreciation Amount</value></parameter>
<parameter><name>Description</name><value>number of issues while creating business service</value></parameter>
<parameter><name>Type</name><value>number</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Renewal Date</value></parameter>
<parameter><name>Description</name><value>Dated issues while creating business service</value></parameter>
<parameter><name>Type</name><value>datetime</value></parameter>
</attribute>
<attribute>
<parameter><name>Attribute Name</name><value>Pick Service Type</value></parameter>
<parameter><name>Description</name><value>Types of services while creating business service</value></parameter>
<parameter><name>Type</name><value>pick-list</value></parameter>
<parameter><name>List Item</name><value>Switch-1,Switch-2,Switch3</value></parameter>
</attribute>
</attributes>
</addattribute>
</API>
XML应答示例:
<?xml version="1.0" encoding="UTF-8"?>
<API locale="en" version="1.0">
<response>
<result>
<statuscode>200</statuscode>
<status>Success</status>
<message>Relationship added successfully.</message>
<created-date>Mon Jul 05 18:18:39 GMT+05:30 2010</created-date>
</result>
</response>
</API>