CreateTask
Instructs one or more devices to start a task, such as unlocking or rebooting.
Request Syntax
POST /task HTTP/1.1
Content-type: application/json
{
"clientToken": "string
",
"command": { ... },
"description": "string
",
"tags": {
"string
" : "string
"
},
"targets": [ "string
" ]
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- clientToken
-
A token ensuring that the action is called only once with the specified details.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
^[!-~]+$
Required: No
- command
-
The task to be performed. Only one task is executed on a device at a time.
Type: Command object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: Yes
- description
-
A description of the task and its targets.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
^[A-Za-z0-9 _.,!#]*$
Required: No
-
Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
Type: String to string map
Required: No
- targets
-
A list of managed device IDs.
Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"taskArn": "string",
"taskId": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You don't have sufficient access to perform this action.
HTTP Status Code: 403
- InternalServerException
-
An unexpected error occurred while processing the request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The request references a resource that doesn't exist.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The request would cause a service quota to be exceeded.
HTTP Status Code: 402
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 429
- ValidationException
-
The input fails to satisfy the constraints specified by an AWS service.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: