アクション API

このページでは、イベントへの応答としてトリガーされるさまざまなアクションを作成、設定、および管理するために使用できる、アクション API メソッドについて説明します。この API を使用して、次のタイプのアクションを作成します。

警告: JSON ペイロードの構文検証は、アクションの作成時に実行されます。

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.

JSON
{
    "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.

JSON
{
    "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.

JSON
[{"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.

注: 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.

JSON
{
    "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.

ヒント: 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
JSON
{
    "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.

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

アクションの削除

指定された ID を持つアクションを削除します。「プロパティの詳細」を参照してください。

注: 有効なアクション ID が指定されていることを確認してください。

リソースURL

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

応答コード

コード 説明
200 正常に取得されました
201 正常に作成されました
204 正常に削除されました
400 Bad request
401 Unauthorized
403 Forbidden
404 リソースが見つかりません
409 すでに存在します

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.

警告:

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.

注: 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: 50 The number of thread dump samples you want the 'action' to collect.
intervalInMs* integerminimum: 500 The time interval in milliseconds between the thread dump samples collected.
approvalBeforeExecution* ApprovalBeforeExecution

Mandate an approval before the thread dump action is started.

Property Name Type
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 Name Type
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.

注: 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 Name Type
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: 10 The duration in minutes to run the diagnostic session.
snapshotRate* integerminimum: 1 maximum: 10 The 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 Name Type
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.

例のダウンロード

アクションを設定するのに役立つ一連の例 actions_api.zip をダウンロードします。

SWAGGER YAML ファイルのダウンロード

Swagger の actions_openapi.yml をダウンロードします。