[comment]: # translation:outdated

[comment]: # ({259f747f-259f747f})
# hostgroup.update

[comment]: # ({/259f747f-259f747f})

[comment]: # ({44386689-32bf01b5})
### Descrizione

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

Questo metodo consente di aggiornare i gruppi di host esistenti.

::: noteclassic
Questo metodo è disponibile solo per gli utenti di tipo *Admin* e *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]: # ({/44386689-32bf01b5})

[comment]: # ({46c922cb-9c20e34d})
### Parametri

`(object/array)` [Proprietà del gruppo host](object#host-group) da aggiornare.

La proprietà `groupid` deve essere definita per ciascun gruppo host, tutte le altre
proprietà sono facoltative. Verranno aggiornate solo le proprietà specificate, tutte
le altre rimarranno invariate.

[comment]: # ({/46c922cb-9c20e34d})

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

`(object)` Restituisce un oggetto contenente gli ID dei gruppi di host
aggiornati nella proprietà `groupids`.

[comment]: # ({/736f3b05-736f3b05})

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

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

[comment]: # ({f2ceab2e-a296ad88})
#### Rinominare un gruppo di host

Rinomina un gruppo di host in "Linux hosts".

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

```json
{
"jsonrpc": "2.0",
"method": "hostgroup.update",
"params": {
"groupid": "7",
"name": "Linux hosts"
},
"id": 1
}
```

Risposta:

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

[comment]: # ({/f2ceab2e-a296ad88})

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

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

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