manual:api:reference:host:massadd

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
manual:api:reference:host:massadd [2016/01/22 13:02]
sasha fixed link
manual:api:reference:host:massadd [2020/05/05 11:40]
martins-v frontends/php -> ui (ZBX-17667)
Line 7: Line 7:
 This method allows to simultaneously add multiple related objects to all the given hosts. This method allows to simultaneously add multiple related objects to all the given hosts.
  
-<note warning>​This method is deprecated and will be removed in the future. Please use [[update|host.update]] instead.</​note>​ 
 ==== Parameters ==== ==== Parameters ====
  
Line 17: Line 16:
 | **hosts** \\ (required) | object/​array | Hosts to be updated. \\ \\ The hosts must have the ''​hostid''​ property defined. | | **hosts** \\ (required) | object/​array | Hosts to be updated. \\ \\ The hosts must have the ''​hostid''​ property defined. |
 | groups | object/​array | Host groups to add to the given hosts. \\ \\ The host groups must have the ''​groupid''​ property defined. ​ | | groups | object/​array | Host groups to add to the given hosts. \\ \\ The host groups must have the ''​groupid''​ property defined. ​ |
-| interfaces | object/​array | Host interfaces to be created for the given hosts. | +| interfaces | object/​array ​| [[:​manual/​api/​reference/​hostinterface/​object|Host interfaces]] to be created for the given hosts. | 
-| macros | object/​array | User macros to be created for the given hosts. |+| macros | object/​array ​| [[:​manual/​api/​reference/​usermacro/​object|User macros]] to be created for the given hosts. |
 | templates | object/​array | Templates to link to the given hosts. \\ \\ The templates must have the ''​templateid''​ property defined. | | templates | object/​array | Templates to link to the given hosts. \\ \\ The templates must have the ''​templateid''​ property defined. |
 ==== Return values ==== ==== Return values ====
Line 31: Line 30:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 51: Line 50:
             {             {
                 "​macro":​ "​{$TEST2}",​                 "​macro":​ "​{$TEST2}",​
-                "​value":​ "​MACROTEST2"​+                "​value":​ "​MACROTEST2", 
 +                "​description":​ "Test description"
             }             }
         ]         ]
Line 61: Line 61:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 83: Line 83:
 ==== Source ==== ==== Source ====
  
-CHost::​massAdd() in //frontends/​php/​include/​classes/​api/​services/​CHost.php//​.+CHost::​massAdd() in //ui/​include/​classes/​api/​services/​CHost.php//​.