

# AWS IoT Things Graph examples using AWS CLI
<a name="cli_iotthingsgraph_code_examples"></a>

次のコード例では、AWS IoT Things Graph で AWS Command Line Interface を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。

*アクション*はより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

**Topics**
+ [アクション](#actions)

## アクション
<a name="actions"></a>

### `associate-entity-to-thing`
<a name="iotthingsgraph_AssociateEntityToThing_cli_topic"></a>

次のコード例は、`associate-entity-to-thing` を使用する方法を示しています。

**AWS CLI**  
**モノをデバイスに関連付けるには**  
次の `associate-entity-to-thing` の例では、モノをデバイスに関連付けます。この例では、パブリック名前空間にあるモーションセンサーデバイスを使用しています。  

```
aws iotthingsgraph associate-entity-to-thing \
    --thing-name "MotionSensorName" \
    --entity-id "urn:tdm:aws/examples:Device:HCSR501MotionSensor"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[モデルの作成とアップロード](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-models-gs.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[AssociateEntityToThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/associate-entity-to-thing.html)」を参照してください。

### `create-flow-template`
<a name="iotthingsgraph_CreateFlowTemplate_cli_topic"></a>

次のコード例は、`create-flow-template` を使用する方法を示しています。

**AWS CLI**  
**フローを作成するには**  
次の `create-flow-template` の例では、フロー (ワークフロー) を作成します。`MyFlowDefinition` という値は、フローをモデル化する GraphQL です。  

```
aws iotthingsgraph create-flow-template \
    --definition language=GRAPHQL,text="MyFlowDefinition"
```
出力:  

```
{
    "summary": {
        "createdAt": 1559248067.545,
        "id": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
        "revisionNumber": 1
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateFlowTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/create-flow-template.html)」を参照してください。

### `create-system-instance`
<a name="iotthingsgraph_CreateSystemInstance_cli_topic"></a>

次のコード例は、`create-system-instance` を使用する方法を示しています。

**AWS CLI**  
**システムインスタンスを作成するには**  
次の `create-system-instance` の例では、システムインスタンスを作成します。`MySystemInstanceDefinition` という値は、システムインスタンスをモデル化する GraphQL です。  

```
aws iotthingsgraph create-system-instance -\
    -definition language=GRAPHQL,text="MySystemInstanceDefinition" \
    --target CLOUD \
    --flow-actions-role-arn myRoleARN
```
出力:  

```
{
    "summary": {
        "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room218",
        "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218",
        "status": "NOT_DEPLOYED",
        "target": "CLOUD",
        "createdAt": 1559249315.208,
        "updatedAt": 1559249315.208
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateSystemInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/create-system-instance.html)」を参照してください。

### `create-system-template`
<a name="iotthingsgraph_CreateSystemTemplate_cli_topic"></a>

次のコード例は、`create-system-template` を使用する方法を示しています。

**AWS CLI**  
**システムを作成するには**  
次の `create-system-template` の例では、システムを作成します。MySystemDefinition という値は、システムをモデル化する GraphQL です。  

```
aws iotthingsgraph create-system-template \
    --definition language=GRAPHQL,text="MySystemDefinition"
```
出力:  

```
{
    "summary": {
        "createdAt": 1559249776.254,
        "id": "urn:tdm:us-west-2/123456789012/default:System:MySystem",
        "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:System/default/MySystem",
        "revisionNumber": 1
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムの作成](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy-systems.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CreateSystemTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/create-system-template.html)」を参照してください。

### `delete-flow-template`
<a name="iotthingsgraph_DeleteFlowTemplate_cli_topic"></a>

次のコード例は、`delete-flow-template` を使用する方法を示しています。

**AWS CLI**  
**フローを削除するには**  
次の `delete-flow-template` の例では、フロー (ワークフロー) を削除します。  

```
aws iotthingsgraph delete-flow-template \
    --id "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteFlowTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/delete-flow-template.html)」を参照してください。

### `delete-namespace`
<a name="iotthingsgraph_DeleteNamespace_cli_topic"></a>

次のコード例は、`delete-namespace` を使用する方法を示しています。

**AWS CLI**  
**名前空間を削除するには**  
次の `delete-namespace` の例では、名前空間を削除します。  

```
aws iotthingsgraph delete-namespace
```
出力:  

```
{
   "namespaceArn": "arn:aws:iotthingsgraph:us-west-2:123456789012",
   "namespaceName": "us-west-2/123456789012/default"
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteNamespace](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/delete-namespace.html)」を参照してください。

### `delete-system-instance`
<a name="iotthingsgraph_DeleteSystemInstance_cli_topic"></a>

次のコード例は、`delete-system-instance` を使用する方法を示しています。

**AWS CLI**  
**システムインスタンスを削除するには**  
次の `delete-system-instance` の例では、システムインスタンスを削除します。  

```
aws iotthingsgraph delete-system-instance \
    --id "urn:tdm:us-west-2/123456789012/default:Deployment:Room218"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteSystemInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/delete-system-instance.html)」を参照してください。

### `delete-system-template`
<a name="iotthingsgraph_DeleteSystemTemplate_cli_topic"></a>

次のコード例は、`delete-system-template` を使用する方法を示しています。

**AWS CLI**  
**システムを削除するには**  
次の `delete-system-template` の例では、システムを削除します。  

```
aws iotthingsgraph delete-system-template \
    --id "urn:tdm:us-west-2/123456789012/default:System:MySystem"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteSystemTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/delete-system-template.html)」を参照してください。

### `deploy-system-instance`
<a name="iotthingsgraph_DeploySystemInstance_cli_topic"></a>

次のコード例は、`deploy-system-instance` を使用する方法を示しています。

**AWS CLI**  
**システムインスタンスをデプロイするには**  
次の `delete-system-template` の例では、システムインスタンスをデプロイします。  

```
aws iotthingsgraph deploy-system-instance \
    --id "urn:tdm:us-west-2/123456789012/default:Deployment:Room218"
```
出力:  

```
{
   "summary": {
      "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment:Room218",
      "createdAt": 1559249776.254,
      "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room218",
      "status": "DEPLOYED_IN_TARGET",
      "target": "CLOUD",
      "updatedAt": 1559249776.254
   }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeploySystemInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/deploy-system-instance.html)」を参照してください。

### `deprecate-flow-template`
<a name="iotthingsgraph_DeprecateFlowTemplate_cli_topic"></a>

次のコード例は、`deprecate-flow-template` を使用する方法を示しています。

**AWS CLI**  
**フローを非推奨にするには**  
次の `deprecate-flow-template` の例では、フロー (ワークフロー) を非推奨にします。  

```
aws iotthingsgraph deprecate-flow-template \
    --id "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeprecateFlowTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/deprecate-flow-template.html)」を参照してください。

### `deprecate-system-template`
<a name="iotthingsgraph_DeprecateSystemTemplate_cli_topic"></a>

次のコード例は、`deprecate-system-template` を使用する方法を示しています。

**AWS CLI**  
**システムを非推奨にするには**  
次の `deprecate-system-template` の例では、システムを非推奨にします。  

```
aws iotthingsgraph deprecate-system-template \
    --id "urn:tdm:us-west-2/123456789012/default:System:MySystem"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeprecateSystemTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/deprecate-system-template.html)」を参照してください。

### `describe-namespace`
<a name="iotthingsgraph_DescribeNamespace_cli_topic"></a>

次のコード例は、`describe-namespace` を使用する方法を示しています。

**AWS CLI**  
**名前空間の説明を取得するには**  
次の `describe-namespace` の例では、名前空間の説明を取得します。  

```
aws iotthingsgraph describe-namespace
```
出力:  

```
{
    "namespaceName": "us-west-2/123456789012/default",
    "trackingNamespaceName": "aws",
    "trackingNamespaceVersion": 1,
    "namespaceVersion": 5
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[名前空間](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-whatis-namespace.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DescribeNamespace](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/describe-namespace.html)」を参照してください。

### `dissociate-entity-from-thing`
<a name="iotthingsgraph_DissociateEntityFromThing_cli_topic"></a>

次のコード例は、`dissociate-entity-from-thing` を使用する方法を示しています。

**AWS CLI**  
**デバイスからモノの関連付けを解除するには**  
次の `dissociate-entity-from-thing` の例では、デバイスからモノの関連付けを解除します。  

```
aws iotthingsgraph dissociate-entity-from-thing \
    --thing-name "MotionSensorName" \
    --entity-type "DEVICE"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[モデルの作成とアップロード](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-models-gs.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DissociateEntityFromThing](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/dissociate-entity-from-thing.html)」を参照してください。

### `get-entities`
<a name="iotthingsgraph_GetEntities_cli_topic"></a>

次のコード例は、`get-entities` を使用する方法を示しています。

**AWS CLI**  
**エンティティの定義を取得するには**  
次の `get-entities` の例では、デバイスモデルの定義を取得します。  

```
aws iotthingsgraph get-entities \
    --ids "urn:tdm:aws/examples:DeviceModel:MotionSensor"
```
出力:  

```
{
    "descriptions": [
        {
            "id": "urn:tdm:aws/examples:DeviceModel:MotionSensor",
            "type": "DEVICE_MODEL",
            "createdAt": 1559256190.599,
            "definition": {
                "language": "GRAPHQL",
                "text": "##\n# Specification of motion sensor devices interface.\n##\ntype MotionSensor @deviceModel(id: \"urn:tdm:aws/examples:deviceModel:MotionSensor\",\n        capability: \"urn:tdm:aws/examples:capability:MotionSensorCapability\") {ignore:void}"
            }
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[モデルの作成とアップロード](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-models-gs.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetEntities](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-entities.html)」を参照してください。

### `get-flow-template-revisions`
<a name="iotthingsgraph_GetFlowTemplateRevisions_cli_topic"></a>

次のコード例は、`get-flow-template-revisions` を使用する方法を示しています。

**AWS CLI**  
**フローに関するリビジョン情報を取得するには**  
次の `get-flow-template-revisions` の例では、フロー (ワークフロー) に関するリビジョン情報を取得します。  

```
aws iotthingsgraph get-flow-template-revisions \
    --id urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow
```
出力:  

```
{
    "summaries": [
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
            "revisionNumber": 1,
            "createdAt": 1559247540.292
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetFlowTemplateRevisions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-flow-template-revisions.html)」を参照してください。

### `get-flow-template`
<a name="iotthingsgraph_GetFlowTemplate_cli_topic"></a>

次のコード例は、`get-flow-template` を使用する方法を示しています。

**AWS CLI**  
**フロー定義を取得するには**  
次の `get-flow-template` の例では、フロー (ワークフロー) の定義を取得します。  

```
aws iotthingsgraph get-flow-template \
    --id "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow"
```
出力:  

```
{
    "description": {
        "summary": {
            "id": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
            "revisionNumber": 1,
            "createdAt": 1559247540.292
        },
        "definition": {
            "language": "GRAPHQL",
            "text": "{\nquery MyFlow($camera: string!, $screen: string!) @workflowType(id: \"urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow\") @annotation(type: \"tgc:FlowEvent\", id: \"sledged790c1b2bcd949e09da0c9bfc077f79d\", x: 1586, y: 653) @triggers(definition: \"{MotionSensor(description: \\\"\\\") @position(x: 1045, y: 635.6666564941406) {\\n  condition(expr: \\\"devices[name == \\\\\\\"motionSensor\\\\\\\"].events[name == \\\\\\\"StateChanged\\\\\\\"].lastEvent\\\")\\n  action(expr: \\\"\\\")\\n}}\") {\n  variables {\n    cameraResult @property(id: \"urn:tdm:aws/examples:property:CameraStateProperty\")\n  }\n  steps {\n    step(name: \"Camera\", outEvent: [\"sledged790c1b2bcd949e09da0c9bfc077f79d\"]) @position(x: 1377, y: 638.6666564941406) {\n      DeviceActivity(deviceModel: \"urn:tdm:aws/examples:deviceModel:Camera\", out: \"cameraResult\", deviceId: \"${camera}\") {\n        capture\n      }\n    }\n    step(name: \"Screen\", inEvent: [\"sledged790c1b2bcd949e09da0c9bfc077f79d\"]) @position(x: 1675.6666870117188, y: 637.9999847412109) {\n      DeviceActivity(deviceModel: \"urn:tdm:aws/examples:deviceModel:Screen\", deviceId: \"${screen}\") {\n        display(imageUrl: \"${cameraResult.lastClickedImage}\")\n      }\n    }\n  }\n}\n}"
        },
        "validatedNamespaceVersion": 5
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetFlowTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-flow-template.html)」を参照してください。

### `get-namespace-deletion-status`
<a name="iotthingsgraph_GetNamespaceDeletionStatus_cli_topic"></a>

次のコード例は、`get-namespace-deletion-status` を使用する方法を示しています。

**AWS CLI**  
**名前空間削除タスクのステータスを取得するには**  
次の `get-namespace-deletion-status` の例では、名前空間削除タスクのステータスを取得します。  

```
aws iotthingsgraph get-namespace-deletion-status
```
出力:  

```
{
   "namespaceArn": "arn:aws:iotthingsgraph:us-west-2:123456789012",
   "namespaceName": "us-west-2/123456789012/default"
   "status": "SUCCEEDED "
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[名前空間](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-whatis-namespace.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetNamespaceDeletionStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-namespace-deletion-status.html)」を参照してください。

### `get-system-instance`
<a name="iotthingsgraph_GetSystemInstance_cli_topic"></a>

次のコード例は、`get-system-instance` を使用する方法を示しています。

**AWS CLI**  
**システムインスタンスを取得するには**  
次の `get-system-instance` の例では、システムインスタンスの定義を取得します。  

```
aws iotthingsgraph get-system-instance \
    --id "urn:tdm:us-west-2/123456789012/default:Deployment:Room218"
```
出力:  

```
{
    "description": {
        "summary": {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room218",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218",
            "status": "NOT_DEPLOYED",
            "target": "CLOUD",
            "createdAt": 1559249315.208,
            "updatedAt": 1559249315.208
        },
        "definition": {
            "language": "GRAPHQL",
            "text": "{\r\nquery Room218 @deployment(id: \"urn:tdm:us-west-2/123456789012/default:Deployment:Room218\", systemId: \"urn:tdm:us-west-2/123456789012/default:System:SecurityFlow\") {\r\n    motionSensor(deviceId: \"MotionSensorName\")\r\n    screen(deviceId: \"ScreenName\")\r\n    camera(deviceId: \"CameraName\") \r\n    triggers {MotionEventTrigger(description: \"a trigger\") {  \r\n    condition(expr: \"devices[name == 'motionSensor'].events[name == 'StateChanged'].lastEvent\") \r\n    action(expr: \"ThingsGraph.startFlow('SecurityFlow', bindings[name == 'camera'].deviceId, bindings[name == 'screen'].deviceId)\")\r\n    }\r\n   }\r\n  }\r\n  }"
        },
        "metricsConfiguration": {
            "cloudMetricEnabled": false
        },
        "validatedNamespaceVersion": 5,
        "flowActionsRoleArn": "arn:aws:iam::123456789012:role/ThingsGraphRole"
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetSystemInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-system-instance.html)」を参照してください。

### `get-system-template-revisions`
<a name="iotthingsgraph_GetSystemTemplateRevisions_cli_topic"></a>

次のコード例は、`get-system-template-revisions` を使用する方法を示しています。

**AWS CLI**  
**システムに関するリビジョン情報を取得するには**  
次の `get-system-template-revisions` の例では、システムに関するリビジョン情報を取得します。  

```
aws iotthingsgraph get-system-template-revisions \
    --id "urn:tdm:us-west-2/123456789012/default:System:MySystem"
```
出力:  

```
{
    "summaries": [
        {
            "id": "urn:tdm:us-west-2/123456789012/default:System:MySystem",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:System/default/MySystem",
            "revisionNumber": 1,
            "createdAt": 1559247540.656
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetSystemTemplateRevisions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-system-template-revisions.html)」を参照してください。

### `get-system-template`
<a name="iotthingsgraph_GetSystemTemplate_cli_topic"></a>

次のコード例は、`get-system-template` を使用する方法を示しています。

**AWS CLI**  
**システムを取得するには**  
次の `get-system-template` の例では、システムの定義を取得します。  

```
aws iotthingsgraph get-system-template \
    --id "urn:tdm:us-west-2/123456789012/default:System:MySystem"
```
出力:  

```
{
    "description": {
        "summary": {
            "id": "urn:tdm:us-west-2/123456789012/default:System:MySystem",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:System/default/MyFlow",
            "revisionNumber": 1,
            "createdAt": 1559247540.656
        },
        "definition": {
            "language": "GRAPHQL",
            "text": "{\ntype MySystem @systemType(id: \"urn:tdm:us-west-2/123456789012/default:System:MySystem\", description: \"\") {\n  camera: Camera @thing(id: \"urn:tdm:aws/examples:deviceModel:Camera\")\n  screen: Screen @thing(id: \"urn:tdm:aws/examples:deviceModel:Screen\")\n  motionSensor: MotionSensor @thing(id: \"urn:tdm:aws/examples:deviceModel:MotionSensor\")\n  MyFlow: MyFlow @workflow(id: \"urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow\")\n}\n}"
        },
        "validatedNamespaceVersion": 5
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetSystemTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-system-template.html)」を参照してください。

### `get-upload-status`
<a name="iotthingsgraph_GetUploadStatus_cli_topic"></a>

次のコード例は、`get-upload-status` を使用する方法を示しています。

**AWS CLI**  
**エンティティアップロードのステータスを取得するには**  
次の `get-upload-status` の例では、エンティティアップロードオペレーションのステータスを取得します。`MyUploadId` という値は、`upload-entity-definitions` オペレーションによって返される ID 値です。  

```
aws iotthingsgraph get-upload-status \
    --upload-id "MyUploadId"
```
出力:  

```
{
    "namespaceName": "us-west-2/123456789012/default",
    "namespaceVersion": 5,
    "uploadId": "f6294f1e-b109-4bbe-9073-f451a2dda2da",
    "uploadStatus": "SUCCEEDED"
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[エンティティのモデリング](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-modelmanagement.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetUploadStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/get-upload-status.html)」を参照してください。

### `list-flow-execution-messages`
<a name="iotthingsgraph_ListFlowExecutionMessages_cli_topic"></a>

次のコード例は、`list-flow-execution-messages` を使用する方法を示しています。

**AWS CLI**  
**フロー実行中のイベントに関する情報を取得するには**  
次の `list-flow-execution-messages` の例では、フロー実行中のイベントに関する情報を取得します。  

```
aws iotthingsgraph list-flow-execution-messages \
    --flow-execution-id "urn:tdm:us-west-2/123456789012/default:Workflow:SecurityFlow_2019-05-11T19:39:55.317Z_MotionSensor_69b151ad-a611-42f5-ac21-fe537f9868ad"
```
出力:  

```
{
    "messages": [
        {
         "eventType": "EXECUTION_STARTED",
         "messageId": "f6294f1e-b109-4bbe-9073-f451a2dda2da",
         "payload": "Flow execution started",
         "timestamp": 1559247540.656
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListFlowExecutionMessages](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/list-flow-execution-messages.html)」を参照してください。

### `list-tags-for-resource`
<a name="iotthingsgraph_ListTagsForResource_cli_topic"></a>

次のコード例は、`list-tags-for-resource` を使用する方法を示しています。

**AWS CLI**  
**リソースのすべてのタグを一覧表示するには**  
次の `list-tags-for-resource` の例では、AWS IoT Things Graph リソースのすべてのタグを一覧表示します。  

```
aws iotthingsgraph list-tags-for-resource \
    --resource-arn "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218"
```
出力:  

```
{
   "tags": [
      {
         "key": "Type",
         "value": "Residential"
      }
   ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph リソースのタグ付け](https://docs.aws.amazon.com/thingsgraph/latest/ug/tagging-tg.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/list-tags-for-resource.html)」を参照してください。

### `search-entities`
<a name="iotthingsgraph_SearchEntities_cli_topic"></a>

次のコード例は、`search-entities` を使用する方法を示しています。

**AWS CLI**  
**エンティティを検索するには**  
次の `search-entities` の例では、タイプが `EVENT` のすべてのエンティティを検索します。  

```
aws iotthingsgraph search-entities \
    --entity-types "EVENT"
```
出力:  

```
{
    "descriptions": [
        {
            "id": "urn:tdm:aws/examples:Event:MotionSensorEvent",
            "type": "EVENT",
            "definition": {
                "language": "GRAPHQL",
                "text": "##\n# Description of events emitted by motion sensor.\n##\ntype MotionSensorEvent @eventType(id: \"urn:tdm:aws/examples:event:MotionSensorEvent\",\n            payload: \"urn:tdm:aws/examples:property:MotionSensorStateProperty\") {ignore:void}"
            }
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Event:CameraClickedEventV2",
            "type": "EVENT",
            "definition": {
                "language": "GRAPHQL",
                "text": "type CameraClickedEventV2 @eventType(id: \"urn:tdm:us-west-2/123456789012/default:event:CameraClickedEventV2\",\r\npayload: \"urn:tdm:aws:Property:Boolean\"){ignore:void}"
            }
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Event:MotionSensorEventV2",
            "type": "EVENT",
            "definition": {
                "language": "GRAPHQL",
                "text": "# Event emitted by the motion sensor.\r\ntype MotionSensorEventV2 @eventType(id: \"urn:tdm:us-west-2/123456789012/default:event:MotionSensorEventV2\",\r\npayload: \"urn:tdm:us-west-2/123456789012/default:property:MotionSensorStateProperty2\") {ignore:void}"
            }
        }
    ],
    "nextToken": "urn:tdm:us-west-2/123456789012/default:Event:MotionSensorEventV2"
}
```
詳細については、「AWS IoT Things Graph ユーザーガイド」の「[AWS IoT Things Graph データモデルのリファレンス](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-models.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchEntities](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-entities.html)」を参照してください。

### `search-flow-executions`
<a name="iotthingsgraph_SearchFlowExecutions_cli_topic"></a>

次のコード例は、`search-flow-executions` を使用する方法を示しています。

**AWS CLI**  
**フロー実行を検索するには**  
次の `search-flow-executions` の例では、指定されたシステムインスタンス内のフローのすべての実行を検索します。  

```
aws iotthingsgraph search-flow-executions \
    --system-instance-id "urn:tdm:us-west-2/123456789012/default:Deployment:Room218"
```
出力:  

```
{
   "summaries": [
      {
         "createdAt": 1559247540.656,
         "flowExecutionId": "f6294f1e-b109-4bbe-9073-f451a2dda2da",
         "flowTemplateId": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
         "status": "RUNNING ",
         "systemInstanceId": "urn:tdm:us-west-2/123456789012/default:System:MySystem",
         "updatedAt": 1559247540.656
      }
   ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchFlowExecutions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-flow-executions.html)」を参照してください。

### `search-flow-templates`
<a name="iotthingsgraph_SearchFlowTemplates_cli_topic"></a>

次のコード例は、`search-flow-templates` を使用する方法を示しています。

**AWS CLI**  
**フロー (またはワークフロー) を検索するには**  
次の `search-flow-templates` の例では、Camera デバイスモデルを含むすべてのフロー (ワークフロー) を検索します。  

```
aws iotthingsgraph search-flow-templates \
    --filters name="DEVICE_MODEL_ID",value="urn:tdm:aws/examples:DeviceModel:Camera"
```
出力:  

```
{
    "summaries": [
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
            "revisionNumber": 1,
            "createdAt": 1559247540.292
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Workflow:SecurityFlow",
            "revisionNumber": 3,
            "createdAt": 1548283099.27
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchFlowTemplates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-flow-templates.html)」を参照してください。

### `search-system-instances`
<a name="iotthingsgraph_SearchSystemInstances_cli_topic"></a>

次のコード例は、`search-system-instances` を使用する方法を示しています。

**AWS CLI**  
**システムインスタンスを検索するには**  
次の `search-system-instances` の例では、指定されたシステムを含むすべてのシステムインスタンスを検索します。  

```
aws iotthingsgraph search-system-instances \
    --filters name="SYSTEM_TEMPLATE_ID",value="urn:tdm:us-west-2/123456789012/default:System:SecurityFlow"
```
出力:  

```
{
    "summaries": [
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:DeploymentForSample",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/DeploymentForSample",
            "status": "NOT_DEPLOYED",
            "target": "GREENGRASS",
            "greengrassGroupName": "ThingsGraphGrnGr",
            "createdAt": 1555716314.707,
            "updatedAt": 1555716314.707
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:MockDeployment",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/MockDeployment",
            "status": "DELETED_IN_TARGET",
            "target": "GREENGRASS",
            "greengrassGroupName": "ThingsGraphGrnGr",
            "createdAt": 1549416462.049,
            "updatedAt": 1549416722.361,
            "greengrassGroupId": "01d04b07-2a51-467f-9d03-0c90b3cdcaaf",
            "greengrassGroupVersionId": "7365aed7-2d3e-4d13-aad8-75443d45eb05"
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:MockDeployment2",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/MockDeployment2",
            "status": "DEPLOYED_IN_TARGET",
            "target": "GREENGRASS",
            "greengrassGroupName": "ThingsGraphGrnGr",
            "createdAt": 1549572385.774,
            "updatedAt": 1549572418.408,
            "greengrassGroupId": "01d04b07-2a51-467f-9d03-0c90b3cdcaaf",
            "greengrassGroupVersionId": "bfa70ab3-2bf7-409c-a4d4-bc8328ae5b86"
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room215",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room215",
            "status": "NOT_DEPLOYED",
            "target": "GREENGRASS",
            "greengrassGroupName": "ThingsGraphGG",
            "createdAt": 1547056918.413,
            "updatedAt": 1547056918.413
        },
        {
            "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room218",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218",
            "status": "NOT_DEPLOYED",
            "target": "CLOUD",
            "createdAt": 1559249315.208,
            "updatedAt": 1559249315.208
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムとフロー設定の使用](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchSystemInstances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-system-instances.html)」を参照してください。

### `search-system-templates`
<a name="iotthingsgraph_SearchSystemTemplates_cli_topic"></a>

次のコード例は、`search-system-templates` を使用する方法を示しています。

**AWS CLI**  
**システムを検索するには**  
次の `search-system-templates` の例では、指定されたフローを含むすべてのシステムを検索します。  

```
aws iotthingsgraph search-system-templates \
    --filters name="FLOW_TEMPLATE_ID",value="urn:tdm:us-west-2/123456789012/default:Workflow:SecurityFlow"
```
出力:  

```
{
    "summaries": [
        {
            "id": "urn:tdm:us-west-2/123456789012/default:System:SecurityFlow",
            "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:System/default/SecurityFlow",
            "revisionNumber": 1,
            "createdAt": 1548283099.433
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchSystemTemplates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-system-templates.html)」を参照してください。

### `search-things`
<a name="iotthingsgraph_SearchThings_cli_topic"></a>

次のコード例は、`search-things` を使用する方法を示しています。

**AWS CLI**  
**デバイスとデバイスモデルに関連付けられているモノを検索するには**  
次の `search-things` の例では、HCSR501MotionSensor デバイスに関連付けられているすべてのモノを検索します。  

```
aws iotthingsgraph search-things \
    --entity-id "urn:tdm:aws/examples:Device:HCSR501MotionSensor"
```
出力:  

```
{
    "things": [
        {
            "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/MotionSensor1",
            "thingName": "MotionSensor1"
        },
        {
            "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/TG_MS",
            "thingName": "TG_MS"
        }
    ]
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[モデルの作成とアップロード](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-models-gs.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[SearchThings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/search-things.html)」を参照してください。

### `tag-resource`
<a name="iotthingsgraph_TagResource_cli_topic"></a>

次のコード例は、`tag-resource` を使用する方法を示しています。

**AWS CLI**  
**リソースのタグを作成するには**  
次の `tag-resource` の例では、指定されたリソースのタグを作成します。  

```
aws iotthingsgraph tag-resource \
    --resource-arn "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218" \
    --tags key="Type",value="Residential"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph リソースのタグ付け](https://docs.aws.amazon.com/thingsgraph/latest/ug/tagging-tg.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/tag-resource.html)」を参照してください。

### `undeploy-system-instance`
<a name="iotthingsgraph_UndeploySystemInstance_cli_topic"></a>

次のコード例は、`undeploy-system-instance` を使用する方法を示しています。

**AWS CLI**  
**ターゲットからシステムインスタンスをデプロイ解除するには**  
次の `undeploy-system-instance` の例では、ターゲットからシステムインスタンスを削除します。  

```
aws iotthingsgraph undeploy-system-instance \
    --id "urn:tdm:us-west-2/123456789012/default:Deployment:Room215"
```
出力:  

```
{
    "summary": {
        "id": "urn:tdm:us-west-2/123456789012/default:Deployment:Room215",
        "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room215",
        "status": "PENDING_DELETE",
        "target": "GREENGRASS",
        "greengrassGroupName": "ThingsGraphGrnGr",
        "createdAt": 1553189694.255,
        "updatedAt": 1559344549.601,
        "greengrassGroupId": "01d04b07-2a51-467f-9d03-0c90b3cdcaaf",
        "greengrassGroupVersionId": "731b371d-d644-4b67-ac64-3934e99b75d7"
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph エンティティ、フロー、システム、デプロイのライフサイクル管理](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-lifecycle.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UndeploySystemInstance](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/undeploy-system-instance.html)」を参照してください。

### `untag-resource`
<a name="iotthingsgraph_UntagResource_cli_topic"></a>

次のコード例は、`untag-resource` を使用する方法を示しています。

**AWS CLI**  
**リソースのタグを削除するには**  
次の `untag-resource` の例では、指定されたリソースのタグを削除します。  

```
aws iotthingsgraph untag-resource \
    --resource-arn "arn:aws:iotthingsgraph:us-west-2:123456789012:Deployment/default/Room218" \
    --tag-keys "Type"
```
このコマンドでは何も出力されません。  
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[AWS IoT Things Graph リソースのタグ付け](https://docs.aws.amazon.com/thingsgraph/latest/ug/tagging-tg.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/untag-resource.html)」を参照してください。

### `update-flow-template`
<a name="iotthingsgraph_UpdateFlowTemplate_cli_topic"></a>

次のコード例は、`update-flow-template` を使用する方法を示しています。

**AWS CLI**  
**フローを更新するには**  
次の `update-flow-template` の例では、フロー (ワークフロー) を更新します。`MyFlowDefinition` という値は、フローをモデル化する GraphQL です。  

```
aws iotthingsgraph update-flow-template \
    --id "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow" \
    --definition language=GRAPHQL,text="MyFlowDefinition"
```
出力:  

```
{
    "summary": {
        "createdAt": 1559248067.545,
        "id": "urn:tdm:us-west-2/123456789012/default:Workflow:MyFlow",
        "revisionNumber": 2
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[フローでの作業](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-workflows.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateFlowTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/update-flow-template.html)」を参照してください。

### `update-system-template`
<a name="iotthingsgraph_UpdateSystemTemplate_cli_topic"></a>

次のコード例は、`update-system-template` を使用する方法を示しています。

**AWS CLI**  
**システムを更新するには**  
次の `update-system-template` の例では、システムを更新します。`MySystemDefinition` という値は、システムをモデル化する GraphQL です。  

```
aws iotthingsgraph update-system-template \
    --id "urn:tdm:us-west-2/123456789012/default:System:MySystem" \
    --definition language=GRAPHQL,text="MySystemDefinition"
```
出力:  

```
{
    "summary": {
        "createdAt": 1559249776.254,
        "id": "urn:tdm:us-west-2/123456789012/default:System:MySystem",
        "arn": "arn:aws:iotthingsgraph:us-west-2:123456789012:System/default/MySystem",
        "revisionNumber": 2
    }
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[システムの作成](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-sysdeploy-systems.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateSystemTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/update-system-template.html)」を参照してください。

### `upload-entity-definitions`
<a name="iotthingsgraph_UploadEntityDefinitions_cli_topic"></a>

次のコード例は、`upload-entity-definitions` を使用する方法を示しています。

**AWS CLI**  
**エンティティ定義をアップロードするには**  
次の `upload-entity-definitions` の例では、エンティティ定義を名前空間にアップロードします。`MyEntityDefinitions` という値は、エンティティをモデル化する GraphQL です。  

```
aws iotthingsgraph upload-entity-definitions \
    --document language=GRAPHQL,text="MyEntityDefinitions"
```
出力:  

```
{
    "uploadId": "f6294f1e-b109-4bbe-9073-f451a2dda2da"
}
```
詳細については、「*AWS IoT Things Graph ユーザーガイド*」の「[エンティティのモデリング](https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-modelmanagement.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UploadEntityDefinitions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotthingsgraph/upload-entity-definitions.html)」を参照してください。