

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# DescribeDeviceEc2Instances
<a name="API_devicemanagement_DescribeDeviceEc2Instances"></a>

检查与 Amazon EC2 兼容的实例的当前状态。输出与 `describeDevice` 类似，但结果来自 AWS Cloud 中的设备缓存，并且包括可用字段的子集。

## 请求语法
<a name="API_devicemanagement_DescribeDeviceEc2Instances_RequestSyntax"></a>

```
POST /managed-device/{{managedDeviceId}}/resources/ec2/describe HTTP/1.1
Content-type: application/json

{
   "instanceIds": [ "{{string}}" ]
}
```

## URI 请求参数
<a name="API_devicemanagement_DescribeDeviceEc2Instances_RequestParameters"></a>

请求使用以下 URI 参数。

 ** [managedDeviceId](#API_devicemanagement_DescribeDeviceEc2Instances_RequestSyntax) **   <a name="Snowball-devicemanagement_DescribeDeviceEc2Instances-request-uri-managedDeviceId"></a>
托管设备的 ID。  
长度限制：长度下限为 1。长度上限为 64。  
是否必需：是

## 请求体
<a name="API_devicemanagement_DescribeDeviceEc2Instances_RequestBody"></a>

请求接受采用 JSON 格式的以下数据。

 ** [instanceIds](#API_devicemanagement_DescribeDeviceEc2Instances_RequestSyntax) **   <a name="Snowball-devicemanagement_DescribeDeviceEc2Instances-request-instanceIds"></a>
与受管设备 IDs 关联的实例列表。  
类型：字符串数组  
是否必需：是

## 响应语法
<a name="API_devicemanagement_DescribeDeviceEc2Instances_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "instances": [ 
      { 
         "instance": { 
            "amiLaunchIndex": number,
            "blockDeviceMappings": [ 
               { 
                  "deviceName": "string",
                  "ebs": { 
                     "attachTime": number,
                     "deleteOnTermination": boolean,
                     "status": "string",
                     "volumeId": "string"
                  }
               }
            ],
            "cpuOptions": { 
               "coreCount": number,
               "threadsPerCore": number
            },
            "createdAt": number,
            "imageId": "string",
            "instanceId": "string",
            "instanceType": "string",
            "privateIpAddress": "string",
            "publicIpAddress": "string",
            "rootDeviceName": "string",
            "securityGroups": [ 
               { 
                  "groupId": "string",
                  "groupName": "string"
               }
            ],
            "state": { 
               "code": number,
               "name": "string"
            },
            "updatedAt": number
         },
         "lastUpdatedAt": number
      }
   ]
}
```

## 响应元素
<a name="API_devicemanagement_DescribeDeviceEc2Instances_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 ** [instances](#API_devicemanagement_DescribeDeviceEc2Instances_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeDeviceEc2Instances-response-instances"></a>
包含每个实例相关信息的结构列表。  
类型：[InstanceSummary](API_devicemanagement_InstanceSummary.md) 对象数组

## 错误
<a name="API_devicemanagement_DescribeDeviceEc2Instances_Errors"></a>

有关所有操作返回的常见错误的信息，请参阅 [常见错误类型](CommonErrors.md)。

 ** AccessDeniedException **   
您没有足够的访问权限，无法执行该操作。  
HTTP 状态代码：403

 ** InternalServerException **   
处理请求时出现意外错误。  
HTTP 状态代码：500

 ** ResourceNotFoundException **   
该请求引用的资源不存在。  
HTTP 状态代码：404

 ** ThrottlingException **   
由于请求限制而导致请求被拒绝。  
HTTP 状态代码：429

 ** ValidationException **   
输入无法满足 AWS 服务指定的约束。  
HTTP 状态代码：400

## 另请参阅
<a name="API_devicemanagement_DescribeDeviceEc2Instances_SeeAlso"></a>

有关以特定语言之一使用此 API 的更多信息 AWS SDKs，请参阅以下内容：
+  [AWS 命令行界面 V2](https://docs.aws.amazon.com/goto/cli2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于.NET 的 SDK V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 C\+\+ 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 Go v2 的 SDK](https://docs.aws.amazon.com/goto/SdkForGoV2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 Java 的 SDK V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS JavaScript V3 版软件开发工具包](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 PHP 的 SDK V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS Python 软件开发工具包](https://docs.aws.amazon.com/goto/boto3/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 适用于 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 