アクション API

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

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

新しいアクションの作成

指定された JSON ペイロードを使用して新しいアクションを作成します。「プロパティの詳細」を参照してください。

リソースURL

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

要求/応答の形式

JSON

リクエスト

この例では、タイプ「スレッドダンプ」のアクションを作成します。例のダウンロード」を参照してください。

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

この例では、作成されたアクションオブジェクトを返します。

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

特定のアプリケーションに対するアクションリストの取得

指定されたアプリケーション ID に関連するアクションのアクション ID、名前、および説明を返します。「プロパティの詳細」を参照してください。

リソースURL

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

応答形式

JSON

応答の例

この例では、特定のアプリケーション ID に関連するアクションリストを返します。

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

指定されたアクションの詳細の取得

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

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

リソースURL

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

応答形式

JSON

応答の例

この例では、アクションの詳細を取得します。「例のダウンロード」を参照してください。

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

アクションの更新

指定された JSON ペイロードを使用して既存のアクションを更新します。「プロパティの詳細」を参照してください。

ヒント: この要求には、入力として完全な JSON ペイロードが必要です。そのため、 GET /action/(action-id) を使用して JSON ペイロードを取得し、必須フィールドを更新することをお勧めします。その後、変更したペイロードを 要求の一部として送信します。

リソースURL

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

要求/応答の形式

JSON

この例では、アクションを更新します。「例のダウンロード」を参照してください。

リクエスト
JSON
{
         "actionType": "THREAD_DUMP",
         "name": "Thread Dump Action",
         "numberOfThreadDumps": 2,
         "intervalInMs": 500,
         "approvalBeforeExecution": {
             "requireApproval": true,
             "approverEmail": "email@website.com"
         }
}
レスポンス

この例では、更新されたアクションを返します。

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 をダウンロードします。