

サポート終了通知: 2026 年 5 月 20 日、 AWS は のサポートを終了します AWS IoT Events。2026 年 5 月 20 日以降、 AWS IoT Events コンソールまたは AWS IoT Events リソースにアクセスできなくなります。詳細については、[AWS IoT Events 「サポート終了](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-end-of-support.html)」を参照してください。

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

# の入力に BatchPutMessage を使用する AWS IoT Events
<a name="iotevents-commented-example-input-usage-examples"></a>

**Example 1**  
`BatchPutMessage` オペレーションを使用して、温度制御およびモニタリング下の特定の領域の操作パラメータを設定する `"seedTemperatureInput"` メッセージを送信します。新しい AWS IoT Events を持つメッセージが によって受信`"areaId"`されると、新しいディテクターインスタンスが作成されます。ただし、新しいディテクターインスタンスは状態を `"idle"` に変更せず、新しい領域の `"seedTemperatureInput"` メッセージが受信されるまで、温度のモニタリングと暖房または冷房単位の制御を開始します。  
CLI コマンド:  

```
aws iotevents-data batch-put-message --cli-input-json file://seedExample.json --cli-binary-format raw-in-base64-out
```
ファイル: `seedExample.json`  

```
{
  "messages": [
    {
      "messageId": "00001",
      "inputName": "seedTemperatureInput",
      "payload": "{\"areaId\": \"Area51\", \"desiredTemperature\": 20.0, \"allowedError\": 0.7, \"rangeHigh\": 30.0, \"rangeLow\": 15.0, \"anomalousHigh\": 60.0, \"anomalousLow\": 0.0, \"sensorCount\": 10, \"noDelay\": false}"
    }
  ]
}
```
レスポンス:  

```
{
    "BatchPutMessageErrorEntries": []
}
```

**Example**  
2  
`BatchPutMessage` オペレーションを使用して `"temperatureInput"` メッセージを送信し、特定の制御およびモニタリング領域にあるセンサーの温度センサーデータを報告します。  
CLI コマンド:  

```
aws iotevents-data batch-put-message --cli-input-json file://temperatureExample.json --cli-binary-format raw-in-base64-out
```
ファイル: `temperatureExample.json`  

```
{
  "messages": [
    {
      "messageId": "00005",
      "inputName": "temperatureInput",
      "payload": "{\"sensorId\": \"05\", \"areaId\": \"Area51\", \"sensorData\": {\"temperature\": 23.12} }"
    }
  ]
}
```
レスポンス:  

```
{
    "BatchPutMessageErrorEntries": []
}
```

**Example 3**  
`BatchPutMessage` オペレーションを使用して `"seedTemperatureInput"` メッセージを送信し、特定の領域の目的の温度の値を変更します。  
CLI コマンド:  

```
aws iotevents-data batch-put-message --cli-input-json file://seedSetDesiredTemp.json --cli-binary-format raw-in-base64-out
```
ファイル: `seedSetDesiredTemp.json`  

```
{
  "messages": [
    {
      "messageId": "00001",
      "inputName": "seedTemperatureInput",
      "payload": "{\"areaId\": \"Area51\", \"desiredTemperature\": 23.0}"
    }
  ]
}
```
レスポンス:  

```
{
    "BatchPutMessageErrorEntries": []
}
```