This method allows to simultaneously add multiple related objects to all the given host groups.

    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 for more information.

    Parameters

    (object) Parameters containing the IDs of the host groups to update and the objects to add to all the host groups.

    Returns an object containing the IDs of the updated host groups under the groupids property.

    Examples

    Adding hosts to host groups

    Add two hosts to host groups with IDs 5 and 6.

    Request:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "6"
    5. ]
    6. },
    7. }

    Source

    CHostGroup::massAdd() in ui/include/classes/api/services/CHostGroup.php.