SubmitTaskStateChange
Note
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a task changed states.
Request Syntax
{
"attachments": [
{
"attachmentArn": "string
",
"status": "string
"
}
],
"cluster": "string
",
"containers": [
{
"containerName": "string
",
"exitCode": number
,
"imageDigest": "string
",
"networkBindings": [
{
"bindIP": "string
",
"containerPort": number
,
"containerPortRange": "string
",
"hostPort": number
,
"hostPortRange": "string
",
"protocol": "string
"
}
],
"reason": "string
",
"runtimeId": "string
",
"status": "string
"
}
],
"executionStoppedAt": number
,
"managedAgents": [
{
"containerName": "string
",
"managedAgentName": "string
",
"reason": "string
",
"status": "string
"
}
],
"pullStartedAt": number
,
"pullStoppedAt": number
,
"reason": "string
",
"status": "string
",
"task": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- attachments
-
Any attachments associated with the state change request.
Type: Array of AttachmentStateChange objects
Required: No
- cluster
-
The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.
Type: String
Required: No
- containers
-
Any containers that's associated with the state change request.
Type: Array of ContainerStateChange objects
Required: No
- executionStoppedAt
-
The Unix timestamp for the time when the task execution stopped.
Type: Timestamp
Required: No
- managedAgents
-
The details for the managed agent that's associated with the task.
Type: Array of ManagedAgentStateChange objects
Required: No
- pullStartedAt
-
The Unix timestamp for the time when the container image pull started.
Type: Timestamp
Required: No
- pullStoppedAt
-
The Unix timestamp for the time when the container image pull completed.
Type: Timestamp
Required: No
- reason
-
The reason for the state change request.
Type: String
Required: No
- status
-
The status of the state change request.
Type: String
Required: No
- task
-
The task ID or full ARN of the task in the state change request.
Type: String
Required: No
Response Syntax
{
"acknowledgment": "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.
- acknowledgment
-
Acknowledgement of the state change.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You don't have authorization to perform the requested action.
HTTP Status Code: 400
- ClientException
-
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
The following list includes additional causes for the error:
-
The
RunTask
could not be processed because you use managed scaling and there is a capacity error because the quota of tasks in thePROVISIONING
per cluster has been reached. For information about the service quotas, see Amazon ECS service quotas.
HTTP Status Code: 400
-
- InvalidParameterException
-
The specified parameter isn't valid. Review the available parameters for the API request.
HTTP Status Code: 400
- ServerException
-
These errors are usually caused by a server issue.
HTTP Status Code: 500
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: