hostinterface.massremove

Description

object hostinterface.massremove(object **parameters**)

This method allows to remove host interfaces from the given hosts.

Parameters

(object) Parameters containing the IDs of the hosts to be updated and the interfaces to be removed.

ParameterTypeDescription
hostids
(required)
string/arrayIDs of the hosts to be updated.
interfaces
(required)
object/arrayHost interfaces to remove from the given hosts.

The host interface object must have the ip, dns and port properties defined

Return values

(object) Returns an object containing the IDs of the deleted host interfaces under the interfaceids property.

Examples

Removing interfaces

Remove the “127.0.0.1” SNMP interface from two hosts.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "hostinterface.massremove",
  4. "params": {
  5. "hostids": [
  6. "30050",
  7. "30052"
  8. ],
  9. "interfaces": {
  10. "dns": "",
  11. "ip": "127.0.0.1",
  12. "port": "161"
  13. }
  14. },
  15. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  16. "id": 1
  17. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "interfaceids": [
  5. "30069",
  6. "30070"
  7. ]
  8. },
  9. "id": 1
  10. }

See also

Source

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