Editing Take Action definitions

This example describes how to use the PATCH /system/actions endpoint to edit existing Take Action definitions.

When using this endpoint, you must provide a request body that specifies the following information for the Take Action to update:

  • The name of the Take Action to edit (the NAME parameter).
  • The date when the Take Action definition was last modified (the LSTDATE parameter). Specify this information as a timestamp value. Because this value is updated each time the Take Action definition is edited, you must update the value with each PATCH /system/actions request.
    Note: This timestamp value is used as a locking mechanism to prevent multiple requests from updating the Take Action definition at the same time. For information about the format of the timestamp, see Using time values for requests.
    Tip: You can obtain this value by using the GET /system/actions endpoint; the lstdate parameter is returned as part of the response.
  • The Take Action information to modify. The properties that can be updated are described in Request body for editing Take Action definitions.

The format of the request slightly differs depending on if you are editing a single Take Action definition or multiple Take Action definitions in your request, as described in the following sections.

Editing one Take Action definition per request

When using the PATCH /system/actions endpoint to edit a single Take Action definition, include in the request body the NAME property, the LSTDATE property, and the Take Action information to modify.

The format of the path is as follows:
https://host:port/api/v1/system/actions
For example:
{
     "NAME" : "TakeAction_1", 
     "CMD": "NT:AMS_Start_Manage &KCA_Agent_Availability_Management_Status.PAS_Agent_Name", 
     "LSTDATE" : "1230524072538000"
}

The properties that can be updated are described in Request body for editing Take Action definitions.

Editing multiple Take Action definitions in a request

When using the PATCH /system/actions endpoint to edit multiple Take Action definitions in a single request, you must use the NAME and LSTDATE properties for each Take Action definition to update.

The format of the path is as follows:
https://host:port/api/v1/system/actions
In the request body, specify the information to modify for each Take Action definition as a separate object. For example:
[
  {
     "NAME" : "TakeAction_1", 
     "CMD": "NT:AMS_Start_Manage &KCA_Agent_Availability_Management_Status.PAS_Agent_Name", 
     "LSTDATE" : "1230524072538000"
  }, 
  { 
     "NAME" : "TakeAction_2", 
     "CMD": "NT:AMS_Start_Manage &KCA_Agent_Availability_Management_Status.PAS_Agent_Name", 
     "LSTDATE" : "1230524072538000" 
  }
]

The properties that can be updated are described in Request body for editing Take Action definitions.

Request body for editing Take Action definitions

The following example shows the format of the request body for Take Action editing requests and includes all supported properties:
{
  "NAME": "string",
  "LSTDATE": "string",
  "DESC": "string",
  "CMD": "string",
  "FULLNAME": "string"
}

Always include in the request body the NAME and the LSTDATE properties. For the remainder of the properties, include only those properties that you want to update for the respective Take Action definition.

The following table describes the supported properties.

Table 1. Request body properties for editing Take Action definitions
Property Description
NAME The generated name of the Take Action definition.

The NAME value is automatically generated when the Take Action definition is created; this value is provided in the PUT /system/actions response body.

Note: This parameter is required.
Tip: Use the GET /system/actions endpoint to retrieve NAME value for the Take Action definition that you want to update.
LSTDATE The timestamp when the Take Action definition was last modified.

Because this value is updated each time the Take Action definition is edited, you must update the value with each PATCH /system/actions request.

Note: This parameter is required.
FULLNAME The name of the Take Action definition that you define when creating a Take Action definition.

Valid values: character string, max length 31 characters.

CMD The system command to run by the corresponding Take Action.

Valid values: character string, max length 512 characters

To run a system command, use the following format:
"CMD": "system_command"
where system_command is the command to issue at the system.
DESC An optional description of a Take Action definition.