Zabbix Documentation 3.2

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:api:reference:host:massremove

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

manual:api:reference:host:massremove [2016/02/02 15:36]
sasha undo deprecated
manual:api:reference:host:massremove [2019/10/07 06:35]
Line 1: Line 1:
-===== host.massremove ===== 
  
-==== Description ==== 
- 
-''​object host.massremove(object **parameters**)''​ 
- 
-This method allows to remove related objects from multiple hosts. 
- 
-==== 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. | 
-==== Return values ==== 
- 
-''​(object)''​ Returns an object containing the IDs of the updated hosts under the ''​hostids''​ property. 
- 
-==== Examples ==== 
- 
-=== Unlinking templates === 
- 
-Unlink a template from two hosts and delete all of the templated entities. 
- 
-Request: 
-<code js> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​method":​ "​host.massremove",​ 
-    "​params":​ { 
-        "​hostids":​ ["​69665",​ "​69666"​],​ 
-        "​templateids_clear":​ "​325"​ 
-    }, 
-    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​ 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-Response: 
-<code js> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​result":​ { 
-        "​hostids":​ [ 
-            "​69665",​ 
-            "​69666"​ 
-        ] 
-    }, 
-    "​id":​ 1 
-} 
-</​code>​ 
-==== See also ==== 
- 
-  * [[update|host.update]] 
-  * [[manual:​api:​reference:​usermacro:​object#​hosttemplate_level_macro|User macro]] 
-  * [[manual:​api:​reference:​hostinterface:​object#​host_interface|Host interface]] 
-==== Source ==== 
- 
-CHost::​massRemove() in //​frontends/​php/​include/​classes/​api/​services/​CHost.php//​.