[comment]: # translation:outdated

[comment]: # ({5ebe3ff8-5ebe3ff8})
# hostgroup.create

[comment]: # ({/5ebe3ff8-5ebe3ff8})

[comment]: # ({0a562b4e-06c5b0b6})
### Descrizione

`object hostgroup.create(object/array hostGroups)`

Questo metodo consente di creare nuovi gruppi di host.

::: noteclassic
Questo metodo è disponibile solo per gli utenti di tipo *Super admin*.
I permessi per chiamare il metodo possono essere revocati nelle impostazioni del ruolo utente. Consultare
[ruoli
utente](/manual/web_interface/frontend_sections/users/user_roles)
per ulteriori informazioni.
:::

[comment]: # ({/0a562b4e-06c5b0b6})

[comment]: # ({d4dbea88-7c6d41ff})
### Parametri

`(object/array)` Gruppi host da creare.

Il metodo accetta gruppi host
con le [proprietà standard dei gruppi host](object#host-group).

[comment]: # ({/d4dbea88-7c6d41ff})

[comment]: # ({e3c164f1-e3c164f1})
### Valori restituiti

`(object)` Restituisce un oggetto contenente gli ID dei gruppi di host creati
nella proprietà `groupids`. L'ordine degli ID restituiti
corrisponde all'ordine dei gruppi di host passati.

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

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

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

[comment]: # ({f82f8eea-37cc26c2})
#### Creare un gruppo di host

Crea un gruppo di host chiamato "Linux servers".

[Richiesta](/manual/api#performing-requests):

```json
{
"jsonrpc": "2.0",
"method": "hostgroup.create",
"params": {
"name": "Linux servers"
},
"id": 1
}
```

Risposta:

```json
{
"jsonrpc": "2.0",
"result": {
"groupids": [
"107819"
]
},
"id": 1
}
```

[comment]: # ({/f82f8eea-37cc26c2})

[comment]: # ({df4dc6d7-df4dc6d7})
### Sorgente

CHostGroup::create() in
*ui/include/classes/api/services/CHostGroup.php*.

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