On this page
hostgroup.create
Description
object hostgroup.create(object/array hostGroups)
This method allows to create new host groups.
This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
Parametri
(object/array) Gruppi host da creare. Il metodo accetta gruppi host
con le proprietà del gruppo host standard.
Restituisce i valori
(object) Restituisce un oggetto contenente gli ID del gruppi host creato
nella proprietà groupids. L'ordine degli ID restituiti
corrisponde all'ordine dei gruppi host passati.
Esempi
Creating a host group
Create a host group called "Linux servers".
Request:
{
"jsonrpc": "2.0",
"method": "hostgroup.create",
"params": {
"name": "Linux servers"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"groupids": [
"107819"
]
},
"id": 1
}
Fonte
CHostGroup::create() in ui/include/classes/api/services/CHostGroup.php.