

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon EventBridge による Amazon Translate イベントのモニタリング
<a name="monitoring-with-eventbridge"></a>

Amazon Translate は Amazon EventBridge と統合されており、翻訳ジョブや並列データリソースに影響する変更に関する通知が行われます。 AWS サービスからのイベントは、ほぼリアルタイムで EventBridge に配信されます。簡単なルールを記述して、注目するイベントと、イベントがルールに一致した場合に自動的に実行するアクションを指定できます。たとえば、自動的に開始できるアクションには以下のようなものがあります。
+  AWS Lambda 関数の呼び出し
+  AWS Systems Manager Run Command の呼び出し
+ Amazon Kinesis Data Streams へのイベントの中継
+  AWS Step Functions ステートマシンのアクティブ化
+ Amazon SNS トピックまたは Amazon SQS キューの通知

EventBridge ルールの作成の詳細については、*Amazon EventBridge ユーザーガイド*の「[イベントに反応する Amazon EventBridge ルールの作成](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule.html)」を参照してください 。

## Amazon Translate イベント
<a name="monitoring-with-eventbridge-events"></a>

以下に、Amazon Translate のイベントの例を示します。

### バッチ翻訳ジョブのイベント
<a name="monitoring-with-eventbridge-events"></a>

バッチ翻訳ジョブを実行するには、Amazon Translate コンソールまたは [StartTextTranslationJob](https://docs.aws.amazon.com/translate/latest/APIReference/API_StartTextTranslationJob.html) オペレーションを使用します。Amazon Translate では、これらのジョブが正常に完了した時または失敗した時にイベントが送信されます。これらのイベントは次の例のようになります。

```
{
 "version": "0", 
 "id": "CWE-event-id", 
 "detail-type": "Translate TextTranslationJob State Change", 
 "source": "aws.translate", 
 "account": "111122223333", 
 "time": "2017-04-22T03:31:47Z", 
 "region": "us-east-1", 
 "resources": [], 
 "detail": {
    "jobId": "01234567-0123-0123-0123-012345678901", 
    "jobStatus": "{{STATUS}}" 
 } 
}
```

`jobStatus` 属性の値は、Amazon Translate から送信されたイベントのジョブの状態によって異なります。`jobStatus` 値は次のとおりです。
+ `COMPLETED` — ジョブが正常に完了し、出力が使用可能になりました。
+ `COMPLETED_WITH_ERROR` — ジョブの完了時にエラーが発生しました。エラーは、ジョブの出力で分析できます。
+ `STOPPED` — ジョブが停止されました。
+ `FAILED` — ジョブが完了しませんでした。詳細を取得するには、[DescribeTextTranslationJob](https://docs.aws.amazon.com/translate/latest/APIReference/API_DescribeTextTranslationJob.html) オペレーションを使用してください。

### 並列データリソースのイベント
<a name="monitoring-with-eventbridge-events"></a>

Amazon Translate を使用して並列データリソースを作成または更新すると、オペレーションが成功したか失敗したかを示すイベントが送信されます。

Amazon Translate コンソールまたは [CreateParallelData](https://docs.aws.amazon.com/translate/latest/APIReference/API_CreateParallelData.html) オペレーションを使用して、並列データリソースを作成します。これを行うと、Amazon Translate により次のようなイベントが送信されます。

```
{
 "version": "0", 
 "id": "CWE-event-id", 
 "detail-type": "Translate Parallel Data State Change", 
 "source": "aws.translate", 
 "account": "111122223333", 
 "time": "2017-04-22T03:31:47Z", 
 "region": "us-east-1", 
 "resources": [arn:aws:translate:us-east-1:111122223333:parallel-data/ExampleParallelData], 
 "detail": {
    "operation": "CreateParallelData",
    "name": "ExampleParallelData", 
    "status": "{{STATUS}}"
 } 
}
```

`status` 属性の値は次の通りです。
+ `ACTIVE` — `CreateParallelData `オペレーションが成功し、リソースを使用する準備が整いました。
+ `FAILED` – `CreateParallelData` オペレーションは失敗しました。

Amazon Translate コンソールまたは [UpdateParallelData](https://docs.aws.amazon.com/translate/latest/APIReference/API_UpdateParallelData.html) オペレーションを使用して、並列データリソースを更新します。これを行うと、Amazon Translate により次のようなイベントが送信されます。

```
{
 "version": "0", 
 "id": "CWE-event-id", 
 "detail-type": "Translate Parallel Data State Change", 
 "source": "aws.translate", 
 "account": "111122223333", 
 "time": "2017-04-22T03:31:47Z", 
 "region": "us-east-1", 
 "resources": [arn:aws:translate:us-east-1:111122223333:parallel-data/ExampleParallelData], 
 "detail": {
    "operation": "UpdateParallelData",
    "name": "ExampleParallelData", 
    "status": "{{STATUS}}",
    "latestUpdateAttemptStatus": "{{STATUS}}",
    "latestUpdateAttemptAt": "2017-04-22T03:31:47Z"
 } 
}
```

`status` 属性は、更新により置き換えられる旧バージョンの並列データリソースのステータスを示します。値は次のとおりです。
+ `ACTIVE` — 旧バージョンは正常に作成または更新されました。
+ `FAILED` — 旧バージョンの作成または更新に失敗しました。

`latestUpdateAttemptStatus` 属性は、更新により作成される新バージョンの並列データリソースのステータスを示します。値は次のとおりです。
+ `ACTIVE` — `UpdateParallelData` オペレーションは成功し、更新されたリソースを使用する準備が整いました。
+ `FAILED` – `UpdateParallelData` オペレーションは失敗しました。