Creating Take Action definitions

This example describes how to use the PUT /system/actions endpoint to create new Take Action definitions.

When using this endpoint, you must provide the following information in the request body:
  • The Take Action FULLNAME. Specify a unique name to create a new Take Action definition.
  • The system command (the CMD parameter).
  • The affinity ID of the managed system on which to run the command (the ID parameter).

You can also specify an optional description for the Take Action definition.

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

Creating one Take Action definition per request

When using the PUT /system/actions endpoint to create a single Take Action definition, include in the request body the FULLNAME, ID, and CMD properties.

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

Creating multiple Take Action definitions in a request

When using the PUT /system/actions endpoint to create multiple Take Action definitions in a single request, include in the request body the FULLNAME, ID, and CMD properties for each Take Action definition to create.

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

Request body for creating Take Action definitions

The following example shows the format of the request body and includes all properties that can be specified.
{
  "FULLNAME": "string",
  "ID": "string",
  "CMD": "string",
  "DESC": "string"
}

Always include in the request body the FULLNAME, ID, and CMD properties.

The following table describes the supported properties.

Table 1. Request body properties for creating Take Action definitions
Property Description
ID The affinity ID of the managed system where the Take Action can be executed.
Note: This parameter is required.
FULLNAME The unique name of the Take Action that you define when creating a Take Action definition.

Valid values: character string, max length 31 characters.

Note: This parameter is required.
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.
Note: This parameter is required.
DESC An optional description of the Take Action definition.

When the request is successfully completed, the response body will display an information message with the generated NAME value.