This method allows to create new host prototypes.这种方法允许创建新的主机原型。
Parameters 参数
Host prototypes to create.主机原型创建。
Additionally to the standard host prototype properties, the method accepts the following parameters.除标准主机原型属性之外,该方法接受以下参数。
Examples 示例
Creating a host prototype 创建主机原型
Create a host prototype “{#VM.NAME}” on LLD rule “23542” with a group prototype “{#HV.NAME}”. Link it to host group “2”.使用组原型“{#HV.NAME}”为LLD规则“23542”创建主机原型“{#VM.NAME}”。 将其链接到主机组“2”。
Request:
Response:
- {
- "jsonrpc": "2.0",
- "result": {
- "hostids": [
- ]
- },
- "id": 1
- }
Source 来源
CHostPrototype::create() in frontends/php/include/classes/api/services/CHostPrototype.php.