System events for automated tasks in OOS

更新时间:
复制 MD 格式

Background

Event notifications inform you of resource changes. By configuring middleware to process these events, you can automate O&M workflows without polling for status changes through an SDK.CloudOps Orchestration Service (OOS) supports event notifications for template execution status and task execution status. For more information, seeView system events and Manage alert rules for system events (old version).

Template execution status notifications

CloudOps Orchestration Service sends a notification when the status of a template execution changes:

  1. OOS sends an event notification only when the execution status changes to Started, Success, or Failed.

  2. OOS does not send event notifications for a child execution created by a cloud service action.

Notification format

{
	"ver": "1.0",
	"id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
	"product": "OOS",
	"resourceId": "acs:ecs:cn-hangzhou:169070********30:execution/exec-abc1792gcdoonr9an2uk",
	"level": "INFO",
	"name": "Execution:ExecutionStatusChange",
	"userId": "169070********30",
	"eventTime": "20190409T121826.922+0800",
	"regionId": "cn-hangzhou",
	"content": {
    		"executionId" : "exec-abc1792gcdoonr9an2uk",
    		"status" : "Success",
    		"templateId" : "t-89fb84c218e84fd58e14",
    	 	"templateVersion" : "v8",
    		"templateName" : "templateName",
    		"executedBy" : "admin(1234567)",
    		"startTime" : "2019-11-11T12:00Z",
    		"endTime" : "2019-11-11T13:00Z",
    		"duration" : 3600,
    		"parentExecutionId" : "exec-3816c2a99c9146979da6"
	}
}

Event attributes

The following table describes the top-level fields of an event notification:

Field

Description

Example value

id

The unique event ID.

9435EAD6-3CF6-4494-8F7A-3A********77

eventTime

The time the event occurred, in UTC+8.

20181226T220114.058+0800

level

The event level.

INFO

name

The event name.

Execution:StatusChange

product

The name of the service. The only valid value is OOS.

OOS

regionId

The Alibaba Cloud region ID. For a list of valid values, see DescribeRegions.

cn-hangzhou

resourceId

The Alibaba Cloud Resource Name (ARN) of the resource.

acs:ecs:cn-hangzhou:1169070********30:execution/exec-abc1792gcdoonr9an2uk

userId

The Alibaba Cloud account ID.

169070********30

content

The event details.

N/A

The following table describes the content field:

Field

Description

Example value

executionId

The template execution ID.

exec-abc1792gcdoonr9an2uk

status

The execution status.

Success

templateId

The template ID.

t-89fb84c218e84fd58e14

templateVersion

The template version.

v8

templateName

The template name.

templateName

executedBy

The user or service that initiated the execution.

admin(1234567)

startTime

The execution start time.

2019-11-11T11:00:00Z

endTime

The execution end time.

2019-11-11T11:00:02Z

duration

The execution duration, in seconds.

parentExecutionId

The parent execution ID.

exec-3816c2a99c9146979da6

Task execution status notifications

CloudOps Orchestration Service sends a notification when the execution status of a template task changes:

  1. OOS sends an event notification only when the task execution status changes to Started, Success, or Failed.

  2. OOS does not send event notifications for tasks created by a cloud service action.

Notification format

{
	"ver": "1.0",
	"id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
	"product": "OOS",
	"resourceId": "acs:ecs:cn-hangzhou:169070********30:taskexecution/task-exec-abc1792gcdoonr9an2uk",
	"level": "INFO",
	"name": "TaskExecution:StatusChange",
	"userId": "169070********30",
	"eventTime": "20190409T121826.922+0800",
	"regionId": "cn-hangzhou",
	"content": {
    		"taskExecutionId" : "task-exec-abc",
    		"taskAction" : "ACS::ExecuteApi",
    		"taskName" : "taskName",
    		"executionId" : "exec-18864d6b80a448dcbe62",
    		"status" : "Success",
    		"templateId" : "t-89fb84c218e84fd58e14",
    		"templateVersion" : "v8",
    		"templateName" : "templateName",
    		"startTime" : "2019-11-11T12:00Z",
    		"endTime" : "2019-11-11T12:01Z",
    		"duration" : 60
	}
}

Event attributes

The following table describes the top-level fields of an event notification:

Field

Description

Example value

id

The unique event ID.

9435EAD6-3CF6-4494-8F7A-3A********77

eventTime

The time the event occurred, in UTC+8.

20181226T220114.058+0800

level

The event level.

INFO

name

The event name.

TaskExecution:StatusChange

product

The name of the service. The only valid value is OOS.

OOS

regionId

The Alibaba Cloud region ID. For a list of valid values, see DescribeRegions.

cn-hangzhou

resourceId

The Alibaba Cloud Resource Name (ARN) of the resource.

acs:ecs:cn-hangzhou:169070********30:taskexecution/task-exec-abc1792gcdoonr9an2uk

userId

The Alibaba Cloud account ID.

169070********30

content

The event details.

N/A

The following table describes the content field:

Field

Description

Example value

taskExecutionId

The task execution ID.

task-exec-abc1792gcdoonr9an2uk

status

The task execution status.

Success

taskAction

The task action.

ACS::ExecuteApi

taskName

The task name.

taskName

executionId

The parent execution ID.

exec-18864d6b80a448dcbe62

templateId

The template ID.

t-89fb84c218e84fd58e14

templateVersion

The template version.

v8

templateName

The template name.

templateName

executedBy

The user or service that initiated the execution.

admin(1234567)

startTime

The task execution start time.

2019-11-11T11:00:00Z

endTime

The task execution end time.

2019-11-11T11:01:00Z

duration

The task execution duration, in seconds.

60