[comment]: # translation:outdated

[comment]: # ({8f15992f-8f15992f})
# 删除

[comment]: # ({/8f15992f-8f15992f})

[comment]: # ({8dc16904-f7c792a6})
### 描述

`object hostprototype.delete(array hostPrototypeIds)`

该方法允许删除主机原型

::: noteclassic
该方法适用于*管理员*和*超级管理员*用户类型。可以在用户角色设置中撤销调用该方法的权限。有关详细信息，参阅[用户角色](/manual/web_interface/frontend_sections/administration/user_roles)。
:::

[comment]: # ({/8dc16904-f7c792a6})

[comment]: # ({65284f99-65284f99})
### 参数

`(array)` 要删除主机原型的ID。

[comment]: # ({/65284f99-65284f99})

[comment]: # ({78e6f07c-78e6f07c})
### 返回值
`(object)` 在`hostids`属性中返回已删除主机原型的ID对象。

[comment]: # ({/78e6f07c-78e6f07c})

[comment]: # ({b41637d2-b41637d2})
### 示例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({33c5226c-48be53a2})
#### 删除多个主机原型

删除两个主机原型:

请求:

```json
{
    "jsonrpc": "2.0",
    "method": "hostprototype.delete",
    "params": [
        "10103",
        "10105"
    ],
    "auth": "3a57200802b24cda67c4e4010b50c065",
    "id": 1
}
```

响应:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "hostids": [
            "10103",
            "10105"
        ]
    },
    "id": 1
}
```

[comment]: # ({/33c5226c-48be53a2})

[comment]: # ({dd993f84-dd993f84})
### 来源

CHostPrototype::delete() in
*ui/include/classes/api/services/CHostPrototype.php*。

[comment]: # ({/dd993f84-dd993f84})
