templategroup.massremove

Description

object templategroup.massremove(object parameters)

This method allows to remove related objects from multiple template 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 User roles for more information.

Parameters

(object) Parameters containing the IDs of the template groups to update and the objects that should be removed.

ParameterTypeDescription
groupids
(required)
string/arrayIDs of the template groups to be updated.
templateidsstring/arrayTemplates to remove from all template groups.

Return values

(object) Returns an object containing the IDs of the updated template groups under the groupids property.

示例

Removing templates from template groups

Remove two templates from the given template groups.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "hostgroup.massremove",
  4. "params": {
  5. "groupids": [
  6. "5",
  7. "6"
  8. ],
  9. "hostids": [
  10. "30050",
  11. "30001"
  12. ]
  13. },
  14. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  15. "id": 1
  16. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "groupids": [
  5. "5",
  6. "6"
  7. ]
  8. },
  9. "id": 1
  10. }

Source

CTemplateGroup::massRemove() in ui/include/classes/api/services/CTemplateGroup.php.