action.update

Description

object action.update(object/array **actions**)

This method allows to update existing actions.

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/array) Action properties to be updated.

The actionid property must be defined for each action, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard action properties, the method accepts the following parameters.

ParameterTypeDescription
filterobjectAction filter object to replace the current filter.
operationsarrayAction operations to replace existing operations.
recovery_operationsarrayAction recovery operations to replace existing recovery operations.
acknowledge_operationsarrayAction update operations to replace existing update operations.

Return values

(object) Returns an object containing the IDs of the updated actions under the actionids property.

Examples

Disable action

Disable action, that is, set its status to “1”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "action.update",
  4. "params": {
  5. "actionid": "2",
  6. "status": "1"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

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

See also

Source

CAction::update() in ui/include/classes/api/services/CAction.php.