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