Class Service
- java.lang.Object
-
- com.amazonaws.services.ecs.model.Service
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Service extends Object implements Serializable, Cloneable
Details on a service within a cluster
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Service()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serviceclone()booleanequals(Object obj)StringgetClusterArn()The Amazon Resource Name (ARN) of the cluster that hosts the service.DategetCreatedAt()The Unix time in seconds and milliseconds when the service was created.DeploymentConfigurationgetDeploymentConfiguration()Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.List<Deployment>getDeployments()The current state of deployments for the service.IntegergetDesiredCount()The desired number of instantiations of the task definition to keep running on the service.List<ServiceEvent>getEvents()The event stream for your service.List<LoadBalancer>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.IntegergetPendingCount()The number of tasks in the cluster that are in thePENDINGstate.StringgetRoleArn()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.IntegergetRunningCount()The number of tasks in the cluster that are in theRUNNINGstate.StringgetServiceArn()The Amazon Resource Name (ARN) that identifies the service.StringgetServiceName()The name of your service.StringgetStatus()The status of the service.StringgetTaskDefinition()The task definition to use for tasks in the service.inthashCode()voidsetClusterArn(String clusterArn)The Amazon Resource Name (ARN) of the cluster that hosts the service.voidsetCreatedAt(Date createdAt)The Unix time in seconds and milliseconds when the service was created.voidsetDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration)Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.voidsetDeployments(Collection<Deployment> deployments)The current state of deployments for the service.voidsetDesiredCount(Integer desiredCount)The desired number of instantiations of the task definition to keep running on the service.voidsetEvents(Collection<ServiceEvent> events)The event stream for your service.voidsetLoadBalancers(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.voidsetPendingCount(Integer pendingCount)The number of tasks in the cluster that are in thePENDINGstate.voidsetRoleArn(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.voidsetRunningCount(Integer runningCount)The number of tasks in the cluster that are in theRUNNINGstate.voidsetServiceArn(String serviceArn)The Amazon Resource Name (ARN) that identifies the service.voidsetServiceName(String serviceName)The name of your service.voidsetStatus(String status)The status of the service.voidsetTaskDefinition(String taskDefinition)The task definition to use for tasks in the service.StringtoString()Returns a string representation of this object; useful for testing and debugging.ServicewithClusterArn(String clusterArn)The Amazon Resource Name (ARN) of the cluster that hosts the service.ServicewithCreatedAt(Date createdAt)The Unix time in seconds and milliseconds when the service was created.ServicewithDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration)Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.ServicewithDeployments(Deployment... deployments)The current state of deployments for the service.ServicewithDeployments(Collection<Deployment> deployments)The current state of deployments for the service.ServicewithDesiredCount(Integer desiredCount)The desired number of instantiations of the task definition to keep running on the service.ServicewithEvents(ServiceEvent... events)The event stream for your service.ServicewithEvents(Collection<ServiceEvent> events)The event stream for your service.ServicewithLoadBalancers(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.ServicewithLoadBalancers(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.ServicewithPendingCount(Integer pendingCount)The number of tasks in the cluster that are in thePENDINGstate.ServicewithRoleArn(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.ServicewithRunningCount(Integer runningCount)The number of tasks in the cluster that are in theRUNNINGstate.ServicewithServiceArn(String serviceArn)The Amazon Resource Name (ARN) that identifies the service.ServicewithServiceName(String serviceName)The name of your service.ServicewithStatus(String status)The status of the service.ServicewithTaskDefinition(String taskDefinition)The task definition to use for tasks in the service.
-
-
-
Method Detail
-
setServiceArn
public void setServiceArn(String serviceArn)
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, 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:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service.
-
getServiceArn
public String getServiceArn()
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, 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:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, and then the service name. For example,arn:aws:ecs:region:012345678910:service/my-service.
-
withServiceArn
public Service withServiceArn(String serviceArn)
The Amazon Resource Name (ARN) that identifies the service. The ARN contains the
arn:aws:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, 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:ecsnamespace, followed by the region of the service, the AWS account ID of the service owner, theservicenamespace, 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
public void setServiceName(String 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.
- 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
public String 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
public Service withServiceName(String 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.
- 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
public void setClusterArn(String clusterArn)
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
public String 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
public Service withClusterArn(String clusterArn)
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
public List<LoadBalancer> 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
public 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.
- 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
public 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.
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
public Service 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.
- 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
public void setStatus(String status)
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
public String 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
public Service withStatus(String status)
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
public void setDesiredCount(Integer 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.
- 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
public Integer 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
public Service withDesiredCount(Integer 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.
- 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
public void setRunningCount(Integer runningCount)
The number of tasks in the cluster that are in the
RUNNINGstate.- Parameters:
runningCount- The number of tasks in the cluster that are in theRUNNINGstate.
-
getRunningCount
public Integer getRunningCount()
The number of tasks in the cluster that are in the
RUNNINGstate.- Returns:
- The number of tasks in the cluster that are in the
RUNNINGstate.
-
withRunningCount
public Service withRunningCount(Integer runningCount)
The number of tasks in the cluster that are in the
RUNNINGstate.- Parameters:
runningCount- The number of tasks in the cluster that are in theRUNNINGstate.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPendingCount
public void setPendingCount(Integer pendingCount)
The number of tasks in the cluster that are in the
PENDINGstate.- Parameters:
pendingCount- The number of tasks in the cluster that are in thePENDINGstate.
-
getPendingCount
public Integer getPendingCount()
The number of tasks in the cluster that are in the
PENDINGstate.- Returns:
- The number of tasks in the cluster that are in the
PENDINGstate.
-
withPendingCount
public Service withPendingCount(Integer pendingCount)
The number of tasks in the cluster that are in the
PENDINGstate.- Parameters:
pendingCount- The number of tasks in the cluster that are in thePENDINGstate.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTaskDefinition
public void setTaskDefinition(String 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.
- 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
public String 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
public Service withTaskDefinition(String 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.
- 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
public void setDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration)
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
public DeploymentConfiguration 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
public Service withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration)
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
public List<Deployment> getDeployments()
The current state of deployments for the service.
- Returns:
- The current state of deployments for the service.
-
setDeployments
public void setDeployments(Collection<Deployment> deployments)
The current state of deployments for the service.
- Parameters:
deployments- The current state of deployments for the service.
-
withDeployments
public Service withDeployments(Deployment... deployments)
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
public Service withDeployments(Collection<Deployment> deployments)
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
public 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.
- 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
public String 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
public Service 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.
- 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
public List<ServiceEvent> 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
public void setEvents(Collection<ServiceEvent> events)
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
public Service withEvents(ServiceEvent... events)
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
public Service withEvents(Collection<ServiceEvent> events)
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
public void setCreatedAt(Date createdAt)
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
public Date 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
public Service withCreatedAt(Date createdAt)
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
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-