

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

# DescribeTask
<a name="API_devicemanagement_DescribeTask"></a>

查看设备上给定任务的元数据。

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

```
POST /task/{{taskId}} HTTP/1.1
```

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

请求使用以下 URI 参数。

 ** [taskId](#API_devicemanagement_DescribeTask_RequestSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-request-uri-taskId"></a>
要描述的任务的 ID。  
长度限制：长度下限为 1。长度上限为 64。  
是否必需：是

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

该请求没有请求正文。

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

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

{
   "completedAt": number,
   "createdAt": number,
   "description": "string",
   "lastUpdatedAt": number,
   "state": "string",
   "tags": { 
      "string" : "string" 
   },
   "targets": [ "string" ],
   "taskArn": "string",
   "taskId": "string"
}
```

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

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

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

 ** [completedAt](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-completedAt"></a>
任务完成的时间。  
类型：时间戳

 ** [createdAt](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-createdAt"></a>
调用 `CreateTask` 操作的时间。  
类型：时间戳

 ** [description](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-description"></a>
任务和托管设备的描述。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 128。  
模式：`[A-Za-z0-9 _.,!#]*`

 ** [lastUpdatedAt](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-lastUpdatedAt"></a>
上次更新任务状态的时间。  
类型：时间戳

 ** [state](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-state"></a>
该表的当前状态。  
类型：字符串  
有效值：`IN_PROGRESS | CANCELED | COMPLETED`

 ** [tags](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-tags"></a>
分配给资源的可选元数据。您可以使用标签按不同的方式（如用途、拥有者或环境）对资源进行分类。  
类型：字符串到字符串映射

 ** [targets](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-targets"></a>
任务发送到的托管设备。  
类型：字符串数组  
数组成员：最少 1 个物品。最多 10 个物品。

 ** [taskArn](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-taskArn"></a>
任务的 Amazon 资源名称（ARN）。  
类型：字符串

 ** [taskId](#API_devicemanagement_DescribeTask_ResponseSyntax) **   <a name="Snowball-devicemanagement_DescribeTask-response-taskId"></a>
任务的 ID。  
类型：字符串

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

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

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

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

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

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

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

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

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