

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

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

檢查 Amazon EC2-compatible執行個體的目前狀態。輸出類似於 `describeDevice`，但結果來自 中的裝置快取 AWS 雲端 ，並包含可用欄位的子集。

## 請求語法
<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>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 適用於 .NET V4 的 SDK](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 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 適用於 JavaScript V3 的 SDK](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 V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/snow-device-management-2021-08-04/DescribeDeviceEc2Instances) 
+  [AWS 適用於 Python 的 SDK](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) 