Class Service
- All Implemented Interfaces:
Serializable
,Cloneable
Details on a service within a cluster
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
The Amazon Resource Name (ARN) of the cluster that hosts the service.The Unix time in seconds and milliseconds when the service was created.Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.The current state of deployments for the service.The desired number of instantiations of the task definition to keep running on the service.The event stream for your service.A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.The number of tasks in the cluster that are in thePENDING
state.The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.The number of tasks in the cluster that are in theRUNNING
state.The Amazon Resource Name (ARN) that identifies the service.The name of your service.The status of the service.The task definition to use for tasks in the service.int
hashCode()
void
setClusterArn
(String clusterArn) The Amazon Resource Name (ARN) of the cluster that hosts the service.void
setCreatedAt
(Date createdAt) The Unix time in seconds and milliseconds when the service was created.void
setDeploymentConfiguration
(DeploymentConfiguration deploymentConfiguration) Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.void
setDeployments
(Collection<Deployment> deployments) The current state of deployments for the service.void
setDesiredCount
(Integer desiredCount) The desired number of instantiations of the task definition to keep running on the service.void
setEvents
(Collection<ServiceEvent> events) The event stream for your service.void
setLoadBalancers
(Collection<LoadBalancer> loadBalancers) A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.void
setPendingCount
(Integer pendingCount) The number of tasks in the cluster that are in thePENDING
state.void
setRoleArn
(String roleArn) The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.void
setRunningCount
(Integer runningCount) The number of tasks in the cluster that are in theRUNNING
state.void
setServiceArn
(String serviceArn) The Amazon Resource Name (ARN) that identifies the service.void
setServiceName
(String serviceName) The name of your service.void
The status of the service.void
setTaskDefinition
(String taskDefinition) The task definition to use for tasks in the service.toString()
Returns a string representation of this object; useful for testing and debugging.withClusterArn
(String clusterArn) The Amazon Resource Name (ARN) of the cluster that hosts the service.withCreatedAt
(Date createdAt) The Unix time in seconds and milliseconds when the service was created.withDeploymentConfiguration
(DeploymentConfiguration deploymentConfiguration) Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.withDeployments
(Deployment... deployments) The current state of deployments for the service.withDeployments
(Collection<Deployment> deployments) The current state of deployments for the service.withDesiredCount
(Integer desiredCount) The desired number of instantiations of the task definition to keep running on the service.withEvents
(ServiceEvent... events) The event stream for your service.withEvents
(Collection<ServiceEvent> events) The event stream for your service.withLoadBalancers
(LoadBalancer... loadBalancers) A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.withLoadBalancers
(Collection<LoadBalancer> loadBalancers) A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.withPendingCount
(Integer pendingCount) The number of tasks in the cluster that are in thePENDING
state.withRoleArn
(String roleArn) The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.withRunningCount
(Integer runningCount) The number of tasks in the cluster that are in theRUNNING
state.withServiceArn
(String serviceArn) The Amazon Resource Name (ARN) that identifies the service.withServiceName
(String serviceName) The name of your service.withStatus
(String status) The status of the service.withTaskDefinition
(String taskDefinition) The task definition to use for tasks in the service.
-
Constructor Details
-
Service
public Service()
-
-
Method Details
-
setServiceArn
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.- Parameters:
serviceArn
- The Amazon Resource Name (ARN) that identifies the service. The ARN contains thearn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.
-
getServiceArn
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.- Returns:
- The Amazon Resource Name (ARN) that identifies the service. The
ARN contains the
arn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.
-
withServiceArn
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.- Parameters:
serviceArn
- The Amazon Resource Name (ARN) that identifies the service. The ARN contains thearn:aws:ecs
namespace, followed by the region of the service, the AWS account ID of the service owner, theservice
namespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setServiceName
The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.
- Parameters:
serviceName
- The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.
-
getServiceName
The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.
- Returns:
- The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.
-
withServiceName
The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.
- Parameters:
serviceName
- The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a region or across multiple regions.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setClusterArn
The Amazon Resource Name (ARN) of the cluster that hosts the service.
- Parameters:
clusterArn
- The Amazon Resource Name (ARN) of the cluster that hosts the service.
-
getClusterArn
The Amazon Resource Name (ARN) of the cluster that hosts the service.
- Returns:
- The Amazon Resource Name (ARN) of the cluster that hosts the service.
-
withClusterArn
The Amazon Resource Name (ARN) of the cluster that hosts the service.
- Parameters:
clusterArn
- The Amazon Resource Name (ARN) of the cluster that hosts the service.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getLoadBalancers
A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
- Returns:
- A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
-
setLoadBalancers
A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
- Parameters:
loadBalancers
- A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
-
withLoadBalancers
A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
NOTE: This method appends the values to the existing list (if any). Use
setLoadBalancers(java.util.Collection)
orwithLoadBalancers(java.util.Collection)
if you want to override the existing values.- Parameters:
loadBalancers
- A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withLoadBalancers
A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
- Parameters:
loadBalancers
- A list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStatus
The status of the service. The valid values are
ACTIVE
,DRAINING
, orINACTIVE
.- Parameters:
status
- The status of the service. The valid values areACTIVE
,DRAINING
, orINACTIVE
.
-
getStatus
The status of the service. The valid values are
ACTIVE
,DRAINING
, orINACTIVE
.- Returns:
- The status of the service. The valid values are
ACTIVE
,DRAINING
, orINACTIVE
.
-
withStatus
The status of the service. The valid values are
ACTIVE
,DRAINING
, orINACTIVE
.- Parameters:
status
- The status of the service. The valid values areACTIVE
,DRAINING
, orINACTIVE
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDesiredCount
The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Parameters:
desiredCount
- The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
-
getDesiredCount
The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Returns:
- The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
-
withDesiredCount
The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Parameters:
desiredCount
- The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setRunningCount
The number of tasks in the cluster that are in the
RUNNING
state.- Parameters:
runningCount
- The number of tasks in the cluster that are in theRUNNING
state.
-
getRunningCount
The number of tasks in the cluster that are in the
RUNNING
state.- Returns:
- The number of tasks in the cluster that are in the
RUNNING
state.
-
withRunningCount
The number of tasks in the cluster that are in the
RUNNING
state.- Parameters:
runningCount
- The number of tasks in the cluster that are in theRUNNING
state.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPendingCount
The number of tasks in the cluster that are in the
PENDING
state.- Parameters:
pendingCount
- The number of tasks in the cluster that are in thePENDING
state.
-
getPendingCount
The number of tasks in the cluster that are in the
PENDING
state.- Returns:
- The number of tasks in the cluster that are in the
PENDING
state.
-
withPendingCount
The number of tasks in the cluster that are in the
PENDING
state.- Parameters:
pendingCount
- The number of tasks in the cluster that are in thePENDING
state.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTaskDefinition
The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Parameters:
taskDefinition
- The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
-
getTaskDefinition
The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Returns:
- The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
-
withTaskDefinition
The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.
- Parameters:
taskDefinition
- The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDeploymentConfiguration
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
- Parameters:
deploymentConfiguration
- Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
-
getDeploymentConfiguration
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
- Returns:
- Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
-
withDeploymentConfiguration
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
- Parameters:
deploymentConfiguration
- Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getDeployments
The current state of deployments for the service.
- Returns:
- The current state of deployments for the service.
-
setDeployments
The current state of deployments for the service.
- Parameters:
deployments
- The current state of deployments for the service.
-
withDeployments
The current state of deployments for the service.
NOTE: This method appends the values to the existing list (if any). Use
setDeployments(java.util.Collection)
orwithDeployments(java.util.Collection)
if you want to override the existing values.- Parameters:
deployments
- The current state of deployments for the service.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withDeployments
The current state of deployments for the service.
- Parameters:
deployments
- The current state of deployments for the service.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setRoleArn
The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.
- Parameters:
roleArn
- The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.
-
getRoleArn
The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.
- Returns:
- The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.
-
withRoleArn
The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.
- Parameters:
roleArn
- The Amazon Resource Name (ARN) of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with a load balancer.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getEvents
The event stream for your service. A maximum of 100 of the latest events are displayed.
- Returns:
- The event stream for your service. A maximum of 100 of the latest events are displayed.
-
setEvents
The event stream for your service. A maximum of 100 of the latest events are displayed.
- Parameters:
events
- The event stream for your service. A maximum of 100 of the latest events are displayed.
-
withEvents
The event stream for your service. A maximum of 100 of the latest events are displayed.
NOTE: This method appends the values to the existing list (if any). Use
setEvents(java.util.Collection)
orwithEvents(java.util.Collection)
if you want to override the existing values.- Parameters:
events
- The event stream for your service. A maximum of 100 of the latest events are displayed.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withEvents
The event stream for your service. A maximum of 100 of the latest events are displayed.
- Parameters:
events
- The event stream for your service. A maximum of 100 of the latest events are displayed.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCreatedAt
The Unix time in seconds and milliseconds when the service was created.
- Parameters:
createdAt
- The Unix time in seconds and milliseconds when the service was created.
-
getCreatedAt
The Unix time in seconds and milliseconds when the service was created.
- Returns:
- The Unix time in seconds and milliseconds when the service was created.
-
withCreatedAt
The Unix time in seconds and milliseconds when the service was created.
- Parameters:
createdAt
- The Unix time in seconds and milliseconds when the service was created.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-