object hostgroup.create(object/array hostGroups)
This method allows to create new host groups.此方法允许创建新的主机组。
(object/array)
Host groups to create. The method accepts host groups with the standard host group properties.主机组创建。 该方法接受具有标准主机组属性的主机组
(object)
Returns an object containing the IDs of the created host groups under the groupids
property. The order of the returned IDs matches the order of the passed host groups.返回包含“groupids”属性下创建的主机组的ID的对象。返回的ID的顺序与传递的主机组的顺序相匹配。
Create a host group called "Linux servers".建名为“Linux服务器”的主机组。
Request:
{
"jsonrpc": "2.0",
"method": "hostgroup.create",
"params": {
"name": "Linux servers"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CHostGroup::create() in frontends/php/include/classes/api/services/CHostGroup.php.