Class AmazonECSAsyncClient
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceClient
-
- com.amazonaws.services.ecs.AmazonECSClient
-
- com.amazonaws.services.ecs.AmazonECSAsyncClient
-
- All Implemented Interfaces:
AmazonECS,AmazonECSAsync
@ThreadSafe public class AmazonECSAsyncClient extends AmazonECSClient implements AmazonECSAsync
Interface for accessing Amazon ECS asynchronously. Each asynchronous method will return a Java Future object representing the asynchronous operation; overloads which accept anAsyncHandlercan 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
Constructors Constructor Description AmazonECSAsyncClient()Constructs 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
-
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 Detail
-
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).
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(ClientConfiguration clientConfiguration)
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:
DefaultAWSCredentialsProviderChain,Executors.newFixedThreadPool(int)
-
AmazonECSAsyncClient
public AmazonECSAsyncClient(AWSCredentials awsCredentials)
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:
Executors.newFixedThreadPool(int)
-
AmazonECSAsyncClient
public 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. 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
public AmazonECSAsyncClient(AWSCredentialsProvider awsCredentialsProvider)
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:
Executors.newFixedThreadPool(int)
-
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:
DefaultAWSCredentialsProviderChain,Executors.newFixedThreadPool(int)
-
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 Detail
-
getExecutorService
public ExecutorService 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
public Future<CreateClusterResult> createClusterAsync(CreateClusterRequest request)
Description copied from interface:AmazonECSAsyncCreates a new Amazon ECS cluster. By default, your account receives a
defaultcluster when you launch your first container instance. However, you can create your own cluster with a unique name with theCreateClusteraction.- Specified by:
createClusterAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncCreates a new Amazon ECS cluster. By default, your account receives a
defaultcluster when you launch your first container instance. However, you can create your own cluster with a unique name with theCreateClusteraction.- Specified by:
createClusterAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<CreateClusterResult> createClusterAsync()
Simplified method form for invoking the CreateCluster operation.- Specified by:
createClusterAsyncin interfaceAmazonECSAsync- See Also:
createClusterAsync(CreateClusterRequest)
-
createClusterAsync
public Future<CreateClusterResult> createClusterAsync(AsyncHandler<CreateClusterRequest,CreateClusterResult> asyncHandler)
Simplified method form for invoking the CreateCluster operation with an AsyncHandler.- Specified by:
createClusterAsyncin interfaceAmazonECSAsync- See Also:
createClusterAsync(CreateClusterRequest, com.amazonaws.handlers.AsyncHandler)
-
createServiceAsync
public Future<CreateServiceResult> createServiceAsync(CreateServiceRequest request)
Description copied from interface:AmazonECSAsyncRuns 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
minimumHealthyPercentandmaximumPercentparameters to determine the deployment strategy.If the
minimumHealthyPercentis below 100%, the scheduler can ignore thedesiredCounttemporarily during a deployment. For example, if your service has adesiredCountof four tasks, aminimumHealthyPercentof 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 theRUNNINGstate; tasks for services that do use a load balancer are considered healthy if they are in theRUNNINGstate and the container instance it is hosted on is reported as healthy by the load balancer. The default value forminimumHealthyPercentis 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs.The
maximumPercentparameter 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 adesiredCountof four tasks, amaximumPercentvalue 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 formaximumPercentis 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:
createServiceAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncRuns 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
minimumHealthyPercentandmaximumPercentparameters to determine the deployment strategy.If the
minimumHealthyPercentis below 100%, the scheduler can ignore thedesiredCounttemporarily during a deployment. For example, if your service has adesiredCountof four tasks, aminimumHealthyPercentof 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 theRUNNINGstate; tasks for services that do use a load balancer are considered healthy if they are in theRUNNINGstate and the container instance it is hosted on is reported as healthy by the load balancer. The default value forminimumHealthyPercentis 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs.The
maximumPercentparameter 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 adesiredCountof four tasks, amaximumPercentvalue 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 formaximumPercentis 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:
createServiceAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DeleteClusterResult> deleteClusterAsync(DeleteClusterRequest request)
Description copied from interface:AmazonECSAsyncDeletes 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:
deleteClusterAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDeletes 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:
deleteClusterAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DeleteServiceResult> deleteServiceAsync(DeleteServiceRequest request)
Description copied from interface:AmazonECSAsyncDeletes 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
ACTIVEtoDRAINING, 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 fromDRAININGtoINACTIVE. Services in theDRAININGorINACTIVEstatus can still be viewed with DescribeServices API operations; however, in the future,INACTIVEservices may be cleaned up and purged from Amazon ECS record keeping, and DescribeServices API operations on those services will return aServiceNotFoundExceptionerror.- Specified by:
deleteServiceAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDeletes 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
ACTIVEtoDRAINING, 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 fromDRAININGtoINACTIVE. Services in theDRAININGorINACTIVEstatus can still be viewed with DescribeServices API operations; however, in the future,INACTIVEservices may be cleaned up and purged from Amazon ECS record keeping, and DescribeServices API operations on those services will return aServiceNotFoundExceptionerror.- Specified by:
deleteServiceAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncDeregisters 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:
deregisterContainerInstanceAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDeregisters 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:
deregisterContainerInstanceAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncDeregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as
INACTIVE. Existing tasks and services that reference anINACTIVEtask definition continue to run without disruption. Existing services that reference anINACTIVEtask definition can still scale up or down by modifying the service's desired count.You cannot use an
INACTIVEtask definition to run new tasks or create new services, and you cannot update an existing service to reference anINACTIVEtask definition (although there may be up to a 10 minute window following deregistration where these restrictions have not yet taken effect).- Specified by:
deregisterTaskDefinitionAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDeregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as
INACTIVE. Existing tasks and services that reference anINACTIVEtask definition continue to run without disruption. Existing services that reference anINACTIVEtask definition can still scale up or down by modifying the service's desired count.You cannot use an
INACTIVEtask definition to run new tasks or create new services, and you cannot update an existing service to reference anINACTIVEtask definition (although there may be up to a 10 minute window following deregistration where these restrictions have not yet taken effect).- Specified by:
deregisterTaskDefinitionAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DescribeClustersResult> describeClustersAsync(DescribeClustersRequest request)
Description copied from interface:AmazonECSAsyncDescribes one or more of your clusters.
- Specified by:
describeClustersAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDescribes one or more of your clusters.
- Specified by:
describeClustersAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DescribeClustersResult> describeClustersAsync()
Simplified method form for invoking the DescribeClusters operation.- Specified by:
describeClustersAsyncin interfaceAmazonECSAsync- See Also:
describeClustersAsync(DescribeClustersRequest)
-
describeClustersAsync
public Future<DescribeClustersResult> describeClustersAsync(AsyncHandler<DescribeClustersRequest,DescribeClustersResult> asyncHandler)
Simplified method form for invoking the DescribeClusters operation with an AsyncHandler.- Specified by:
describeClustersAsyncin interfaceAmazonECSAsync- See Also:
describeClustersAsync(DescribeClustersRequest, com.amazonaws.handlers.AsyncHandler)
-
describeContainerInstancesAsync
public Future<DescribeContainerInstancesResult> describeContainerInstancesAsync(DescribeContainerInstancesRequest request)
Description copied from interface:AmazonECSAsyncDescribes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
- Specified by:
describeContainerInstancesAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDescribes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
- Specified by:
describeContainerInstancesAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DescribeServicesResult> describeServicesAsync(DescribeServicesRequest request)
Description copied from interface:AmazonECSAsyncDescribes the specified services running in your cluster.
- Specified by:
describeServicesAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDescribes the specified services running in your cluster.
- Specified by:
describeServicesAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncDescribes a task definition. You can specify a
familyandrevisionto find information about a specific task definition, or you can simply specify the family to find the latestACTIVErevision in that family.You can only describe
INACTIVEtask definitions while an active task or service references them.- Specified by:
describeTaskDefinitionAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDescribes a task definition. You can specify a
familyandrevisionto find information about a specific task definition, or you can simply specify the family to find the latestACTIVErevision in that family.You can only describe
INACTIVEtask definitions while an active task or service references them.- Specified by:
describeTaskDefinitionAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DescribeTasksResult> describeTasksAsync(DescribeTasksRequest request)
Description copied from interface:AmazonECSAsyncDescribes a specified task or tasks.
- Specified by:
describeTasksAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncDescribes a specified task or tasks.
- Specified by:
describeTasksAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncThis 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:
discoverPollEndpointAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncThis 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:
discoverPollEndpointAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<DiscoverPollEndpointResult> discoverPollEndpointAsync()
Simplified method form for invoking the DiscoverPollEndpoint operation.- Specified by:
discoverPollEndpointAsyncin interfaceAmazonECSAsync- See Also:
discoverPollEndpointAsync(DiscoverPollEndpointRequest)
-
discoverPollEndpointAsync
public Future<DiscoverPollEndpointResult> discoverPollEndpointAsync(AsyncHandler<DiscoverPollEndpointRequest,DiscoverPollEndpointResult> asyncHandler)
Simplified method form for invoking the DiscoverPollEndpoint operation with an AsyncHandler.- Specified by:
discoverPollEndpointAsyncin interfaceAmazonECSAsync- See Also:
discoverPollEndpointAsync(DiscoverPollEndpointRequest, com.amazonaws.handlers.AsyncHandler)
-
listClustersAsync
public Future<ListClustersResult> listClustersAsync(ListClustersRequest request)
Description copied from interface:AmazonECSAsyncReturns a list of existing clusters.
- Specified by:
listClustersAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncReturns a list of existing clusters.
- Specified by:
listClustersAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListClustersResult> listClustersAsync()
Simplified method form for invoking the ListClusters operation.- Specified by:
listClustersAsyncin interfaceAmazonECSAsync- See Also:
listClustersAsync(ListClustersRequest)
-
listClustersAsync
public Future<ListClustersResult> listClustersAsync(AsyncHandler<ListClustersRequest,ListClustersResult> asyncHandler)
Simplified method form for invoking the ListClusters operation with an AsyncHandler.- Specified by:
listClustersAsyncin interfaceAmazonECSAsync- See Also:
listClustersAsync(ListClustersRequest, com.amazonaws.handlers.AsyncHandler)
-
listContainerInstancesAsync
public Future<ListContainerInstancesResult> listContainerInstancesAsync(ListContainerInstancesRequest request)
Description copied from interface:AmazonECSAsyncReturns a list of container instances in a specified cluster.
- Specified by:
listContainerInstancesAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncReturns a list of container instances in a specified cluster.
- Specified by:
listContainerInstancesAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListContainerInstancesResult> listContainerInstancesAsync()
Simplified method form for invoking the ListContainerInstances operation.- Specified by:
listContainerInstancesAsyncin interfaceAmazonECSAsync- See Also:
listContainerInstancesAsync(ListContainerInstancesRequest)
-
listContainerInstancesAsync
public Future<ListContainerInstancesResult> listContainerInstancesAsync(AsyncHandler<ListContainerInstancesRequest,ListContainerInstancesResult> asyncHandler)
Simplified method form for invoking the ListContainerInstances operation with an AsyncHandler.- Specified by:
listContainerInstancesAsyncin interfaceAmazonECSAsync- See Also:
listContainerInstancesAsync(ListContainerInstancesRequest, com.amazonaws.handlers.AsyncHandler)
-
listServicesAsync
public Future<ListServicesResult> listServicesAsync(ListServicesRequest request)
Description copied from interface:AmazonECSAsyncLists the services that are running in a specified cluster.
- Specified by:
listServicesAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncLists the services that are running in a specified cluster.
- Specified by:
listServicesAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListServicesResult> listServicesAsync()
Simplified method form for invoking the ListServices operation.- Specified by:
listServicesAsyncin interfaceAmazonECSAsync- See Also:
listServicesAsync(ListServicesRequest)
-
listServicesAsync
public Future<ListServicesResult> listServicesAsync(AsyncHandler<ListServicesRequest,ListServicesResult> asyncHandler)
Simplified method form for invoking the ListServices operation with an AsyncHandler.- Specified by:
listServicesAsyncin interfaceAmazonECSAsync- See Also:
listServicesAsync(ListServicesRequest, com.amazonaws.handlers.AsyncHandler)
-
listTaskDefinitionFamiliesAsync
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest request)
Description copied from interface:AmazonECSAsyncReturns a list of task definition families that are registered to your account (which may include task definition families that no longer have any
ACTIVEtask definition revisions).You can filter out task definition families that do not contain any
ACTIVEtask definition revisions by setting thestatusparameter toACTIVE. You can also filter the results with thefamilyPrefixparameter.- Specified by:
listTaskDefinitionFamiliesAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncReturns a list of task definition families that are registered to your account (which may include task definition families that no longer have any
ACTIVEtask definition revisions).You can filter out task definition families that do not contain any
ACTIVEtask definition revisions by setting thestatusparameter toACTIVE. You can also filter the results with thefamilyPrefixparameter.- Specified by:
listTaskDefinitionFamiliesAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync()
Simplified method form for invoking the ListTaskDefinitionFamilies operation.- Specified by:
listTaskDefinitionFamiliesAsyncin interfaceAmazonECSAsync- See Also:
listTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest)
-
listTaskDefinitionFamiliesAsync
public Future<ListTaskDefinitionFamiliesResult> listTaskDefinitionFamiliesAsync(AsyncHandler<ListTaskDefinitionFamiliesRequest,ListTaskDefinitionFamiliesResult> asyncHandler)
Simplified method form for invoking the ListTaskDefinitionFamilies operation with an AsyncHandler.- Specified by:
listTaskDefinitionFamiliesAsyncin interfaceAmazonECSAsync- See Also:
listTaskDefinitionFamiliesAsync(ListTaskDefinitionFamiliesRequest, com.amazonaws.handlers.AsyncHandler)
-
listTaskDefinitionsAsync
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(ListTaskDefinitionsRequest request)
Description copied from interface:AmazonECSAsyncReturns a list of task definitions that are registered to your account. You can filter the results by family name with the
familyPrefixparameter or by status with thestatusparameter.- Specified by:
listTaskDefinitionsAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncReturns a list of task definitions that are registered to your account. You can filter the results by family name with the
familyPrefixparameter or by status with thestatusparameter.- Specified by:
listTaskDefinitionsAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync()
Simplified method form for invoking the ListTaskDefinitions operation.- Specified by:
listTaskDefinitionsAsyncin interfaceAmazonECSAsync- See Also:
listTaskDefinitionsAsync(ListTaskDefinitionsRequest)
-
listTaskDefinitionsAsync
public Future<ListTaskDefinitionsResult> listTaskDefinitionsAsync(AsyncHandler<ListTaskDefinitionsRequest,ListTaskDefinitionsResult> asyncHandler)
Simplified method form for invoking the ListTaskDefinitions operation with an AsyncHandler.- Specified by:
listTaskDefinitionsAsyncin interfaceAmazonECSAsync- See Also:
listTaskDefinitionsAsync(ListTaskDefinitionsRequest, com.amazonaws.handlers.AsyncHandler)
-
listTasksAsync
public Future<ListTasksResult> listTasksAsync(ListTasksRequest request)
Description copied from interface:AmazonECSAsyncReturns 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, anddesiredStatusparameters.- Specified by:
listTasksAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncReturns 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, anddesiredStatusparameters.- Specified by:
listTasksAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<ListTasksResult> listTasksAsync()
Simplified method form for invoking the ListTasks operation.- Specified by:
listTasksAsyncin interfaceAmazonECSAsync- See Also:
listTasksAsync(ListTasksRequest)
-
listTasksAsync
public Future<ListTasksResult> listTasksAsync(AsyncHandler<ListTasksRequest,ListTasksResult> asyncHandler)
Simplified method form for invoking the ListTasks operation with an AsyncHandler.- Specified by:
listTasksAsyncin interfaceAmazonECSAsync- See Also:
listTasksAsync(ListTasksRequest, com.amazonaws.handlers.AsyncHandler)
-
registerContainerInstanceAsync
public Future<RegisterContainerInstanceResult> registerContainerInstanceAsync(RegisterContainerInstanceRequest request)
Description copied from interface:AmazonECSAsyncThis 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:
registerContainerInstanceAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncThis 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:
registerContainerInstanceAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncRegisters a new task definition from the supplied
familyandcontainerDefinitions. Optionally, you can add data volumes to your containers with thevolumesparameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.- Specified by:
registerTaskDefinitionAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncRegisters a new task definition from the supplied
familyandcontainerDefinitions. Optionally, you can add data volumes to your containers with thevolumesparameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.- Specified by:
registerTaskDefinitionAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<RunTaskResult> runTaskAsync(RunTaskRequest request)
Description copied from interface:AmazonECSAsyncStart 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
StartTaskinstead.The
countparameter is limited to 10 tasks per call.- Specified by:
runTaskAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncStart 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
StartTaskinstead.The
countparameter is limited to 10 tasks per call.- Specified by:
runTaskAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<StartTaskResult> startTaskAsync(StartTaskRequest request)
Description copied from interface:AmazonECSAsyncStarts 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
RunTaskinstead.The list of container instances to start tasks on is limited to 10.
- Specified by:
startTaskAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncStarts 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
RunTaskinstead.The list of container instances to start tasks on is limited to 10.
- Specified by:
startTaskAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<StopTaskResult> stopTaskAsync(StopTaskRequest request)
Description copied from interface:AmazonECSAsyncStops a running task.
When StopTask is called on a task, the equivalent of
docker stopis issued to the containers running in the task. This results in aSIGTERMand a 30-second timeout, after whichSIGKILLis sent and the containers are forcibly stopped. If the container handles theSIGTERMgracefully and exits within 30 seconds from receiving it, noSIGKILLis sent.- Specified by:
stopTaskAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncStops a running task.
When StopTask is called on a task, the equivalent of
docker stopis issued to the containers running in the task. This results in aSIGTERMand a 30-second timeout, after whichSIGKILLis sent and the containers are forcibly stopped. If the container handles theSIGTERMgracefully and exits within 30 seconds from receiving it, noSIGKILLis sent.- Specified by:
stopTaskAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncThis 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:
submitContainerStateChangeAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncThis 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:
submitContainerStateChangeAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<SubmitContainerStateChangeResult> submitContainerStateChangeAsync()
Simplified method form for invoking the SubmitContainerStateChange operation.- Specified by:
submitContainerStateChangeAsyncin interfaceAmazonECSAsync- See Also:
submitContainerStateChangeAsync(SubmitContainerStateChangeRequest)
-
submitContainerStateChangeAsync
public Future<SubmitContainerStateChangeResult> submitContainerStateChangeAsync(AsyncHandler<SubmitContainerStateChangeRequest,SubmitContainerStateChangeResult> asyncHandler)
Simplified method form for invoking the SubmitContainerStateChange operation with an AsyncHandler.- Specified by:
submitContainerStateChangeAsyncin interfaceAmazonECSAsync- See Also:
submitContainerStateChangeAsync(SubmitContainerStateChangeRequest, com.amazonaws.handlers.AsyncHandler)
-
submitTaskStateChangeAsync
public Future<SubmitTaskStateChangeResult> submitTaskStateChangeAsync(SubmitTaskStateChangeRequest request)
Description copied from interface:AmazonECSAsyncThis 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:
submitTaskStateChangeAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncThis 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:
submitTaskStateChangeAsyncin interfaceAmazonECSAsyncasyncHandler- 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:AmazonECSAsyncUpdates 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.
UpdateContainerAgentrequires the Amazon ECS-optimized AMI or Amazon Linux with theecs-initservice 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:
updateContainerAgentAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncUpdates 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.
UpdateContainerAgentrequires the Amazon ECS-optimized AMI or Amazon Linux with theecs-initservice 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:
updateContainerAgentAsyncin interfaceAmazonECSAsyncasyncHandler- 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
public Future<UpdateServiceResult> updateServiceAsync(UpdateServiceRequest request)
Description copied from interface:AmazonECSAsyncModifies 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
desiredCountparameter.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,
minimumHealthyPercentandmaximumPercent, to determine the deployment strategy.If the
minimumHealthyPercentis below 100%, the scheduler can ignore thedesiredCounttemporarily during a deployment. For example, if your service has adesiredCountof four tasks, aminimumHealthyPercentof 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 theRUNNINGstate; tasks for services that do use a load balancer are considered healthy if they are in theRUNNINGstate and the container instance it is hosted on is reported as healthy by the load balancer.The
maximumPercentparameter 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 adesiredCountof four tasks, amaximumPercentvalue 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 stopis issued to the containers running in the task. This results in aSIGTERMand a 30-second timeout, after whichSIGKILLis sent and the containers are forcibly stopped. If the container handles theSIGTERMgracefully and exits within 30 seconds from receiving it, noSIGKILLis 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:
updateServiceAsyncin interfaceAmazonECSAsync- 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:AmazonECSAsyncModifies 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
desiredCountparameter.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,
minimumHealthyPercentandmaximumPercent, to determine the deployment strategy.If the
minimumHealthyPercentis below 100%, the scheduler can ignore thedesiredCounttemporarily during a deployment. For example, if your service has adesiredCountof four tasks, aminimumHealthyPercentof 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 theRUNNINGstate; tasks for services that do use a load balancer are considered healthy if they are in theRUNNINGstate and the container instance it is hosted on is reported as healthy by the load balancer.The
maximumPercentparameter 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 adesiredCountof four tasks, amaximumPercentvalue 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 stopis issued to the containers running in the task. This results in aSIGTERMand a 30-second timeout, after whichSIGKILLis sent and the containers are forcibly stopped. If the container handles theSIGTERMgracefully and exits within 30 seconds from receiving it, noSIGKILLis 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:
updateServiceAsyncin interfaceAmazonECSAsyncasyncHandler- 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:
shutdownin interfaceAmazonECS- Overrides:
shutdownin classAmazonWebServiceClient
-
-