[comment]: # translation:outdated

[comment]: # ({9230837a-9230837a})
# hostinterface.massremove

[comment]: # ({/9230837a-9230837a})

[comment]: # ({75214f21-4559aff6})
### Descrizione

`object hostinterface.massremove(object parameters)`

Questo metodo consente di rimuovere le interfacce host dagli host specificati.

::: noteclassic
Questo metodo è disponibile solo per i tipi di utente *Admin* e *Super admin*.
Le autorizzazioni per chiamare il metodo possono essere revocate nelle impostazioni del ruolo utente.
Per ulteriori informazioni, vedere [User
roles](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/75214f21-4559aff6})

[comment]: # ({a7252dca-8970fdbb})
### Parametri

`(object)` Parametri contenenti gli ID degli host da aggiornare e
le interfacce da rimuovere.

|Parametro|[Type](/manual/api/reference_commentary#data-types)|Descrizione|
|--|--|------|
|interfaces|object/array|[Interfacce host](/manual/api/reference/hostinterface/object) da rimuovere dagli host specificati.<br><br>L'oggetto interfaccia host deve avere definite solo le proprietà `ip`, `dns` e `port`.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *obbligatorio*|
|hostids|ID/array|ID degli host da aggiornare.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *obbligatorio*|

[comment]: # ({/a7252dca-8970fdbb})

[comment]: # ({61a8b976-61a8b976})
### Valori di ritorno

`(object)` Restituisce un oggetto contenente gli ID delle interfacce host eliminate
sotto la proprietà `interfaceids`.

[comment]: # ({/61a8b976-61a8b976})

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

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

[comment]: # ({c2d2ec7c-cceffaf2})
#### Rimozione delle interfacce

Rimuovere l'interfaccia SNMP "127.0.0.1" da due host.

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

```json
{
    "jsonrpc": "2.0",
    "method": "hostinterface.massremove",
    "params": {
        "hostids": [
            "30050",
            "30052"
        ],
        "interfaces": {
            "dns": "",
            "ip": "127.0.0.1",
            "port": "161"
        }
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "interfaceids": [
            "30069",
            "30070"
        ]
    },
    "id": 1
}
```

[comment]: # ({/c2d2ec7c-cceffaf2})

[comment]: # ({a3245281-a3245281})
### Guarda anche

- [hostinterface.delete](delete)
- [host.massremove](/manual/api/reference/host/massremove)

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

[comment]: # ({6853cf7a-6853cf7a})
### Fonte

CHostInterface::massRemove() in
*ui/include/classes/api/services/CHostInterface.php*.

[comment]: # ({/6853cf7a-6853cf7a})
