Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.ecs.model;
 
 
Container for the parameters to the UpdateService operation.

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.

 
 public class UpdateServiceRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.
 
     private String cluster;

    
The name of the service that you want to update.
 
     private String service;

    
The number of instantiations of the task that you would like to place and keep running in your service.
 
     private Integer desiredCount;

    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.
 
     private String taskDefinition;

    
The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.

Returns:
The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.
 
     public String getCluster() {
         return ;
     }
    
    
The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.

Parameters:
cluster The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.
 
     public void setCluster(String cluster) {
        this. = cluster;
    }
    
    
The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.

Returns a reference to this object so that method calls can be chained together.

Parameters:
cluster The short name or full Amazon Resource Name (ARN) of the cluster that your service is running on. If you do not specify a cluster, the default cluster is assumed.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateServiceRequest withCluster(String cluster) {
        this. = cluster;
        return this;
    }

    
The name of the service that you want to update.

Returns:
The name of the service that you want to update.
    public String getService() {
        return ;
    }
    
    
The name of the service that you want to update.

Parameters:
service The name of the service that you want to update.
    public void setService(String service) {
        this. = service;
    }
    
    
The name of the service that you want to update.

Returns a reference to this object so that method calls can be chained together.

Parameters:
service The name of the service that you want to update.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateServiceRequest withService(String service) {
        this. = service;
        return this;
    }

    
The number of instantiations of the task that you would like to place and keep running in your service.

Returns:
The number of instantiations of the task that you would like to place and keep running in your service.
    public Integer getDesiredCount() {
        return ;
    }
    
    
The number of instantiations of the task that you would like to place and keep running in your service.

Parameters:
desiredCount The number of instantiations of the task that you would like to place and keep running in your service.
    public void setDesiredCount(Integer desiredCount) {
        this. = desiredCount;
    }
    
    
The number of instantiations of the task that you would like to place and keep running in your service.

Returns a reference to this object so that method calls can be chained together.

Parameters:
desiredCount The number of instantiations of the task that you would like to place and keep running in your service.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateServiceRequest withDesiredCount(Integer desiredCount) {
        this. = desiredCount;
        return this;
    }

    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.

Returns:
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.
    public String getTaskDefinition() {
        return ;
    }
    
    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.

Parameters:
taskDefinition The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.
    public void setTaskDefinition(String taskDefinition) {
        this. = taskDefinition;
    }
    
    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
taskDefinition The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service. 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.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateServiceRequest withTaskDefinition(String taskDefinition) {
        this. = taskDefinition;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCluster() != nullsb.append("Cluster: " + getCluster() + ",");
        if (getService() != nullsb.append("Service: " + getService() + ",");
        if (getDesiredCount() != nullsb.append("DesiredCount: " + getDesiredCount() + ",");
        if (getTaskDefinition() != nullsb.append("TaskDefinition: " + getTaskDefinition() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCluster() == null) ? 0 : getCluster().hashCode()); 
        hashCode = prime * hashCode + ((getService() == null) ? 0 : getService().hashCode()); 
        hashCode = prime * hashCode + ((getDesiredCount() == null) ? 0 : getDesiredCount().hashCode()); 
        hashCode = prime * hashCode + ((getTaskDefinition() == null) ? 0 : getTaskDefinition().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof UpdateServiceRequest == falsereturn false;
        UpdateServiceRequest other = (UpdateServiceRequest)obj;
        
        if (other.getCluster() == null ^ this.getCluster() == nullreturn false;
        if (other.getCluster() != null && other.getCluster().equals(this.getCluster()) == falsereturn false
        if (other.getService() == null ^ this.getService() == nullreturn false;
        if (other.getService() != null && other.getService().equals(this.getService()) == falsereturn false
        if (other.getDesiredCount() == null ^ this.getDesiredCount() == nullreturn false;
        if (other.getDesiredCount() != null && other.getDesiredCount().equals(this.getDesiredCount()) == falsereturn false
        if (other.getTaskDefinition() == null ^ this.getTaskDefinition() == nullreturn false;
        if (other.getTaskDefinition() != null && other.getTaskDefinition().equals(this.getTaskDefinition()) == falsereturn false
        return true;
    }
    
    @Override
    public UpdateServiceRequest clone() {
        
            return (UpdateServiceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X