Class AmazonECSAsyncClient
- All Implemented Interfaces:
AmazonECS
,AmazonECSAsync
AsyncHandler
can be used to receive
notification when an asynchronous operation completes.
Amazon EC2 Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of EC2 instances. Amazon ECS lets you launch and stop container-enabled applications with simple API calls, allows you to get the state of your cluster from a centralized service, and gives you access to many familiar Amazon EC2 features like security groups, Amazon EBS volumes, and IAM roles.
You can use Amazon ECS to schedule the placement of containers across your cluster based on your resource needs, isolation policies, and availability requirements. Amazon EC2 Container Service eliminates the need for you to operate your own cluster management and configuration management systems or worry about scaling your management infrastructure.
-
Field Summary
Fields inherited from class com.amazonaws.services.ecs.AmazonECSClient
configFactory
Fields inherited from class com.amazonaws.AmazonWebServiceClient
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new asynchronous client to invoke service methods on Amazon ECS.AmazonECSAsyncClient
(AWSCredentials awsCredentials) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials.AmazonECSAsyncClient
(AWSCredentialsProvider awsCredentialsProvider) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider.AmazonECSAsyncClient
(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the provided AWS account credentials provider and client configuration options.AmazonECSAsyncClient
(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider, executor service, and client configuration options.AmazonECSAsyncClient
(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider and executor service.AmazonECSAsyncClient
(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials, executor service, and client configuration options.AmazonECSAsyncClient
(AWSCredentials awsCredentials, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials and executor service.AmazonECSAsyncClient
(ClientConfiguration clientConfiguration) Constructs a new asynchronous client to invoke service methods on Amazon ECS. -
Method Summary
Modifier and TypeMethodDescriptionSimplified method form for invoking the CreateCluster operation.createClusterAsync
(AsyncHandler<CreateClusterRequest, CreateClusterResult> asyncHandler) Simplified method form for invoking the CreateCluster operation with an AsyncHandler.createClusterAsync
(CreateClusterRequest request) Creates a new Amazon ECS cluster.createClusterAsync
(CreateClusterRequest request, AsyncHandler<CreateClusterRequest, CreateClusterResult> asyncHandler) Creates a new Amazon ECS cluster.createServiceAsync
(CreateServiceRequest request) Runs and maintains a desired number of tasks from a specified task definition.createServiceAsync
(CreateServiceRequest request, AsyncHandler<CreateServiceRequest, CreateServiceResult> asyncHandler) Runs and maintains a desired number of tasks from a specified task definition.deleteClusterAsync
(DeleteClusterRequest request) Deletes the specified cluster.deleteClusterAsync
(DeleteClusterRequest request, AsyncHandler<DeleteClusterRequest, DeleteClusterResult> asyncHandler) Deletes the specified cluster.deleteServiceAsync
(DeleteServiceRequest request) Deletes a specified service within a cluster.deleteServiceAsync
(DeleteServiceRequest request, AsyncHandler<DeleteServiceRequest, DeleteServiceResult> asyncHandler) Deletes a specified service within a cluster.Deregisters an Amazon ECS container instance from the specified cluster.deregisterContainerInstanceAsync
(DeregisterContainerInstanceRequest request, AsyncHandler<DeregisterContainerInstanceRequest, DeregisterContainerInstanceResult> asyncHandler) Deregisters an Amazon ECS container instance from the specified cluster.Deregisters the specified task definition by family and revision.deregisterTaskDefinitionAsync
(DeregisterTaskDefinitionRequest request, AsyncHandler<DeregisterTaskDefinitionRequest, DeregisterTaskDefinitionResult> asyncHandler) Deregisters the specified task definition by family and revision.Simplified method form for invoking the DescribeClusters operation.Simplified method form for invoking the DescribeClusters operation with an AsyncHandler.Describes one or more of your clusters.describeClustersAsync
(DescribeClustersRequest request, AsyncHandler<DescribeClustersRequest, DescribeClustersResult> asyncHandler) Describes one or more of your clusters.Describes Amazon EC2 Container Service container instances.describeContainerInstancesAsync
(DescribeContainerInstancesRequest request, AsyncHandler<DescribeContainerInstancesRequest, DescribeContainerInstancesResult> asyncHandler) Describes Amazon EC2 Container Service container instances.Describes the specified services running in your cluster.describeServicesAsync
(DescribeServicesRequest request, AsyncHandler<DescribeServicesRequest, DescribeServicesResult> asyncHandler) Describes the specified services running in your cluster.Describes a task definition.describeTaskDefinitionAsync
(DescribeTaskDefinitionRequest request, AsyncHandler<DescribeTaskDefinitionRequest, DescribeTaskDefinitionResult> asyncHandler) Describes a task definition.describeTasksAsync
(DescribeTasksRequest request) Describes a specified task or tasks.describeTasksAsync
(DescribeTasksRequest request, AsyncHandler<DescribeTasksRequest, DescribeTasksResult> asyncHandler) Describes a specified task or tasks.Simplified method form for invoking the DiscoverPollEndpoint operation.discoverPollEndpointAsync
(AsyncHandler<DiscoverPollEndpointRequest, DiscoverPollEndpointResult> asyncHandler) Simplified method form for invoking the DiscoverPollEndpoint operation with an AsyncHandler.discoverPollEndpointAsync
(DiscoverPollEndpointRequest request, AsyncHandler<DiscoverPollEndpointRequest, DiscoverPollEndpointResult> asyncHandler) Returns the executor service used by this client to execute async requests.Simplified method form for invoking the ListClusters operation.listClustersAsync
(AsyncHandler<ListClustersRequest, ListClustersResult> asyncHandler) Simplified method form for invoking the ListClusters operation with an AsyncHandler.listClustersAsync
(ListClustersRequest request) Returns a list of existing clusters.listClustersAsync
(ListClustersRequest request, AsyncHandler<ListClustersRequest, ListClustersResult> asyncHandler) Returns a list of existing clusters.Simplified method form for invoking the ListContainerInstances operation.listContainerInstancesAsync
(AsyncHandler<ListContainerInstancesRequest, ListContainerInstancesResult> asyncHandler) Simplified method form for invoking the ListContainerInstances operation with an AsyncHandler.Returns a list of container instances in a specified cluster.listContainerInstancesAsync
(ListContainerInstancesRequest request, AsyncHandler<ListContainerInstancesRequest, ListContainerInstancesResult> asyncHandler) Returns a list of container instances in a specified cluster.Simplified method form for invoking the ListServices operation.listServicesAsync
(AsyncHandler<ListServicesRequest, ListServicesResult> asyncHandler) Simplified method form for invoking the ListServices operation with an AsyncHandler.listServicesAsync
(ListServicesRequest request) Lists the services that are running in a specified cluster.listServicesAsync
(ListServicesRequest request, AsyncHandler<ListServicesRequest, ListServicesResult> asyncHandler) Lists the services that are running in a specified cluster.Simplified method form for invoking the ListTaskDefinitionFamilies operation.listTaskDefinitionFamiliesAsync
(AsyncHandler<ListTaskDefinitionFamiliesRequest, ListTaskDefinitionFamiliesResult> asyncHandler) Simplified method form for invoking the ListTaskDefinitionFamilies operation with an AsyncHandler.Returns a list of task definition families that are registered to your account (which may include task definition families that no longer have anyACTIVE
task definition revisions).listTaskDefinitionFamiliesAsync
(ListTaskDefinitionFamiliesRequest request, AsyncHandler<ListTaskDefinitionFamiliesRequest, ListTaskDefinitionFamiliesResult> asyncHandler) Returns a list of task definition families that are registered to your account (which may include task definition families that no longer have anyACTIVE
task definition revisions).Simplified method form for invoking the ListTaskDefinitions operation.listTaskDefinitionsAsync
(AsyncHandler<ListTaskDefinitionsRequest, ListTaskDefinitionsResult> asyncHandler) Simplified method form for invoking the ListTaskDefinitions operation with an AsyncHandler.Returns a list of task definitions that are registered to your account.listTaskDefinitionsAsync
(ListTaskDefinitionsRequest request, AsyncHandler<ListTaskDefinitionsRequest, ListTaskDefinitionsResult> asyncHandler) Returns a list of task definitions that are registered to your account.Simplified method form for invoking the ListTasks operation.listTasksAsync
(AsyncHandler<ListTasksRequest, ListTasksResult> asyncHandler) Simplified method form for invoking the ListTasks operation with an AsyncHandler.listTasksAsync
(ListTasksRequest request) Returns a list of tasks for a specified cluster.listTasksAsync
(ListTasksRequest request, AsyncHandler<ListTasksRequest, ListTasksResult> asyncHandler) Returns a list of tasks for a specified cluster.registerContainerInstanceAsync
(RegisterContainerInstanceRequest request, AsyncHandler<RegisterContainerInstanceRequest, RegisterContainerInstanceResult> asyncHandler) Registers a new task definition from the suppliedfamily
andcontainerDefinitions
.registerTaskDefinitionAsync
(RegisterTaskDefinitionRequest request, AsyncHandler<RegisterTaskDefinitionRequest, RegisterTaskDefinitionResult> asyncHandler) Registers a new task definition from the suppliedfamily
andcontainerDefinitions
.runTaskAsync
(RunTaskRequest request) Start a task using random placement and the default Amazon ECS scheduler.runTaskAsync
(RunTaskRequest request, AsyncHandler<RunTaskRequest, RunTaskResult> asyncHandler) Start a task using random placement and the default Amazon ECS scheduler.void
shutdown()
Shuts down the client, releasing all managed resources.startTaskAsync
(StartTaskRequest request) Starts a new task from the specified task definition on the specified container instance or instances.startTaskAsync
(StartTaskRequest request, AsyncHandler<StartTaskRequest, StartTaskResult> asyncHandler) Starts a new task from the specified task definition on the specified container instance or instances.stopTaskAsync
(StopTaskRequest request) Stops a running task.stopTaskAsync
(StopTaskRequest request, AsyncHandler<StopTaskRequest, StopTaskResult> asyncHandler) Stops a running task.Simplified method form for invoking the SubmitContainerStateChange operation.submitContainerStateChangeAsync
(AsyncHandler<SubmitContainerStateChangeRequest, SubmitContainerStateChangeResult> asyncHandler) Simplified method form for invoking the SubmitContainerStateChange operation with an AsyncHandler.submitContainerStateChangeAsync
(SubmitContainerStateChangeRequest request, AsyncHandler<SubmitContainerStateChangeRequest, SubmitContainerStateChangeResult> asyncHandler) submitTaskStateChangeAsync
(SubmitTaskStateChangeRequest request, AsyncHandler<SubmitTaskStateChangeRequest, SubmitTaskStateChangeResult> asyncHandler) Updates the Amazon ECS container agent on a specified container instance.updateContainerAgentAsync
(UpdateContainerAgentRequest request, AsyncHandler<UpdateContainerAgentRequest, UpdateContainerAgentResult> asyncHandler) Updates the Amazon ECS container agent on a specified container instance.updateServiceAsync
(UpdateServiceRequest request) Modifies the desired count, deployment configuration, or task definition used in a service.updateServiceAsync
(UpdateServiceRequest request, AsyncHandler<UpdateServiceRequest, UpdateServiceResult> asyncHandler) Modifies the desired count, deployment configuration, or task definition used in a service.Methods inherited from class com.amazonaws.services.ecs.AmazonECSClient
createCluster, createCluster, createService, deleteCluster, deleteService, deregisterContainerInstance, deregisterTaskDefinition, describeClusters, describeClusters, describeContainerInstances, describeServices, describeTaskDefinition, describeTasks, discoverPollEndpoint, discoverPollEndpoint, getCachedResponseMetadata, listClusters, listClusters, listContainerInstances, listContainerInstances, listServices, listServices, listTaskDefinitionFamilies, listTaskDefinitionFamilies, listTaskDefinitions, listTaskDefinitions, listTasks, listTasks, registerContainerInstance, registerTaskDefinition, runTask, startTask, stopTask, submitContainerStateChange, submitContainerStateChange, submitTaskStateChange, updateContainerAgent, updateService
Methods inherited from class com.amazonaws.AmazonWebServiceClient
addRequestHandler, addRequestHandler, beforeMarshalling, configureRegion, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getEndpointPrefix, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setEndpoint, setEndpointPrefix, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.amazonaws.services.ecs.AmazonECS
createCluster, createCluster, createService, deleteCluster, deleteService, deregisterContainerInstance, deregisterTaskDefinition, describeClusters, describeClusters, describeContainerInstances, describeServices, describeTaskDefinition, describeTasks, discoverPollEndpoint, discoverPollEndpoint, getCachedResponseMetadata, listClusters, listClusters, listContainerInstances, listContainerInstances, listServices, listServices, listTaskDefinitionFamilies, listTaskDefinitionFamilies, listTaskDefinitions, listTaskDefinitions, listTasks, listTasks, registerContainerInstance, registerTaskDefinition, runTask, setEndpoint, setRegion, startTask, stopTask, submitContainerStateChange, submitContainerStateChange, submitTaskStateChange, updateContainerAgent, updateService
-
Constructor Details
-
AmazonECSAsyncClient
public AmazonECSAsyncClient()Constructs a new asynchronous client to invoke service methods on Amazon ECS. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
- Instance profile credentials delivered through the Amazon EC2 metadata service
Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default maximum number of concurrent connections to the service).
- See Also:
-
AmazonECSAsyncClient
Constructs a new asynchronous client to invoke service methods on Amazon ECS. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
- Instance profile credentials delivered through the Amazon EC2 metadata service
Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the maximum number of concurrent connections configured via
ClientConfiguration.getMaxConnections()
.- Parameters:
clientConfiguration
- The client configuration options controlling how this client connects to Amazon ECS (ex: proxy settings, retry counts, etc).- See Also:
-
AmazonECSAsyncClient
Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials.Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default maximum number of concurrent connections to the service).
- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.- See Also:
-
AmazonECSAsyncClient
Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials and executor service. Default client settings will be used.- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.executorService
- The executor service by which all asynchronous requests will be executed.
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials, executor service, and client configuration options.- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- Client configuration options (ex: max retry limit, proxy settings, etc).executorService
- The executor service by which all asynchronous requests will be executed.
-
AmazonECSAsyncClient
Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider. Default client settings will be used.Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default maximum number of concurrent connections to the service).
- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.- See Also:
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the provided AWS account credentials provider and client configuration options.Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the maximum number of concurrent connections configured via
ClientConfiguration.getMaxConnections()
.- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- Client configuration options (ex: max retry limit, proxy settings, etc).- See Also:
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider and executor service. Default client settings will be used.- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.executorService
- The executor service by which all asynchronous requests will be executed.
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) Constructs a new asynchronous client to invoke service methods on Amazon ECS using the specified AWS account credentials provider, executor service, and client configuration options.- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- Client configuration options (ex: max retry limit, proxy settings, etc).executorService
- The executor service by which all asynchronous requests will be executed.
-
-
Method Details
-
getExecutorService
Returns the executor service used by this client to execute async requests.- Returns:
- The executor service used by this client to execute async requests.
-
createClusterAsync
Description copied from interface:AmazonECSAsync
Creates a new Amazon ECS cluster. By default, your account receives a
default
cluster when you launch your first container instance. However, you can create your own cluster with a unique name with theCreateCluster
action.- Specified by:
createClusterAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the CreateCluster operation returned by the service.
-
createClusterAsync
public Future<CreateClusterResult> createClusterAsync(CreateClusterRequest request, AsyncHandler<CreateClusterRequest, CreateClusterResult> asyncHandler) Description copied from interface:AmazonECSAsync
Creates a new Amazon ECS cluster. By default, your account receives a
default
cluster when you launch your first container instance. However, you can create your own cluster with a unique name with theCreateCluster
action.- Specified by:
createClusterAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the CreateCluster operation returned by the service.
-
createClusterAsync
Simplified method form for invoking the CreateCluster operation.- Specified by:
createClusterAsync
in interfaceAmazonECSAsync
- See Also:
-
createClusterAsync
public Future<CreateClusterResult> createClusterAsync(AsyncHandler<CreateClusterRequest, CreateClusterResult> asyncHandler) Simplified method form for invoking the CreateCluster operation with an AsyncHandler.- Specified by:
createClusterAsync
in interfaceAmazonECSAsync
- See Also:
-
createServiceAsync
Description copied from interface:AmazonECSAsync
Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below
desiredCount
, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService.In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind a load balancer. The load balancer distributes traffic across the tasks that are associated with the service.
You can optionally specify a deployment configuration for your service. During a deployment (which is triggered by changing the task definition of a service with an UpdateService operation), the service scheduler uses the
minimumHealthyPercent
andmaximumPercent
parameters to determine the deployment strategy.If the
minimumHealthyPercent
is below 100%, the scheduler can ignore thedesiredCount
temporarily during a deployment. For example, if your service has adesiredCount
of four tasks, aminimumHealthyPercent
of 50% allows the scheduler to stop two existing tasks before starting two new tasks. Tasks for services that do not use a load balancer are considered healthy if they are in theRUNNING
state; tasks for services that do use a load balancer are considered healthy if they are in theRUNNING
state and the container instance it is hosted on is reported as healthy by the load balancer. The default value forminimumHealthyPercent
is 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs.The
maximumPercent
parameter represents an upper limit on the number of running tasks during a deployment, which enables you to define the deployment batch size. For example, if your service has adesiredCount
of four tasks, amaximumPercent
value of 200% starts four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default value formaximumPercent
is 200%.When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
-
Determine which of the container instances in your cluster can support your service's task definition (for example, they have the required CPU, memory, ports, and container instance attributes).
-
Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement.
-
Place the new service task on a valid container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.
- Specified by:
createServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the CreateService operation returned by the service.
-
-
createServiceAsync
public Future<CreateServiceResult> createServiceAsync(CreateServiceRequest request, AsyncHandler<CreateServiceRequest, CreateServiceResult> asyncHandler) Description copied from interface:AmazonECSAsync
Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below
desiredCount
, Amazon ECS spawns another instantiation of the task in the specified cluster. To update an existing service, see UpdateService.In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind a load balancer. The load balancer distributes traffic across the tasks that are associated with the service.
You can optionally specify a deployment configuration for your service. During a deployment (which is triggered by changing the task definition of a service with an UpdateService operation), the service scheduler uses the
minimumHealthyPercent
andmaximumPercent
parameters to determine the deployment strategy.If the
minimumHealthyPercent
is below 100%, the scheduler can ignore thedesiredCount
temporarily during a deployment. For example, if your service has adesiredCount
of four tasks, aminimumHealthyPercent
of 50% allows the scheduler to stop two existing tasks before starting two new tasks. Tasks for services that do not use a load balancer are considered healthy if they are in theRUNNING
state; tasks for services that do use a load balancer are considered healthy if they are in theRUNNING
state and the container instance it is hosted on is reported as healthy by the load balancer. The default value forminimumHealthyPercent
is 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs.The
maximumPercent
parameter represents an upper limit on the number of running tasks during a deployment, which enables you to define the deployment batch size. For example, if your service has adesiredCount
of four tasks, amaximumPercent
value of 200% starts four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default value formaximumPercent
is 200%.When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
-
Determine which of the container instances in your cluster can support your service's task definition (for example, they have the required CPU, memory, ports, and container instance attributes).
-
Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement.
-
Place the new service task on a valid container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.
- Specified by:
createServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the CreateService operation returned by the service.
-
-
deleteClusterAsync
Description copied from interface:AmazonECSAsync
Deletes the specified cluster. You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance.
- Specified by:
deleteClusterAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DeleteCluster operation returned by the service.
-
deleteClusterAsync
public Future<DeleteClusterResult> deleteClusterAsync(DeleteClusterRequest request, AsyncHandler<DeleteClusterRequest, DeleteClusterResult> asyncHandler) Description copied from interface:AmazonECSAsync
Deletes the specified cluster. You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance.
- Specified by:
deleteClusterAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DeleteCluster operation returned by the service.
-
deleteServiceAsync
Description copied from interface:AmazonECSAsync
Deletes a specified service within a cluster. You can delete a service if you have no running tasks in it and the desired task count is zero. If the service is actively maintaining tasks, you cannot delete it, and you must update the service to a desired task count of zero. For more information, see UpdateService.
When you delete a service, if there are still running tasks that require cleanup, the service status moves from
ACTIVE
toDRAINING
, and the service is no longer visible in the console or in ListServices API operations. After the tasks have stopped, then the service status moves fromDRAINING
toINACTIVE
. Services in theDRAINING
orINACTIVE
status can still be viewed with DescribeServices API operations; however, in the future,INACTIVE
services may be cleaned up and purged from Amazon ECS record keeping, and DescribeServices API operations on those services will return aServiceNotFoundException
error.- Specified by:
deleteServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DeleteService operation returned by the service.
-
deleteServiceAsync
public Future<DeleteServiceResult> deleteServiceAsync(DeleteServiceRequest request, AsyncHandler<DeleteServiceRequest, DeleteServiceResult> asyncHandler) Description copied from interface:AmazonECSAsync
Deletes a specified service within a cluster. You can delete a service if you have no running tasks in it and the desired task count is zero. If the service is actively maintaining tasks, you cannot delete it, and you must update the service to a desired task count of zero. For more information, see UpdateService.
When you delete a service, if there are still running tasks that require cleanup, the service status moves from
ACTIVE
toDRAINING
, and the service is no longer visible in the console or in ListServices API operations. After the tasks have stopped, then the service status moves fromDRAINING
toINACTIVE
. Services in theDRAINING
orINACTIVE
status can still be viewed with DescribeServices API operations; however, in the future,INACTIVE
services may be cleaned up and purged from Amazon ECS record keeping, and DescribeServices API operations on those services will return aServiceNotFoundException
error.- Specified by:
deleteServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DeleteService operation returned by the service.
-
deregisterContainerInstanceAsync
public Future<DeregisterContainerInstanceResult> deregisterContainerInstanceAsync(DeregisterContainerInstanceRequest request) Description copied from interface:AmazonECSAsync
Deregisters an Amazon ECS container instance from the specified cluster. This instance is no longer available to run tasks.
If you intend to use the container instance for some other purpose after deregistration, you should stop all of the tasks running on the container instance before deregistration to avoid any orphaned tasks from consuming resources.
Deregistering a container instance removes the instance from a cluster, but it does not terminate the EC2 instance; if you are finished using the instance, be sure to terminate it in the Amazon EC2 console to stop billing.
If you terminate a running container instance with a connected Amazon ECS container agent, the agent automatically deregisters the instance from your cluster (stopped container instances or instances with disconnected agents are not automatically deregistered when terminated).
- Specified by:
deregisterContainerInstanceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DeregisterContainerInstance operation returned by the service.
-
deregisterContainerInstanceAsync
public Future<DeregisterContainerInstanceResult> deregisterContainerInstanceAsync(DeregisterContainerInstanceRequest request, AsyncHandler<DeregisterContainerInstanceRequest, DeregisterContainerInstanceResult> asyncHandler) Description copied from interface:AmazonECSAsync
Deregisters an Amazon ECS container instance from the specified cluster. This instance is no longer available to run tasks.
If you intend to use the container instance for some other purpose after deregistration, you should stop all of the tasks running on the container instance before deregistration to avoid any orphaned tasks from consuming resources.
Deregistering a container instance removes the instance from a cluster, but it does not terminate the EC2 instance; if you are finished using the instance, be sure to terminate it in the Amazon EC2 console to stop billing.
If you terminate a running container instance with a connected Amazon ECS container agent, the agent automatically deregisters the instance from your cluster (stopped container instances or instances with disconnected agents are not automatically deregistered when terminated).
- Specified by:
deregisterContainerInstanceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DeregisterContainerInstance operation returned by the service.
-
deregisterTaskDefinitionAsync
public Future<DeregisterTaskDefinitionResult> deregisterTaskDefinitionAsync(DeregisterTaskDefinitionRequest request) Description copied from interface:AmazonECSAsync
Deregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as
INACTIVE
. Existing tasks and services that reference anINACTIVE
task definition continue to run without disruption. Existing services that reference anINACTIVE
task definition can still scale up or down by modifying the service's desired count.You cannot use an
INACTIVE
task definition to run new tasks or create new services, and you cannot update an existing service to reference anINACTIVE
task definition (although there may be up to a 10 minute window following deregistration where these restrictions have not yet taken effect).- Specified by:
deregisterTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DeregisterTaskDefinition operation returned by the service.
-
deregisterTaskDefinitionAsync
public Future<DeregisterTaskDefinitionResult> deregisterTaskDefinitionAsync(DeregisterTaskDefinitionRequest request, AsyncHandler<DeregisterTaskDefinitionRequest, DeregisterTaskDefinitionResult> asyncHandler) Description copied from interface:AmazonECSAsync
Deregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as
INACTIVE
. Existing tasks and services that reference anINACTIVE
task definition continue to run without disruption. Existing services that reference anINACTIVE
task definition can still scale up or down by modifying the service's desired count.You cannot use an
INACTIVE
task definition to run new tasks or create new services, and you cannot update an existing service to reference anINACTIVE
task definition (although there may be up to a 10 minute window following deregistration where these restrictions have not yet taken effect).- Specified by:
deregisterTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DeregisterTaskDefinition operation returned by the service.
-
describeClustersAsync
Description copied from interface:AmazonECSAsync
Describes one or more of your clusters.
- Specified by:
describeClustersAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DescribeClusters operation returned by the service.
-
describeClustersAsync
public Future<DescribeClustersResult> describeClustersAsync(DescribeClustersRequest request, AsyncHandler<DescribeClustersRequest, DescribeClustersResult> asyncHandler) Description copied from interface:AmazonECSAsync
Describes one or more of your clusters.
- Specified by:
describeClustersAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DescribeClusters operation returned by the service.
-
describeClustersAsync
Simplified method form for invoking the DescribeClusters operation.- Specified by:
describeClustersAsync
in interfaceAmazonECSAsync
- See Also:
-
describeClustersAsync
public Future<DescribeClustersResult> describeClustersAsync(AsyncHandler<DescribeClustersRequest, DescribeClustersResult> asyncHandler) Simplified method form for invoking the DescribeClusters operation with an AsyncHandler.- Specified by:
describeClustersAsync
in interfaceAmazonECSAsync
- See Also:
-
describeContainerInstancesAsync
public Future<DescribeContainerInstancesResult> describeContainerInstancesAsync(DescribeContainerInstancesRequest request) Description copied from interface:AmazonECSAsync
Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
- Specified by:
describeContainerInstancesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DescribeContainerInstances operation returned by the service.
-
describeContainerInstancesAsync
public Future<DescribeContainerInstancesResult> describeContainerInstancesAsync(DescribeContainerInstancesRequest request, AsyncHandler<DescribeContainerInstancesRequest, DescribeContainerInstancesResult> asyncHandler) Description copied from interface:AmazonECSAsync
Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
- Specified by:
describeContainerInstancesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DescribeContainerInstances operation returned by the service.
-
describeServicesAsync
Description copied from interface:AmazonECSAsync
Describes the specified services running in your cluster.
- Specified by:
describeServicesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DescribeServices operation returned by the service.
-
describeServicesAsync
public Future<DescribeServicesResult> describeServicesAsync(DescribeServicesRequest request, AsyncHandler<DescribeServicesRequest, DescribeServicesResult> asyncHandler) Description copied from interface:AmazonECSAsync
Describes the specified services running in your cluster.
- Specified by:
describeServicesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DescribeServices operation returned by the service.
-
describeTaskDefinitionAsync
public Future<DescribeTaskDefinitionResult> describeTaskDefinitionAsync(DescribeTaskDefinitionRequest request) Description copied from interface:AmazonECSAsync
Describes a task definition. You can specify a
family
andrevision
to find information about a specific task definition, or you can simply specify the family to find the latestACTIVE
revision in that family.You can only describe
INACTIVE
task definitions while an active task or service references them.- Specified by:
describeTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DescribeTaskDefinition operation returned by the service.
-
describeTaskDefinitionAsync
public Future<DescribeTaskDefinitionResult> describeTaskDefinitionAsync(DescribeTaskDefinitionRequest request, AsyncHandler<DescribeTaskDefinitionRequest, DescribeTaskDefinitionResult> asyncHandler) Description copied from interface:AmazonECSAsync
Describes a task definition. You can specify a
family
andrevision
to find information about a specific task definition, or you can simply specify the family to find the latestACTIVE
revision in that family.You can only describe
INACTIVE
task definitions while an active task or service references them.- Specified by:
describeTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DescribeTaskDefinition operation returned by the service.
-
describeTasksAsync
Description copied from interface:AmazonECSAsync
Describes a specified task or tasks.
- Specified by:
describeTasksAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DescribeTasks operation returned by the service.
-
describeTasksAsync
public Future<DescribeTasksResult> describeTasksAsync(DescribeTasksRequest request, AsyncHandler<DescribeTasksRequest, DescribeTasksResult> asyncHandler) Description copied from interface:AmazonECSAsync
Describes a specified task or tasks.
- Specified by:
describeTasksAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DescribeTasks operation returned by the service.
-
discoverPollEndpointAsync
public Future<DiscoverPollEndpointResult> discoverPollEndpointAsync(DiscoverPollEndpointRequest request) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Returns an endpoint for the Amazon EC2 Container Service agent to poll for updates.
- Specified by:
discoverPollEndpointAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the DiscoverPollEndpoint operation returned by the service.
-
discoverPollEndpointAsync
public Future<DiscoverPollEndpointResult> discoverPollEndpointAsync(DiscoverPollEndpointRequest request, AsyncHandler<DiscoverPollEndpointRequest, DiscoverPollEndpointResult> asyncHandler) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Returns an endpoint for the Amazon EC2 Container Service agent to poll for updates.
- Specified by:
discoverPollEndpointAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the DiscoverPollEndpoint operation returned by the service.
-
discoverPollEndpointAsync
Simplified method form for invoking the DiscoverPollEndpoint operation.- Specified by:
discoverPollEndpointAsync
in interfaceAmazonECSAsync
- See Also:
-
discoverPollEndpointAsync
public Future<DiscoverPollEndpointResult> discoverPollEndpointAsync(AsyncHandler<DiscoverPollEndpointRequest, DiscoverPollEndpointResult> asyncHandler) Simplified method form for invoking the DiscoverPollEndpoint operation with an AsyncHandler.- Specified by:
discoverPollEndpointAsync
in interfaceAmazonECSAsync
- See Also:
-
listClustersAsync
Description copied from interface:AmazonECSAsync
Returns a list of existing clusters.
- Specified by:
listClustersAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListClusters operation returned by the service.
-
listClustersAsync
public Future<ListClustersResult> listClustersAsync(ListClustersRequest request, AsyncHandler<ListClustersRequest, ListClustersResult> asyncHandler) Description copied from interface:AmazonECSAsync
Returns a list of existing clusters.
- Specified by:
listClustersAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListClusters operation returned by the service.
-
listClustersAsync
Simplified method form for invoking the ListClusters operation.- Specified by:
listClustersAsync
in interfaceAmazonECSAsync
- See Also:
-
listClustersAsync
public Future<ListClustersResult> listClustersAsync(AsyncHandler<ListClustersRequest, ListClustersResult> asyncHandler) Simplified method form for invoking the ListClusters operation with an AsyncHandler.- Specified by:
listClustersAsync
in interfaceAmazonECSAsync
- See Also:
-
listContainerInstancesAsync
public Future<ListContainerInstancesResult> listContainerInstancesAsync(ListContainerInstancesRequest request) Description copied from interface:AmazonECSAsync
Returns a list of container instances in a specified cluster.
- Specified by:
listContainerInstancesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListContainerInstances operation returned by the service.
-
listContainerInstancesAsync
public Future<ListContainerInstancesResult> listContainerInstancesAsync(ListContainerInstancesRequest request, AsyncHandler<ListContainerInstancesRequest, ListContainerInstancesResult> asyncHandler) Description copied from interface:AmazonECSAsync
Returns a list of container instances in a specified cluster.
- Specified by:
listContainerInstancesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListContainerInstances operation returned by the service.
-
listContainerInstancesAsync
Simplified method form for invoking the ListContainerInstances operation.- Specified by:
listContainerInstancesAsync
in interfaceAmazonECSAsync
- See Also:
-
listContainerInstancesAsync
public Future<ListContainerInstancesResult> listContainerInstancesAsync(AsyncHandler<ListContainerInstancesRequest, ListContainerInstancesResult> asyncHandler) Simplified method form for invoking the ListContainerInstances operation with an AsyncHandler.- Specified by:
listContainerInstancesAsync
in interfaceAmazonECSAsync
- See Also:
-
listServicesAsync
Description copied from interface:AmazonECSAsync
Lists the services that are running in a specified cluster.
- Specified by:
listServicesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListServices operation returned by the service.
-
listServicesAsync
public Future<ListServicesResult> listServicesAsync(ListServicesRequest request, AsyncHandler<ListServicesRequest, ListServicesResult> asyncHandler) Description copied from interface:AmazonECSAsync
Lists the services that are running in a specified cluster.
- Specified by:
listServicesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListServices operation returned by the service.
-
listServicesAsync
Simplified method form for invoking the ListServices operation.- Specified by:
listServicesAsync
in interfaceAmazonECSAsync
- See Also:
-
listServicesAsync
public Future<ListServicesResult> listServicesAsync(AsyncHandler<ListServicesRequest, ListServicesResult> asyncHandler) Simplified method form for invoking the ListServices operation with an AsyncHandler.- Specified by:
listServicesAsync
in interfaceAmazonECSAsync
- See Also:
-
listTaskDefinitionFamiliesAsync
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest request) Description copied from interface:AmazonECSAsync
Returns a list of task definition families that are registered to your account (which may include task definition families that no longer have any
ACTIVE
task definition revisions).You can filter out task definition families that do not contain any
ACTIVE
task definition revisions by setting thestatus
parameter toACTIVE
. You can also filter the results with thefamilyPrefix
parameter.- Specified by:
listTaskDefinitionFamiliesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListTaskDefinitionFamilies operation returned by the service.
-
listTaskDefinitionFamiliesAsync
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest request, AsyncHandler<ListTaskDefinitionFamiliesRequest, ListTaskDefinitionFamiliesResult> asyncHandler) Description copied from interface:AmazonECSAsync
Returns a list of task definition families that are registered to your account (which may include task definition families that no longer have any
ACTIVE
task definition revisions).You can filter out task definition families that do not contain any
ACTIVE
task definition revisions by setting thestatus
parameter toACTIVE
. You can also filter the results with thefamilyPrefix
parameter.- Specified by:
listTaskDefinitionFamiliesAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListTaskDefinitionFamilies operation returned by the service.
-
listTaskDefinitionFamiliesAsync
Simplified method form for invoking the ListTaskDefinitionFamilies operation.- Specified by:
listTaskDefinitionFamiliesAsync
in interfaceAmazonECSAsync
- See Also:
-
listTaskDefinitionFamiliesAsync
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync(AsyncHandler<ListTaskDefinitionFamiliesRequest, ListTaskDefinitionFamiliesResult> asyncHandler) Simplified method form for invoking the ListTaskDefinitionFamilies operation with an AsyncHandler.- Specified by:
listTaskDefinitionFamiliesAsync
in interfaceAmazonECSAsync
- See Also:
-
listTaskDefinitionsAsync
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(ListTaskDefinitionsRequest request) Description copied from interface:AmazonECSAsync
Returns a list of task definitions that are registered to your account. You can filter the results by family name with the
familyPrefix
parameter or by status with thestatus
parameter.- Specified by:
listTaskDefinitionsAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListTaskDefinitions operation returned by the service.
-
listTaskDefinitionsAsync
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(ListTaskDefinitionsRequest request, AsyncHandler<ListTaskDefinitionsRequest, ListTaskDefinitionsResult> asyncHandler) Description copied from interface:AmazonECSAsync
Returns a list of task definitions that are registered to your account. You can filter the results by family name with the
familyPrefix
parameter or by status with thestatus
parameter.- Specified by:
listTaskDefinitionsAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListTaskDefinitions operation returned by the service.
-
listTaskDefinitionsAsync
Simplified method form for invoking the ListTaskDefinitions operation.- Specified by:
listTaskDefinitionsAsync
in interfaceAmazonECSAsync
- See Also:
-
listTaskDefinitionsAsync
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(AsyncHandler<ListTaskDefinitionsRequest, ListTaskDefinitionsResult> asyncHandler) Simplified method form for invoking the ListTaskDefinitions operation with an AsyncHandler.- Specified by:
listTaskDefinitionsAsync
in interfaceAmazonECSAsync
- See Also:
-
listTasksAsync
Description copied from interface:AmazonECSAsync
Returns a list of tasks for a specified cluster. You can filter the results by family name, by a particular container instance, or by the desired status of the task with the
family
,containerInstance
, anddesiredStatus
parameters.- Specified by:
listTasksAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the ListTasks operation returned by the service.
-
listTasksAsync
public Future<ListTasksResult> listTasksAsync(ListTasksRequest request, AsyncHandler<ListTasksRequest, ListTasksResult> asyncHandler) Description copied from interface:AmazonECSAsync
Returns a list of tasks for a specified cluster. You can filter the results by family name, by a particular container instance, or by the desired status of the task with the
family
,containerInstance
, anddesiredStatus
parameters.- Specified by:
listTasksAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the ListTasks operation returned by the service.
-
listTasksAsync
Simplified method form for invoking the ListTasks operation.- Specified by:
listTasksAsync
in interfaceAmazonECSAsync
- See Also:
-
listTasksAsync
public Future<ListTasksResult> listTasksAsync(AsyncHandler<ListTasksRequest, ListTasksResult> asyncHandler) Simplified method form for invoking the ListTasks operation with an AsyncHandler.- Specified by:
listTasksAsync
in interfaceAmazonECSAsync
- See Also:
-
registerContainerInstanceAsync
public Future<RegisterContainerInstanceResult> registerContainerInstanceAsync(RegisterContainerInstanceRequest request) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.
- Specified by:
registerContainerInstanceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the RegisterContainerInstance operation returned by the service.
-
registerContainerInstanceAsync
public Future<RegisterContainerInstanceResult> registerContainerInstanceAsync(RegisterContainerInstanceRequest request, AsyncHandler<RegisterContainerInstanceRequest, RegisterContainerInstanceResult> asyncHandler) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.
- Specified by:
registerContainerInstanceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the RegisterContainerInstance operation returned by the service.
-
registerTaskDefinitionAsync
public Future<RegisterTaskDefinitionResult> registerTaskDefinitionAsync(RegisterTaskDefinitionRequest request) Description copied from interface:AmazonECSAsync
Registers a new task definition from the supplied
family
andcontainerDefinitions
. Optionally, you can add data volumes to your containers with thevolumes
parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.- Specified by:
registerTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the RegisterTaskDefinition operation returned by the service.
-
registerTaskDefinitionAsync
public Future<RegisterTaskDefinitionResult> registerTaskDefinitionAsync(RegisterTaskDefinitionRequest request, AsyncHandler<RegisterTaskDefinitionRequest, RegisterTaskDefinitionResult> asyncHandler) Description copied from interface:AmazonECSAsync
Registers a new task definition from the supplied
family
andcontainerDefinitions
. Optionally, you can add data volumes to your containers with thevolumes
parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.- Specified by:
registerTaskDefinitionAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the RegisterTaskDefinition operation returned by the service.
-
runTaskAsync
Description copied from interface:AmazonECSAsync
Start a task using random placement and the default Amazon ECS scheduler. To use your own scheduler or place a task on a specific container instance, use
StartTask
instead.The
count
parameter is limited to 10 tasks per call.- Specified by:
runTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the RunTask operation returned by the service.
-
runTaskAsync
public Future<RunTaskResult> runTaskAsync(RunTaskRequest request, AsyncHandler<RunTaskRequest, RunTaskResult> asyncHandler) Description copied from interface:AmazonECSAsync
Start a task using random placement and the default Amazon ECS scheduler. To use your own scheduler or place a task on a specific container instance, use
StartTask
instead.The
count
parameter is limited to 10 tasks per call.- Specified by:
runTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the RunTask operation returned by the service.
-
startTaskAsync
Description copied from interface:AmazonECSAsync
Starts a new task from the specified task definition on the specified container instance or instances. To use the default Amazon ECS scheduler to place your task, use
RunTask
instead.The list of container instances to start tasks on is limited to 10.
- Specified by:
startTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the StartTask operation returned by the service.
-
startTaskAsync
public Future<StartTaskResult> startTaskAsync(StartTaskRequest request, AsyncHandler<StartTaskRequest, StartTaskResult> asyncHandler) Description copied from interface:AmazonECSAsync
Starts a new task from the specified task definition on the specified container instance or instances. To use the default Amazon ECS scheduler to place your task, use
RunTask
instead.The list of container instances to start tasks on is limited to 10.
- Specified by:
startTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the StartTask operation returned by the service.
-
stopTaskAsync
Description copied from interface:AmazonECSAsync
Stops a running task.
When StopTask is called on a task, the equivalent of
docker stop
is issued to the containers running in the task. This results in aSIGTERM
and a 30-second timeout, after whichSIGKILL
is sent and the containers are forcibly stopped. If the container handles theSIGTERM
gracefully and exits within 30 seconds from receiving it, noSIGKILL
is sent.- Specified by:
stopTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the StopTask operation returned by the service.
-
stopTaskAsync
public Future<StopTaskResult> stopTaskAsync(StopTaskRequest request, AsyncHandler<StopTaskRequest, StopTaskResult> asyncHandler) Description copied from interface:AmazonECSAsync
Stops a running task.
When StopTask is called on a task, the equivalent of
docker stop
is issued to the containers running in the task. This results in aSIGTERM
and a 30-second timeout, after whichSIGKILL
is sent and the containers are forcibly stopped. If the container handles theSIGTERM
gracefully and exits within 30 seconds from receiving it, noSIGKILL
is sent.- Specified by:
stopTaskAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the StopTask operation returned by the service.
-
submitContainerStateChangeAsync
public Future<SubmitContainerStateChangeResult> submitContainerStateChangeAsync(SubmitContainerStateChangeRequest request) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a container changed states.
- Specified by:
submitContainerStateChangeAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the SubmitContainerStateChange operation returned by the service.
-
submitContainerStateChangeAsync
public Future<SubmitContainerStateChangeResult> submitContainerStateChangeAsync(SubmitContainerStateChangeRequest request, AsyncHandler<SubmitContainerStateChangeRequest, SubmitContainerStateChangeResult> asyncHandler) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a container changed states.
- Specified by:
submitContainerStateChangeAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the SubmitContainerStateChange operation returned by the service.
-
submitContainerStateChangeAsync
Simplified method form for invoking the SubmitContainerStateChange operation.- Specified by:
submitContainerStateChangeAsync
in interfaceAmazonECSAsync
- See Also:
-
submitContainerStateChangeAsync
public Future<SubmitContainerStateChangeResult> submitContainerStateChangeAsync(AsyncHandler<SubmitContainerStateChangeRequest, SubmitContainerStateChangeResult> asyncHandler) Simplified method form for invoking the SubmitContainerStateChange operation with an AsyncHandler.- Specified by:
submitContainerStateChangeAsync
in interfaceAmazonECSAsync
- See Also:
-
submitTaskStateChangeAsync
public Future<SubmitTaskStateChangeResult> submitTaskStateChangeAsync(SubmitTaskStateChangeRequest request) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a task changed states.
- Specified by:
submitTaskStateChangeAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the SubmitTaskStateChange operation returned by the service.
-
submitTaskStateChangeAsync
public Future<SubmitTaskStateChangeResult> submitTaskStateChangeAsync(SubmitTaskStateChangeRequest request, AsyncHandler<SubmitTaskStateChangeRequest, SubmitTaskStateChangeResult> asyncHandler) Description copied from interface:AmazonECSAsync
This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a task changed states.
- Specified by:
submitTaskStateChangeAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the SubmitTaskStateChange operation returned by the service.
-
updateContainerAgentAsync
public Future<UpdateContainerAgentResult> updateContainerAgentAsync(UpdateContainerAgentRequest request) Description copied from interface:AmazonECSAsync
Updates the Amazon ECS container agent on a specified container instance. Updating the Amazon ECS container agent does not interrupt running tasks or services on the container instance. The process for updating the agent differs depending on whether your container instance was launched with the Amazon ECS-optimized AMI or another operating system.
UpdateContainerAgent
requires the Amazon ECS-optimized AMI or Amazon Linux with theecs-init
service installed and running. For help updating the Amazon ECS container agent on other operating systems, see Manually Updating the Amazon ECS Container Agent in the Amazon EC2 Container Service Developer Guide.- Specified by:
updateContainerAgentAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the UpdateContainerAgent operation returned by the service.
-
updateContainerAgentAsync
public Future<UpdateContainerAgentResult> updateContainerAgentAsync(UpdateContainerAgentRequest request, AsyncHandler<UpdateContainerAgentRequest, UpdateContainerAgentResult> asyncHandler) Description copied from interface:AmazonECSAsync
Updates the Amazon ECS container agent on a specified container instance. Updating the Amazon ECS container agent does not interrupt running tasks or services on the container instance. The process for updating the agent differs depending on whether your container instance was launched with the Amazon ECS-optimized AMI or another operating system.
UpdateContainerAgent
requires the Amazon ECS-optimized AMI or Amazon Linux with theecs-init
service installed and running. For help updating the Amazon ECS container agent on other operating systems, see Manually Updating the Amazon ECS Container Agent in the Amazon EC2 Container Service Developer Guide.- Specified by:
updateContainerAgentAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the UpdateContainerAgent operation returned by the service.
-
updateServiceAsync
Description copied from interface:AmazonECSAsync
Modifies the desired count, deployment configuration, or task definition used in a service.
You can add to or subtract from the number of instantiations of a task definition in a service by specifying the cluster that the service is running in and a new
desiredCount
parameter.You can use UpdateService to modify your task definition and deploy a new version of your service.
You can also update the deployment configuration of a service. When a deployment is triggered by updating the task definition of a service, the service scheduler uses the deployment configuration parameters,
minimumHealthyPercent
andmaximumPercent
, to determine the deployment strategy.If the
minimumHealthyPercent
is below 100%, the scheduler can ignore thedesiredCount
temporarily during a deployment. For example, if your service has adesiredCount
of four tasks, aminimumHealthyPercent
of 50% allows the scheduler to stop two existing tasks before starting two new tasks. Tasks for services that do not use a load balancer are considered healthy if they are in theRUNNING
state; tasks for services that do use a load balancer are considered healthy if they are in theRUNNING
state and the container instance it is hosted on is reported as healthy by the load balancer.The
maximumPercent
parameter represents an upper limit on the number of running tasks during a deployment, which enables you to define the deployment batch size. For example, if your service has adesiredCount
of four tasks, amaximumPercent
value of 200% starts four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available).When UpdateService stops a task during a deployment, the equivalent of
docker stop
is issued to the containers running in the task. This results in aSIGTERM
and a 30-second timeout, after whichSIGKILL
is sent and the containers are forcibly stopped. If the container handles theSIGTERM
gracefully and exits within 30 seconds from receiving it, noSIGKILL
is sent.When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
-
Determine which of the container instances in your cluster can support your service's task definition (for example, they have the required CPU, memory, ports, and container instance attributes).
-
Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement.
-
Place the new service task on a valid container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.
- Specified by:
updateServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-- Returns:
- A Java Future containing the result of the UpdateService operation returned by the service.
-
-
updateServiceAsync
public Future<UpdateServiceResult> updateServiceAsync(UpdateServiceRequest request, AsyncHandler<UpdateServiceRequest, UpdateServiceResult> asyncHandler) Description copied from interface:AmazonECSAsync
Modifies the desired count, deployment configuration, or task definition used in a service.
You can add to or subtract from the number of instantiations of a task definition in a service by specifying the cluster that the service is running in and a new
desiredCount
parameter.You can use UpdateService to modify your task definition and deploy a new version of your service.
You can also update the deployment configuration of a service. When a deployment is triggered by updating the task definition of a service, the service scheduler uses the deployment configuration parameters,
minimumHealthyPercent
andmaximumPercent
, to determine the deployment strategy.If the
minimumHealthyPercent
is below 100%, the scheduler can ignore thedesiredCount
temporarily during a deployment. For example, if your service has adesiredCount
of four tasks, aminimumHealthyPercent
of 50% allows the scheduler to stop two existing tasks before starting two new tasks. Tasks for services that do not use a load balancer are considered healthy if they are in theRUNNING
state; tasks for services that do use a load balancer are considered healthy if they are in theRUNNING
state and the container instance it is hosted on is reported as healthy by the load balancer.The
maximumPercent
parameter represents an upper limit on the number of running tasks during a deployment, which enables you to define the deployment batch size. For example, if your service has adesiredCount
of four tasks, amaximumPercent
value of 200% starts four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available).When UpdateService stops a task during a deployment, the equivalent of
docker stop
is issued to the containers running in the task. This results in aSIGTERM
and a 30-second timeout, after whichSIGKILL
is sent and the containers are forcibly stopped. If the container handles theSIGTERM
gracefully and exits within 30 seconds from receiving it, noSIGKILL
is sent.When the service scheduler launches new tasks, it attempts to balance them across the Availability Zones in your cluster with the following logic:
-
Determine which of the container instances in your cluster can support your service's task definition (for example, they have the required CPU, memory, ports, and container instance attributes).
-
Sort the valid container instances by the fewest number of running tasks for this service in the same Availability Zone as the instance. For example, if zone A has one running service task and zones B and C each have zero, valid container instances in either zone B or C are considered optimal for placement.
-
Place the new service task on a valid container instance in an optimal Availability Zone (based on the previous steps), favoring container instances with the fewest number of running tasks for this service.
- Specified by:
updateServiceAsync
in interfaceAmazonECSAsync
- Parameters:
request
-asyncHandler
- Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation.- Returns:
- A Java Future containing the result of the UpdateService operation returned by the service.
-
-
shutdown
public void shutdown()Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should callgetExecutorService().shutdown()
followed bygetExecutorService().awaitTermination()
prior to calling this method.- Specified by:
shutdown
in interfaceAmazonECS
- Overrides:
shutdown
in classAmazonWebServiceClient
-