

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# AWS DevOps Agent 事件詳細資訊參考
<a name="integrating-devops-agent-into-event-driven-applications-using-amazon-eventbridge-devops-agent-events-detail-reference"></a>

來自 AWS 服務的事件具有常見的中繼資料欄位，包括 `source`、`detail-type`、`region`、 `account`和 `time`。這些事件也包含具有服務特定資料`detail`的欄位。For AWS DevOps 代理程式事件， 一律`source`為 `aws.aidevops`，而 會`detail-type`識別特定事件。

## 調查事件
<a name="investigation-events"></a>

下列`detail-type`值可識別調查事件：
+ `Investigation Created`
+ `Investigation Priority Updated`
+ `Investigation In Progress`
+ `Investigation Completed`
+ `Investigation Failed`
+ `Investigation Timed Out`
+ `Investigation Cancelled`
+ `Investigation Pending Triage`
+ `Investigation Linked`
+ `Investigation Skipped`

以下包含 `source`和 `detail-type` 欄位，因為其中包含 AWS DevOps 代理程式事件的特定值。如需所有事件中包含的其他中繼資料欄位的定義，請參閱《*Amazon EventBridge 事件參考*》中的[事件結構](https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html)。

以下是調查事件的 JSON 結構。

```
{
  . . .,
  "detail-type" : "string",
  "source" : "aws.aidevops",
  . . .,
  "detail" : {
    "version" : "string",
    "metadata" : {
      "agent_space_id" : "string",
      "task_id" : "string",
      "execution_id" : "string"
    },
    "data" : {
      "task_type" : "string",
      "priority" : "string",
      "status" : "string",
      "created_at" : "string",
      "updated_at" : "string",
      "summary_record_id" : "string"
    }
  }
}
```

**`detail-type`** 識別事件的類型。對於調查事件，這是先前列出的其中一個事件名稱。

**`source`** 識別產生事件的服務。對於 AWS DevOps 代理程式事件，此值為 `aws.aidevops`。

**`detail`** 包含事件特定資料的 JSON 物件。`detail` 物件包含下列欄位：
+ `version` （字串） – 事件詳細資訊的結構描述版本。目前為 `1.0.0`。
+ `metadata.agent_space_id` （字串） – 事件來源的代理程式空間的唯一識別符。
+ `metadata.task_id` （字串） – 任務的唯一識別符。
+ `metadata.execution_id` （字串） – 執行執行的唯一識別符。將執行指派給調查時出現。
+ `data.task_type` （字串） – 任務的類型。值：`INVESTIGATION`。
+ `data.priority` （字串） – 優先順序層級。值：`CRITICAL`、`HIGH`、`MEDIUM`、`LOW`、`MINIMAL`。
+ `data.status` （字串） – 目前狀態。值：`PENDING_START`、`IN_PROGRESS`、`COMPLETED`、`FAILED`、`TIMED_OUT`、`CANCELLED`、`PENDING_TRIAGE`、`LINKED`、`SKIPPED`。
+ `data.created_at` （字串） – 建立任務時的 ISO 8601 時間戳記。
+ `data.updated_at` （字串） – 任務上次更新時的 ISO 8601 時間戳記。
+ `data.summary_record_id` （字串） – 包含調查結果之摘要記錄的識別符。在針對已完成的調查產生摘要時包含。您可以使用此識別符查詢記錄類型為 的日誌記錄，透過 AWS DevOps 代理程式 API 擷取摘要內容`investigation_summary_md`。

**範例：調查已完成事件**

```
{
  "version": "0",
  "id": "12345678-1234-1234-1234-123456789015",
  "detail-type": "Investigation Completed",
  "source": "aws.aidevops",
  "account": "123456789012",
  "time": "2026-03-12T18:10:00Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aidevops:us-east-1:123456789012:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c"
  ],
  "detail": {
    "version": "1.0.0",
    "metadata": {
      "agent_space_id": "8f6187a7-0388-4926-8217-3a0fe32f757c",
      "task_id": "a1b2c3d4-5678-90ab-cdef-example11111",
      "execution_id": "b2c3d4e5-6789-01ab-cdef-example22222"
    },
    "data": {
      "task_type": "INVESTIGATION",
      "priority": "CRITICAL",
      "status": "COMPLETED",
      "created_at": "2026-03-12T18:00:00Z",
      "updated_at": "2026-03-12T18:10:00Z",
      "summary_record_id": "d4e5f6g7-6789-01ab-cdef-example44444"
    }
  }
}
```

**範例：調查失敗事件**

```
{
  "version": "0",
  "id": "12345678-1234-1234-1234-123456789016",
  "detail-type": "Investigation Failed",
  "source": "aws.aidevops",
  "account": "123456789012",
  "time": "2026-03-12T18:10:00Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aidevops:us-east-1:123456789012:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c"
  ],
  "detail": {
    "version": "1.0.0",
    "metadata": {
      "agent_space_id": "8f6187a7-0388-4926-8217-3a0fe32f757c",
      "task_id": "a1b2c3d4-5678-90ab-cdef-example11111",
      "execution_id": "b2c3d4e5-6789-01ab-cdef-example22222"
    },
    "data": {
      "task_type": "INVESTIGATION",
      "priority": "CRITICAL",
      "status": "FAILED",
      "created_at": "2026-03-12T18:00:00Z",
      "updated_at": "2026-03-12T18:10:00Z"
    }
  }
}
```

## 緩解事件
<a name="mitigation-events"></a>

下列`detail-type`值可識別緩解事件：
+ `Mitigation In Progress`
+ `Mitigation Completed`
+ `Mitigation Failed`
+ `Mitigation Timed Out`
+ `Mitigation Cancelled`

以下包含 `source`和 `detail-type` 欄位，因為其中包含 AWS DevOps 代理程式事件的特定值。如需所有事件中包含的其他中繼資料欄位的定義，請參閱《*Amazon EventBridge 事件參考*》中的[事件結構](https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html)。

以下是緩解事件的 JSON 結構。

```
{
  . . .,
  "detail-type" : "string",
  "source" : "aws.aidevops",
  . . .,
  "detail" : {
    "version" : "string",
    "metadata" : {
      "agent_space_id" : "string",
      "task_id" : "string",
      "execution_id" : "string"
    },
    "data" : {
      "task_type" : "string",
      "priority" : "string",
      "status" : "string",
      "created_at" : "string",
      "updated_at" : "string",
      "summary_record_id" : "string"
    }
  }
}
```

**`detail-type`** 識別事件的類型。對於緩解事件，這是先前列出的其中一個事件名稱。

**`source`** 識別產生事件的服務。對於 AWS DevOps 代理程式事件，此值為 `aws.aidevops`。

**`detail`** 包含事件特定資料的 JSON 物件。`detail` 物件包含下列欄位：
+ `version` （字串） – 事件詳細資訊的結構描述版本。目前為 `1.0.0`。
+ `metadata.agent_space_id` （字串） – 事件來源的代理程式空間的唯一識別符。
+ `metadata.task_id` （字串） – 任務的唯一識別符。
+ `metadata.execution_id` （字串） – 執行執行的唯一識別符。當執行已指派給緩解措施時出現。
+ `data.task_type` （字串） – 任務的類型。值：`INVESTIGATION`。
+ `data.priority` （字串） – 優先順序層級。值：`CRITICAL`、`HIGH`、`MEDIUM`、`LOW`、`MINIMAL`。
+ `data.status` （字串） – 目前狀態。值：`IN_PROGRESS`、`COMPLETED`、`FAILED`、`TIMED_OUT`、`CANCELLED`。
+ `data.created_at` （字串） – 建立任務時的 ISO 8601 時間戳記。
+ `data.updated_at` （字串） – 任務上次更新時的 ISO 8601 時間戳記。
+ `data.summary_record_id` （字串） – 包含緩解問題清單之摘要記錄的識別符。在針對已完成的緩解產生摘要時包含。您可以使用此識別符查詢記錄類型為 的日誌記錄，透過 AWS DevOps 代理程式 API 擷取摘要內容`mitigation_summary_md`。

**範例：緩解已完成事件**

```
{
  "version": "0",
  "id": "12345678-1234-1234-1234-12345678901c",
  "detail-type": "Mitigation Completed",
  "source": "aws.aidevops",
  "account": "123456789012",
  "time": "2026-03-12T18:20:00Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aidevops:us-east-1:123456789012:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c"
  ],
  "detail": {
    "version": "1.0.0",
    "metadata": {
      "agent_space_id": "8f6187a7-0388-4926-8217-3a0fe32f757c",
      "task_id": "a1b2c3d4-5678-90ab-cdef-example11111",
      "execution_id": "c3d4e5f6-7890-12ab-cdef-example33333"
    },
    "data": {
      "task_type": "INVESTIGATION",
      "priority": "CRITICAL",
      "status": "COMPLETED",
      "created_at": "2026-03-12T18:00:00Z",
      "updated_at": "2026-03-12T18:20:00Z",
      "summary_record_id": "e5f6g7h8-7890-12ab-cdef-example55555"
    }
  }
}
```

**範例：緩解失敗事件**

```
{
  "version": "0",
  "id": "12345678-1234-1234-1234-12345678901d",
  "detail-type": "Mitigation Failed",
  "source": "aws.aidevops",
  "account": "123456789012",
  "time": "2026-03-12T18:20:00Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:aidevops:us-east-1:123456789012:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c"
  ],
  "detail": {
    "version": "1.0.0",
    "metadata": {
      "agent_space_id": "8f6187a7-0388-4926-8217-3a0fe32f757c",
      "task_id": "a1b2c3d4-5678-90ab-cdef-example11111",
      "execution_id": "c3d4e5f6-7890-12ab-cdef-example33333"
    },
    "data": {
      "task_type": "INVESTIGATION",
      "priority": "CRITICAL",
      "status": "FAILED",
      "created_at": "2026-03-12T18:00:00Z",
      "updated_at": "2026-03-12T18:20:00Z"
    }
  }
}
```