submit_task_state_change
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.submit_task_state_change(
cluster='string',
task='string',
status='string',
reason='string',
containers=[
{
'containerName': 'string',
'imageDigest': 'string',
'runtimeId': 'string',
'exitCode': 123,
'networkBindings': [
{
'bindIP': 'string',
'containerPort': 123,
'hostPort': 123,
'protocol': 'tcp'|'udp',
'containerPortRange': 'string',
'hostPortRange': 'string'
},
],
'reason': 'string',
'status': 'string'
},
],
attachments=[
{
'attachmentArn': 'string',
'status': 'string'
},
],
managedAgents=[
{
'containerName': 'string',
'managedAgentName': 'ExecuteCommandAgent',
'status': 'string',
'reason': 'string'
},
],
pullStartedAt=datetime(2015, 1, 1),
pullStoppedAt=datetime(2015, 1, 1),
executionStoppedAt=datetime(2015, 1, 1)
)
Any containers that's associated with the state change request.
An object that represents a change in state for a container.
The name of the container.
The container image SHA 256 digest.
The ID of the Docker container.
The exit code for the container, if the state change is a result of the container exiting.
Any network bindings that are associated with the container.
Details on the network bindings between a container and its host container instance. After a task reaches the RUNNING
status, manual and automatic host and container port assignments are visible in the networkBindings
section of DescribeTasks API responses.
The IP address that the container is bound to on the container instance.
The port number on the container that's used with the network binding.
The port number on the host that's used with the network binding.
The protocol used for the network binding.
The port number range on the container that's bound to the dynamically mapped host port range.
The following rules apply when you specify a containerPortRange
:
bridge
network mode or the awsvpc
network mode.ecs-init
packagehostPortRange
. The value of the hostPortRange
is set as follows:awsvpc
network mode, the hostPort
is set to the same value as the containerPort
. This is a static mapping strategy.bridge
network mode, the Amazon ECS agent finds open host ports from the default ephemeral range and passes it to docker to bind them to the container ports.containerPortRange
valid values are between 1 and 65535.You can call DescribeTasks to view the hostPortRange
which are the host ports that are bound to the container ports.
The port number range on the host that's used with the network binding. This is assigned is assigned by Docker and delivered by the Amazon ECS agent.
The reason for the state change.
The status of the container.
Any attachments associated with the state change request.
An object representing a change in state for a task attachment.
The Amazon Resource Name (ARN) of the attachment.
The status of the attachment.
The details for the managed agent that's associated with the task.
An object representing a change in state for a managed agent.
The name of the container that's associated with the managed agent.
The name of the managed agent.
The status of the managed agent.
The reason for the status of the managed agent.
dict
Response Syntax
{
'acknowledgment': 'string'
}
Response Structure
(dict) --
acknowledgment (string) --
Acknowledgement of the state change.
Exceptions
ECS.Client.exceptions.ServerException
ECS.Client.exceptions.ClientException
ECS.Client.exceptions.AccessDeniedException
ECS.Client.exceptions.InvalidParameterException