object hostgroup.create(object/array hostGroups)
此方法允许创建新的主机组.
(object/array)
创建主机组.该方法接受具有标准主机组属性的主机组.
(object)
在groupids
属性下返回包含已创建主机组ID的对象.返回主机组ID的顺序与传入的主机组顺序一致.
创建名为"Linux servers"的主机组.
请求:
{
"jsonrpc": "2.0",
"method": "hostgroup.create",
"params": {
"name": "Linux servers"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
响应:
CHostGroup::create() in frontends/php/include/classes/api/services/CHostGroup.php.