Actions API

This page describes the Action API methods you can use to create, configure, and manage various actions that are to be triggered as a response to events. Use this API to create these types of actions:

Warning: Syntax validation of the JSON payload is done when creating the action.

Create a New Action

Creates a new action with the specified JSON payload. See Property Details.

Resource URL

POST <controller_url>/controller/alerting/rest/v1/applications/<application_id>/actions

Request/Response Format

JSON

Example

Request

This example creates an action of the type Thread Dump. See Download Examples.

{
         "actionType": "THREAD_DUMP",
         "name": "Thread Dump Action",
         "numberOfThreadDumps": 2,
         "intervalInMs": 500,
         "approvalBeforeExecution": {
             "requireApproval": true,
             "approverEmail": "email@website.com"
         }
}
Response

This example returns the created action object.

{
		 "id": "3",
         "actionType": "THREAD_DUMP",
         "name": "Thread Dump Action",
         "numberOfThreadDumps": 2,
         "intervalInMs": 500,
         "approvalBeforeExecution": {
             "requireApproval": true,
             "approverEmail": "email@website.com"
         }
}

Retrieve a List of Actions for a Given Application

Returns the action ID, name, and description of the action pertaining to a specified application ID. See Property Details.

Resource URL

GET <controller_url>/controller/alerting/rest/v1/applications/<application_id>/actions

Response Format

JSON

Example Response

This example returns a list of actions pertaining to a given application ID.

[{"id":1,"name":"Thread Dump Action","actionType":"THREAD_DUMP"}]

Retrieve Details of a Specified Action

Retrieves the details of action with a specified ID. See Property Details.

Note: Ensure that you provide a valid action ID.

Resource URL

GET <controller_url>/controller/alerting/rest/v1/applications/<application_id>/actions/{action-id}

Response Format

JSON

Example Response

This example retrieves the details of an action. See Download Examples.

{
 "id": 1,
 "actionType": "THREAD_DUMP",
 "name": "Thread Dump Action",
 "numberOfThreadDumps": 2,
 "intervalInMs": 500,
 "approvalBeforeExecution": {
 "requireApproval": true,
 "approverEmail": "email@website.com"
 }
}

Update an Action

Updates an existing action with a specified JSON payload. See Property Details.

Tip: This request requires a complete JSON payload as input. Hence, it is recommended that you retrieve the JSON payload using, GET /action/{action-id} and update the required fields. Then, send the modified payload as part of a PUT request.

Resource URL

PUT <controller_url>/controller/alerting/rest/v1/applications/<application_id>/action/{action-id}

Request/Response Format

JSON

Example

This example updates an action. See Download Examples.

Request
{
         "actionType": "THREAD_DUMP",
         "name": "Thread Dump Action",
         "numberOfThreadDumps": 2,
         "intervalInMs": 500,
         "approvalBeforeExecution": {
             "requireApproval": true,
             "approverEmail": "email@website.com"
         }
}
Response

This example returns the updated action.

{
		 "id": "3",
         "actionType": "THREAD_DUMP",
         "name": "Thread Dump Action",
         "numberOfThreadDumps": 2,
         "intervalInMs": 500,
         "approvalBeforeExecution": {
             "requireApproval": true,
             "approverEmail": "email@website.com"
         }
}

Delete an Action

Deletes an action with the specified ID. See Property Details.

Note: Ensure that you provide a valid action ID.

Resource URL

DELETE <controller_url>/controller/alerting/rest/v1/applications/<application_id>/action/{action-id}

Response Codes

Code Description
200Fetched successfully
201Created successfully
204Deleted successfully
400Bad request
401Unauthorized
403Forbidden
404Resource not found
409Already exists

Property Details

Action

Payload details for an action triggered as a response to an event.

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType

string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

SmsAction

An SMS notification is triggered as a response to an event.

Warning:

Note

Ensure that you have configured the email and SMS settings for Splunk AppDynamics. See Enable an Email Server.

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

phoneNumber*

string

pattern:

^\d{10,}$

EmailAction

An email notification is triggered as a response to an event.

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

emails*

string

pattern

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

CustomEmailAction

An email notification based on a predefined template is triggered as a response to an event.

Note: The template must already exist before you can use it in an action. See

Email Templates

.
Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

name* stringminLength: 1 ActionName

The name you assign to the action.

emailTemplateName* stringminLength: 1

The name of the template to be used for email notification.

to*

stringpattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

EmailArray

A list of email IDs.

cc*

stringpattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

EmailArray

A list of email IDs.

bcc*

stringpattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

EmailArray

A list of email IDs.

customTemplateVariables

string KeyValuePair
Property Name Type
key* string
value* string

ThreadDumpAction

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

name* stringminLength: 1 ActionName

The name you assign to the action.

numberOfThreadDumps* integerminimum: 1 maximum: 50The number of thread dump samples you want the 'action' to collect.
intervalInMs* integerminimum: 500The time interval in milliseconds between the thread dump samples collected.
approvalBeforeExecution* ApprovalBeforeExecution

Mandate an approval before the thread dump action is started.

Property NameType
requireApproval boolean
approverEmail

string

pattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

HttpRequestAction

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

name* stringminLength: 1 ActionName

The name you assign to the action.

httpRequestTemplateName

string

minLength: 1

An existing HTTP request template to be used in an HTTP request action.
customTemplateVariables KeyValuePair
Property NameType
key* string
value* string

ScriptAction

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

name* stringminLength: 1 ActionName

The name you assign to the action.

scriptPath* stringminLength: 1

The relative path of the script.

Note: Enter the part after ${machine.agent.directory}/local-scripts/
logFilesPath The absolute path of the log file(s).
scriptTimeout*

string

integerminimum: 1 maximum: 1440

approvalBeforeExecution*

Mandate approval before the script action is started.

Property NameType
requireApproval boolean
approverEmail

string

pattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

DiagnosticAction

Property Name Type Description and Valid Values
name* stringminLength: 1 ActionName

The name you assign to the action.

businessTransactions* string

Runs the diagnostic session on the specified Business Transactions.

Enums

ALL_AFFECTED_BUSINESS_TRANSACTIONS

SPECIFIC_BUSINESS_TRANSACTIONS

duration* integerminimum: 1 maximum: 10The duration in minutes to run the diagnostic session.
snapshotRate* integerminimum: 1 maximum: 10The rate at which diagnostic snapshots are captured.
actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

JiraAction

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

name* stringminLength: 1 ActionName

The name you assign to the action.

jiraActionDetails* string jiraActionType

The JIRA action type triggered as a response to an event.

Enums

CREATE_JIRA

UPDATE_JIRA

JiraActionDetails

The JIRA action type triggered as a response to an event.

Property Name Type Description and Valid Values
jiraActionType string Enums

CREATE_JIRA

UPDATE_JIRA

JiraCreateAction

The Jira action type create JIRA is triggered as a response to an event.

Property Name Type Description and Valid Values
jiraActionType* string Enums

CREATE_JIRA

UPDATE_JIRA

assignee*

string

minLength: 1

project*

string

minLength: 1

priority*

string

minLength: 1

issueType*

string

minLength: 1

JiraUpdateAction

The Jira action type update JIRA is triggered as a response to an event.

Property Name Type Description and Valid Values
jiraActionType* string Enums

CREATE_JIRA

UPDATE_JIRA

changePriorityTo*

string

minLength: 1

ActionName

The name you assign to the action.

Property Name Type Description and Valid Values

ActionName

string

minLength: 1

ApprovalBeforeExecution

Mandate email approval before the action execution is initiated.

Property NameType
requireApproval boolean
approverEmail

string

pattern:

^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

BusinessTransactions

Run the diagnostic session on the specified Business Transactions.

Property Name Type Description and Valid Values
businessTransactionScope string Enums

ALL_AFFECTED_BUSINESS_TRANSACTIONS

SPECIFIC_BUSINESS_TRANSACTIONS

AllAffectedBusinessTransactions

Run the diagnostic session on all Business Transactions.

Property Name Type Description and Valid Values
businessTransactionScope string Enums

ALL_AFFECTED_BUSINESS_TRANSACTIONS

SPECIFIC_BUSINESS_TRANSACTIONS

SpecificBusinessTransactions

Run the diagnostic session on the Business Transactions that match the specified criteria.

Property Name Type Description and Valid Values
businessTransactionScope string Enums

ALL_AFFECTED_BUSINESS_TRANSACTIONS

SPECIFIC_BUSINESS_TRANSACTIONS

businessTransactionNames*

string

minItems: 1

EmailArray

Property Name Type
EmailArray

string

pattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

KeyValuePair

Property Name Type
key* string
value* string

Email

Property Name Type
Email

string

pattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$

ActionSummaryArray

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

name* stringminLength: 1 Enums

The name you assign to the action.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

ActionSummary

Property Name Type Description and Valid Values
id integer

This is auto-generated by the system and returned in the response.

It is a readOnly value.

name* stringminLength: 1 ActionName

The name you assign to the action.

actionType* string

The type of action triggered as a response to an event.

Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

StringIntegerPair

Property Name Type
id integer
name* stringminLength: 1

JiraActionTypeEnum

Property Name Type Description and Valid Values
jiraActionTypeEnum string

CREATE_JIRA

UPDATE_JIRA

BusinessTransactionScopeEnum

Property Name Type Description and Valid Values

BusinessTransactionScopeEnum

string

ALL_AFFECTED_BUSINESS_TRANSACTIONS

SPECIFIC_BUSINESS_TRANSACTIONS

ActionTypeEnum

Property Name Type Description and Valid Values
ActionTypeEnum string Enums

SMS

EMAIL

CUSTOM_EMAIL

THREAD_DUMP

HTTP_REQUEST

RUN_SCRIPT_ON_NODES

DIAGNOSE_BUSINESS_TRANSACTIONS

CREATE_UPDATE_JIRA

ErrorResponse

Property Name Type
statusCode integer
message string

*This property is required.

* This property is required.

Download Examples

Download actions_api.zip for a set of examples that help you configure an action.