删除

描述

object host.delete(array hosts)

该方法允许删除主机

参数

(array) 要删除的主机的ID.

返回值

(object) 返回值包含已删除主机ID的hostid属性.

示例

删除多个主机

删除两个主机.

请求:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "host.delete",
  4. "params": [
  5. "13",
  6. "32"
  7. ],
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

响应:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "hostids": [
  5. "13",
  6. "32"
  7. ]
  8. },
  9. "id": 1
  10. }

来源

CHost::delete() in frontends/php/include/classes/api/services/CHost.php.