public class AmazonECSClient extends AmazonWebServiceClient implements AmazonECS
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 Amazon 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.
Modifier and Type | Field and Description |
---|---|
protected List<com.amazonaws.transform.JsonErrorUnmarshaller> |
jsonErrorUnmarshallers
List of exception unmarshallers for all AmazonECS exceptions.
|
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
Constructor and Description |
---|
AmazonECSClient()
Constructs a new client to invoke service methods on
AmazonECS.
|
AmazonECSClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on
AmazonECS using the specified AWS account credentials.
|
AmazonECSClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on
AmazonECS using the specified AWS account credentials
and client configuration options.
|
AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on
AmazonECS using the specified AWS account credentials provider.
|
AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on
AmazonECS using the specified AWS account credentials
provider and client configuration options.
|
AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on
AmazonECS using the specified AWS account credentials
provider, client configuration options and request metric collector.
|
AmazonECSClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on
AmazonECS.
|
Modifier and Type | Method and Description |
---|---|
CreateClusterResult |
createCluster()
Creates a new Amazon ECS cluster.
|
CreateClusterResult |
createCluster(CreateClusterRequest createClusterRequest)
Creates a new Amazon ECS cluster.
|
CreateServiceResult |
createService(CreateServiceRequest createServiceRequest)
Runs and maintains a desired number of tasks from a specified task
definition.
|
DeleteClusterResult |
deleteCluster(DeleteClusterRequest deleteClusterRequest)
Deletes the specified cluster.
|
DeleteServiceResult |
deleteService(DeleteServiceRequest deleteServiceRequest)
Deletes a specified service within a cluster.
|
DeregisterContainerInstanceResult |
deregisterContainerInstance(DeregisterContainerInstanceRequest deregisterContainerInstanceRequest)
Deregisters an Amazon ECS container instance from the specified
cluster.
|
DeregisterTaskDefinitionResult |
deregisterTaskDefinition(DeregisterTaskDefinitionRequest deregisterTaskDefinitionRequest)
Deregisters the specified task definition by family and revision.
|
DescribeClustersResult |
describeClusters()
Describes one or more of your clusters.
|
DescribeClustersResult |
describeClusters(DescribeClustersRequest describeClustersRequest)
Describes one or more of your clusters.
|
DescribeContainerInstancesResult |
describeContainerInstances(DescribeContainerInstancesRequest describeContainerInstancesRequest)
Describes Amazon EC2 Container Service container instances.
|
DescribeServicesResult |
describeServices(DescribeServicesRequest describeServicesRequest)
Describes the specified services running in your cluster.
|
DescribeTaskDefinitionResult |
describeTaskDefinition(DescribeTaskDefinitionRequest describeTaskDefinitionRequest)
Describes a task definition.
|
DescribeTasksResult |
describeTasks(DescribeTasksRequest describeTasksRequest)
Describes a specified task or tasks.
|
DiscoverPollEndpointResult |
discoverPollEndpoint()
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
DiscoverPollEndpointResult |
discoverPollEndpoint(DiscoverPollEndpointRequest discoverPollEndpointRequest)
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for
debugging issues where a service isn't acting as expected.
|
ListClustersResult |
listClusters()
Returns a list of existing clusters.
|
ListClustersResult |
listClusters(ListClustersRequest listClustersRequest)
Returns a list of existing clusters.
|
ListContainerInstancesResult |
listContainerInstances()
Returns a list of container instances in a specified cluster.
|
ListContainerInstancesResult |
listContainerInstances(ListContainerInstancesRequest listContainerInstancesRequest)
Returns a list of container instances in a specified cluster.
|
ListServicesResult |
listServices()
Lists the services that are running in a specified cluster.
|
ListServicesResult |
listServices(ListServicesRequest listServicesRequest)
Lists the services that are running in a specified cluster.
|
ListTaskDefinitionFamiliesResult |
listTaskDefinitionFamilies()
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 definitions). |
ListTaskDefinitionFamiliesResult |
listTaskDefinitionFamilies(ListTaskDefinitionFamiliesRequest listTaskDefinitionFamiliesRequest)
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 definitions). |
ListTaskDefinitionsResult |
listTaskDefinitions()
Returns a list of task definitions that are registered to your
account.
|
ListTaskDefinitionsResult |
listTaskDefinitions(ListTaskDefinitionsRequest listTaskDefinitionsRequest)
Returns a list of task definitions that are registered to your
account.
|
ListTasksResult |
listTasks()
Returns a list of tasks for a specified cluster.
|
ListTasksResult |
listTasks(ListTasksRequest listTasksRequest)
Returns a list of tasks for a specified cluster.
|
RegisterContainerInstanceResult |
registerContainerInstance(RegisterContainerInstanceRequest registerContainerInstanceRequest)
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
RegisterTaskDefinitionResult |
registerTaskDefinition(RegisterTaskDefinitionRequest registerTaskDefinitionRequest)
Registers a new task definition from the supplied
family
and containerDefinitions . |
RunTaskResult |
runTask(RunTaskRequest runTaskRequest)
Start a task using random placement and the default Amazon ECS
scheduler.
|
void |
setEndpoint(String endpoint)
Overrides the default endpoint for this client.
|
void |
setEndpoint(String endpoint,
String serviceName,
String regionId)
An internal method that is not expected to be normally
called except for AWS internal development purposes.
|
StartTaskResult |
startTask(StartTaskRequest startTaskRequest)
Starts a new task from the specified task definition on the specified
container instance or instances.
|
StopTaskResult |
stopTask(StopTaskRequest stopTaskRequest)
Stops a running task.
|
SubmitContainerStateChangeResult |
submitContainerStateChange()
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
SubmitContainerStateChangeResult |
submitContainerStateChange(SubmitContainerStateChangeRequest submitContainerStateChangeRequest)
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
SubmitTaskStateChangeResult |
submitTaskStateChange(SubmitTaskStateChangeRequest submitTaskStateChangeRequest)
NOTE: This action is only used by the Amazon EC2 Container
Service agent, and it is not intended for use outside of the agent.
|
UpdateContainerAgentResult |
updateContainerAgent(UpdateContainerAgentRequest updateContainerAgentRequest)
Updates the Amazon ECS container agent on a specified container
instance.
|
UpdateServiceResult |
updateService(UpdateServiceRequest updateServiceRequest)
Modify the desired count or task definition used in a service.
|
addRequestHandler, addRequestHandler, beforeMarshalling, configSigner, configSigner, configureRegion, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
protected List<com.amazonaws.transform.JsonErrorUnmarshaller> jsonErrorUnmarshallers
public AmazonECSClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
public AmazonECSClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this
client connects to AmazonECS
(ex: proxy settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
public AmazonECSClient(AWSCredentials awsCredentials)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use
when authenticating with AWS services.public AmazonECSClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use
when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this
client connects to AmazonECS
(ex: proxy settings, retry counts, etc.).public AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials
to authenticate requests with AWS services.public AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials
to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this
client connects to AmazonECS
(ex: proxy settings, retry counts, etc.).public AmazonECSClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials
to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this
client connects to AmazonECS
(ex: proxy settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic DeleteClusterResult deleteCluster(DeleteClusterRequest deleteClusterRequest)
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.
deleteCluster
in interface AmazonECS
deleteClusterRequest
- Container for the necessary parameters to
execute the DeleteCluster service method on AmazonECS.InvalidParameterException
ClusterContainsContainerInstancesException
ClusterNotFoundException
ServerException
ClientException
ClusterContainsServicesException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public SubmitContainerStateChangeResult submitContainerStateChange(SubmitContainerStateChangeRequest submitContainerStateChangeRequest)
NOTE: 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.
submitContainerStateChange
in interface AmazonECS
submitContainerStateChangeRequest
- Container for the necessary
parameters to execute the SubmitContainerStateChange service method on
AmazonECS.ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DeleteServiceResult deleteService(DeleteServiceRequest deleteServiceRequest)
Deletes a specified service within a cluster.
deleteService
in interface AmazonECS
deleteServiceRequest
- Container for the necessary parameters to
execute the DeleteService service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
ServiceNotFoundException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTaskDefinitionsResult listTaskDefinitions(ListTaskDefinitionsRequest listTaskDefinitionsRequest)
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 the
status
parameter.
listTaskDefinitions
in interface AmazonECS
listTaskDefinitionsRequest
- Container for the necessary
parameters to execute the ListTaskDefinitions service method on
AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public RunTaskResult runTask(RunTaskRequest runTaskRequest)
Start a task using random placement and the default Amazon ECS
scheduler. If you want to use your own scheduler or place a task on a
specific container instance, use StartTask
instead.
IMPORTANT: The count parameter is limited to 10 tasks per call.
runTask
in interface AmazonECS
runTaskRequest
- Container for the necessary parameters to
execute the RunTask service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListClustersResult listClusters(ListClustersRequest listClustersRequest)
Returns a list of existing clusters.
listClusters
in interface AmazonECS
listClustersRequest
- Container for the necessary parameters to
execute the ListClusters service method on AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public CreateClusterResult createCluster(CreateClusterRequest createClusterRequest)
Creates a new Amazon ECS cluster. By default, your account will
receive a default
cluster when you launch your first
container instance. However, you can create your own cluster with a
unique name with the CreateCluster
action.
createCluster
in interface AmazonECS
createClusterRequest
- Container for the necessary parameters to
execute the CreateCluster service method on AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeClustersResult describeClusters(DescribeClustersRequest describeClustersRequest)
Describes one or more of your clusters.
describeClusters
in interface AmazonECS
describeClustersRequest
- Container for the necessary parameters
to execute the DescribeClusters service method on AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DeregisterTaskDefinitionResult deregisterTaskDefinition(DeregisterTaskDefinitionRequest deregisterTaskDefinitionRequest)
Deregisters the specified task definition by family and revision.
Upon deregistration, the task definition is marked as
INACTIVE
. Existing tasks and services that reference an
INACTIVE
task definition continue to run without
disruption. Existing services that reference an INACTIVE
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 an INACTIVE
task definition
(although there may be up to a 10 minute window following
deregistration where these restrictions have not yet taken effect).
deregisterTaskDefinition
in interface AmazonECS
deregisterTaskDefinitionRequest
- Container for the necessary
parameters to execute the DeregisterTaskDefinition service method on
AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DeregisterContainerInstanceResult deregisterContainerInstance(DeregisterContainerInstanceRequest deregisterContainerInstanceRequest)
Deregisters an Amazon ECS container instance from the specified cluster. This instance will no longer be 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.
NOTE: When you terminate a container instance, it is automatically deregistered from your cluster.
deregisterContainerInstance
in interface AmazonECS
deregisterContainerInstanceRequest
- Container for the necessary
parameters to execute the DeregisterContainerInstance service method
on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListContainerInstancesResult listContainerInstances(ListContainerInstancesRequest listContainerInstancesRequest)
Returns a list of container instances in a specified cluster.
listContainerInstances
in interface AmazonECS
listContainerInstancesRequest
- Container for the necessary
parameters to execute the ListContainerInstances service method on
AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public UpdateContainerAgentResult updateContainerAgent(UpdateContainerAgentRequest updateContainerAgentRequest)
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 the ecs-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 .
updateContainerAgent
in interface AmazonECS
updateContainerAgentRequest
- Container for the necessary
parameters to execute the UpdateContainerAgent service method on
AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
NoUpdateAvailableException
ClientException
MissingVersionException
UpdateInProgressException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeTaskDefinitionResult describeTaskDefinition(DescribeTaskDefinitionRequest describeTaskDefinitionRequest)
Describes a task definition. You can specify a family
and revision
to find information on a specific task
definition, or you can simply specify the family to find the latest
ACTIVE
revision in that family.
NOTE: You can only describe INACTIVE task definitions while an active task or service references them.
describeTaskDefinition
in interface AmazonECS
describeTaskDefinitionRequest
- Container for the necessary
parameters to execute the DescribeTaskDefinition service method on
AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public RegisterTaskDefinitionResult registerTaskDefinition(RegisterTaskDefinitionRequest registerTaskDefinitionRequest)
Registers a new task definition from the supplied family
and containerDefinitions
. Optionally, you can add data
volumes to your containers with the volumes
parameter.
For more information on task definition parameters and defaults, see
Amazon ECS Task Definitions
in the Amazon EC2 Container Service Developer Guide .
registerTaskDefinition
in interface AmazonECS
registerTaskDefinitionRequest
- Container for the necessary
parameters to execute the RegisterTaskDefinition service method on
AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public SubmitTaskStateChangeResult submitTaskStateChange(SubmitTaskStateChangeRequest submitTaskStateChangeRequest)
NOTE: 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.
submitTaskStateChange
in interface AmazonECS
submitTaskStateChangeRequest
- Container for the necessary
parameters to execute the SubmitTaskStateChange service method on
AmazonECS.ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public CreateServiceResult createService(CreateServiceRequest createServiceRequest)
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 will spawn another
instantiation of the task in the specified cluster.
createService
in interface AmazonECS
createServiceRequest
- Container for the necessary parameters to
execute the CreateService service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeContainerInstancesResult describeContainerInstances(DescribeContainerInstancesRequest describeContainerInstancesRequest)
Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
describeContainerInstances
in interface AmazonECS
describeContainerInstancesRequest
- Container for the necessary
parameters to execute the DescribeContainerInstances service method on
AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public RegisterContainerInstanceResult registerContainerInstance(RegisterContainerInstanceRequest registerContainerInstanceRequest)
NOTE: 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 Amazon EC2 instance into the specified cluster. This instance will become available to place containers on.
registerContainerInstance
in interface AmazonECS
registerContainerInstanceRequest
- Container for the necessary
parameters to execute the RegisterContainerInstance service method on
AmazonECS.ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeServicesResult describeServices(DescribeServicesRequest describeServicesRequest)
Describes the specified services running in your cluster.
describeServices
in interface AmazonECS
describeServicesRequest
- Container for the necessary parameters
to execute the DescribeServices service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListServicesResult listServices(ListServicesRequest listServicesRequest)
Lists the services that are running in a specified cluster.
listServices
in interface AmazonECS
listServicesRequest
- Container for the necessary parameters to
execute the ListServices service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public UpdateServiceResult updateService(UpdateServiceRequest updateServiceRequest)
Modify the desired count 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, one task at a time. If you
modify the task definition with UpdateService
, Amazon
ECS spawns a task with the new version of the task definition and then
stops an old task after the new version is running. Because
UpdateService
starts a new version of the task before
stopping an old version, your cluster must have capacity to support
one more instantiation of the task when UpdateService
is
run. If your cluster cannot support another instantiation of the task
used in your service, you can reduce the desired count of your service
by one before modifying the task definition.
updateService
in interface AmazonECS
updateServiceRequest
- Container for the necessary parameters to
execute the UpdateService service method on AmazonECS.InvalidParameterException
ServiceNotActiveException
ClusterNotFoundException
ServerException
ClientException
ServiceNotFoundException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTaskDefinitionFamiliesResult listTaskDefinitionFamilies(ListTaskDefinitionFamiliesRequest listTaskDefinitionFamiliesRequest)
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 definitions). You can filter
the results with the familyPrefix
parameter.
listTaskDefinitionFamilies
in interface AmazonECS
listTaskDefinitionFamiliesRequest
- Container for the necessary
parameters to execute the ListTaskDefinitionFamilies service method on
AmazonECS.InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeTasksResult describeTasks(DescribeTasksRequest describeTasksRequest)
Describes a specified task or tasks.
describeTasks
in interface AmazonECS
describeTasksRequest
- Container for the necessary parameters to
execute the DescribeTasks service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DiscoverPollEndpointResult discoverPollEndpoint(DiscoverPollEndpointRequest discoverPollEndpointRequest)
NOTE: 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.
discoverPollEndpoint
in interface AmazonECS
discoverPollEndpointRequest
- Container for the necessary
parameters to execute the DiscoverPollEndpoint service method on
AmazonECS.ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public StartTaskResult startTask(StartTaskRequest startTaskRequest)
Starts a new task from the specified task definition on the specified
container instance or instances. If you want to use the default Amazon
ECS scheduler to place your task, use RunTask
instead.
IMPORTANT: The list of container instances to start tasks on is limited to 10.
startTask
in interface AmazonECS
startTaskRequest
- Container for the necessary parameters to
execute the StartTask service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTasksResult listTasks(ListTasksRequest listTasksRequest)
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
, and desiredStatus
parameters.
listTasks
in interface AmazonECS
listTasksRequest
- Container for the necessary parameters to
execute the ListTasks service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public StopTaskResult stopTask(StopTaskRequest stopTaskRequest)
Stops a running task.
stopTask
in interface AmazonECS
stopTaskRequest
- Container for the necessary parameters to
execute the StopTask service method on AmazonECS.InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public SubmitContainerStateChangeResult submitContainerStateChange() throws AmazonServiceException, AmazonClientException
NOTE: 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.
submitContainerStateChange
in interface AmazonECS
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTaskDefinitionsResult listTaskDefinitions() throws AmazonServiceException, AmazonClientException
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 the
status
parameter.
listTaskDefinitions
in interface AmazonECS
InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListClustersResult listClusters() throws AmazonServiceException, AmazonClientException
Returns a list of existing clusters.
listClusters
in interface AmazonECS
InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public CreateClusterResult createCluster() throws AmazonServiceException, AmazonClientException
Creates a new Amazon ECS cluster. By default, your account will
receive a default
cluster when you launch your first
container instance. However, you can create your own cluster with a
unique name with the CreateCluster
action.
createCluster
in interface AmazonECS
InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DescribeClustersResult describeClusters() throws AmazonServiceException, AmazonClientException
Describes one or more of your clusters.
describeClusters
in interface AmazonECS
InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListContainerInstancesResult listContainerInstances() throws AmazonServiceException, AmazonClientException
Returns a list of container instances in a specified cluster.
listContainerInstances
in interface AmazonECS
InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListServicesResult listServices() throws AmazonServiceException, AmazonClientException
Lists the services that are running in a specified cluster.
listServices
in interface AmazonECS
InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTaskDefinitionFamiliesResult listTaskDefinitionFamilies() throws AmazonServiceException, AmazonClientException
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 definitions). You can filter
the results with the familyPrefix
parameter.
listTaskDefinitionFamilies
in interface AmazonECS
InvalidParameterException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public DiscoverPollEndpointResult discoverPollEndpoint() throws AmazonServiceException, AmazonClientException
NOTE: 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.
discoverPollEndpoint
in interface AmazonECS
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public ListTasksResult listTasks() throws AmazonServiceException, AmazonClientException
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
, and desiredStatus
parameters.
listTasks
in interface AmazonECS
InvalidParameterException
ClusterNotFoundException
ServerException
ClientException
AmazonClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the response. For example
if a network connection is not available.AmazonServiceException
- If an error response is returned by AmazonECS indicating
either a problem with the data in the request, or a server side issue.public void setEndpoint(String endpoint)
AmazonWebServiceClient
This method is not threadsafe. Endpoints should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit.
Callers can pass in just the endpoint (ex: "ec2.amazonaws.com") or a full
URL, including the protocol (ex: "https://ec2.amazonaws.com"). If the
protocol is not specified here, the default protocol from this client's
ClientConfiguration
will be used, which by default is HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912
setEndpoint
in interface AmazonECS
setEndpoint
in class AmazonWebServiceClient
endpoint
- The endpoint (ex: "ec2.amazonaws.com") or a full URL,
including the protocol (ex: "https://ec2.amazonaws.com") of
the region specific AWS endpoint this client will communicate
with.public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException
AmazonWebServiceClient
Overrides the default endpoint for this client ("http://dynamodb.us-east-1.amazonaws.com/") and explicitly provides an AWS region ID and AWS service name to use when the client calculates a signature for requests. In almost all cases, this region ID and service name are automatically determined from the endpoint, and callers should use the simpler one-argument form of setEndpoint instead of this method.
Callers can pass in just the endpoint (ex:
"dynamodb.us-east-1.amazonaws.com/") or a full URL, including the
protocol (ex: "http://dynamodb.us-east-1.amazonaws.com/"). If the
protocol is not specified here, the default protocol from this client's
ClientConfiguration
will be used, which by default is HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID= 3912
setEndpoint
in class AmazonWebServiceClient
endpoint
- The endpoint (ex: "dynamodb.us-east-1.amazonaws.com/") or a
full URL, including the protocol (ex:
"http://dynamodb.us-east-1.amazonaws.com/") of the region
specific AWS endpoint this client will communicate with.serviceName
- This parameter is ignored.regionId
- The ID of the region in which this service resides AND the
overriding region for signing purposes.IllegalArgumentException
- If any problems are detected with the specified endpoint.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonECS
request
- The originally executed requestCopyright © 2015. All rights reserved.