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 Service
clone()
boolean
equals(Object obj)
String
getClusterArn()
The Amazon Resource Name (ARN) of the cluster that hosts the service.Date
getCreatedAt()
The Unix time in seconds and milliseconds when the service was created.DeploymentConfiguration
getDeploymentConfiguration()
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.Integer
getDesiredCount()
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.Integer
getPendingCount()
The number of tasks in the cluster that are in thePENDING
state.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.Integer
getRunningCount()
The number of tasks in the cluster that are in theRUNNING
state.String
getServiceArn()
The Amazon Resource Name (ARN) that identifies the service.String
getServiceName()
The name of your service.String
getStatus()
The status of the service.String
getTaskDefinition()
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
setStatus(String status)
The status of the service.void
setTaskDefinition(String taskDefinition)
The task definition to use for tasks in the service.String
toString()
Returns a string representation of this object; useful for testing and debugging.Service
withClusterArn(String clusterArn)
The Amazon Resource Name (ARN) of the cluster that hosts the service.Service
withCreatedAt(Date createdAt)
The Unix time in seconds and milliseconds when the service was created.Service
withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration)
Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.Service
withDeployments(Deployment... deployments)
The current state of deployments for the service.Service
withDeployments(Collection<Deployment> deployments)
The current state of deployments for the service.Service
withDesiredCount(Integer desiredCount)
The desired number of instantiations of the task definition to keep running on the service.Service
withEvents(ServiceEvent... events)
The event stream for your service.Service
withEvents(Collection<ServiceEvent> events)
The event stream for your service.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.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.Service
withPendingCount(Integer pendingCount)
The number of tasks in the cluster that are in thePENDING
state.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.Service
withRunningCount(Integer runningCount)
The number of tasks in the cluster that are in theRUNNING
state.Service
withServiceArn(String serviceArn)
The Amazon Resource Name (ARN) that identifies the service.Service
withServiceName(String serviceName)
The name of your service.Service
withStatus(String status)
The status of the service.Service
withTaskDefinition(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: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
public String 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
public Service withServiceArn(String serviceArn)
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
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
RUNNING
state.- Parameters:
runningCount
- The number of tasks in the cluster that are in theRUNNING
state.
-
getRunningCount
public Integer 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
public Service withRunningCount(Integer runningCount)
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
public void setPendingCount(Integer pendingCount)
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
public Integer 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
public Service withPendingCount(Integer pendingCount)
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
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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-