要使用过滤器删除 CI,请使用以下 URL 格式:
http://<servername>:<portnumber>/api/cmdb/ci
假设您要删除本地服务器中端口号为 8080 的 CI,URL 应为:
http://localhost:8080/api/cmdb/ci
关键字
Input 是一个 XML 字符串,作为 “POST attribute”发送,关键字为 “INPUT_DATA”。
操作名称 “delete ”应作为 “POST attribute”发送,关键字为 “OPERATION_NAME”。
技术员密钥应以 “POST attribute”的形式发送,密钥名为 “TECHNICIAN_KEY”。
注意: 如果未指定结果格式,API 将以 JSON 格式返回输出。
|
必填参数:
|
输入 XML 示例
<?xml version="1.0" encoding="UTF-8"?>
<API version="1.0">
<citype>
<name>Switch Ports</name>
<criterias>
<criteria>
<parameter> <name compOperator="CONTAINS">CI Name</name><value>1 (hp2650.csez.zohocorpin.com)</value></parameter>
</criteria>
</criterias>
</citype>
</API>
使用 CI 类型删除工作站 CI 的 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>
响应示例: 成功
<?xml version="1.0" encoding="UTF-8"?> <result> <API version="1.0">
|
响应示例: 失败
<?xml version="1.0" encoding="UTF-8"?> |
删除打印机 CI 的 JSON 响应
{
|