要读取配置项的特定关系,请使用以下URL:
http://<servername>:<portnumber>/api/cmdb/cirelationships/CI Name/<Relationship Type>
假设您要获取CI的特定关系-例如:技术员正在使用的服务器-本地服务器上的端口号为8080,则URL应指定为:
http://localhost:8080/api/cmdb/cirelationships/CI Name/Charles/Uses
关键点:
操作名"read"应通过密钥"OPERATION_NAME"作为"POST attribute"发送。
技术员密钥应通过密钥"TECHNICIAN_KEY"作为"POST attribute"发送。
注意事项: 如果未指定结果格式,则API将以JSON格式返回输出。
|
必填参数:
|
<?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:57 PM</created-date>
<relationships for="Charles">
<relationship>
<name>Uses</name>
<ci>
<type>Server</type>
<name>opman-solaris1.csez.zohocorpin.com</name>
<relattributes/>
</ci>
<relationship>
</relationships>
</result>
</response>
</API>
{
"API": {
"response": {
"result": {
"created-date": "Sep 2, 2013 02:59 PM",
"message": "Successfully fetched.",
"status": "Success",
"statuscode": "200",
"relationships": {
"relationship": {
"ci": {
"type": "Mac Workstation",
"relattributes": {},
"name": "sdp-imac.csez.zohocorpin.com"
},
"name": "Uses"
},
"for": "Charles"
}
}
},
"operation": {
"name": "read"
},
"version": "1.0"
}
}