object host.massadd(object parameters)
This method allows to simultaneously add multiple related objects to all the given hosts.
(object) Parameters containing the IDs of the hosts to update and the objects to add to all the hosts.
The method accepts the following parameters.
|object/array||Hosts to be updated.
The hosts must have the
|groups||object/array||Host groups to add to the given hosts.
The host groups must have the
|interfaces||object/array||Host interfaces to be created for the given hosts.|
|macros||object/array||User macros to be created for the given hosts.|
|templates||object/array||Templates to link to the given hosts.
The templates must have the
(object) Returns an object containing the IDs of the updated hosts under the
Add two new macros to two hosts.
CHost::massAdd() in frontends/php/api/classes/CHost.php.