You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

hostgroup.massremove

Description

object hostgroup.massremove(object parameters)

This method allows to remove related objects from multiple host groups.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters containing the IDs of the host groups to update and the objects that should be removed.

Parameter Type Description
groupids ID/array IDs of the host groups to be updated.

Parameter behavior:
- required
hostids ID/array IDs of the hosts to remove from all host groups.

Return values

(object) Returns an object containing the IDs of the updated host groups under the groupids property.

Examples

Removing hosts from host groups

Remove two hosts from the given host groups.

Request:

{
           "jsonrpc": "2.0",
           "method": "hostgroup.massremove",
           "params": {
               "groupids": [
                   "5",
                   "6"
               ],
               "hostids": [
                   "30050",
                   "30001"
               ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "groupids": [
                   "5",
                   "6"
               ]
           },
           "id": 1
       }

Source

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