This is a translation of the original English documentation page. Help us make it better.

host.massremove

Description

object host.massremove(object parameters)

This method allows to remove related objects from multiple hosts.

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 hosts to update and the objects that should be removed.

Parameter Type Description
hostids
(required)
string/array IDs of the hosts to be updated.
groupids string/array Host groups to remove the given hosts from.
interfaces object/array Host interfaces to remove from the given hosts.

The host interface object must have the ip, dns and port properties defined.
macros string/array User macros to delete from the given hosts.
templateids string/array Templates to unlink from the given hosts.
templateids_clear string/array Templates to unlink and clear from the given hosts.

Повернуті значення

(object) Повертає об’єкт, що містить ідентифікатори оновлених хостів у властивості hostids.

Приклади

Роз'єднання шаблонів

Від’єднайте шаблон від двох хостів і видаліть усі шаблонні сутності.

Запит:

{
           "jsonrpc": "2.0",
           "method": "host.massremove",
           "params": {
               "hostids": ["69665", "69666"],
               "templateids_clear": "325"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }
Copy
✔ Copied

Відповідь:

{
           "jsonrpc": "2.0",
           "result": {
               "hostids": [
                   "69665",
                   "69666"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Дивись також

Джерело

CHost::massRemove() в ui/include/classes/api/services/CHost.php.

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.