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 RunTask operation.

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.

 
 public class RunTaskRequest extends AmazonWebServiceRequest implements SerializableCloneable {

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

    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run.
 
     private String taskDefinition;

    
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.
 
     private TaskOverride overrides;

    
The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

 
     private Integer count;

    
 
     private String startedBy;

    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to run your task 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 you want to run your task 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 you want to run your task 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 you want to run your task 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 you want to run your task 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 you want to run your task 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 RunTaskRequest withCluster(String cluster) {
        this. = cluster;
        return this;
    }

    
The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run.

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

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

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.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskRequest withTaskDefinition(String taskDefinition) {
        this. = taskDefinition;
        return this;
    }

    
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.

Returns:
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.
    public TaskOverride getOverrides() {
        return ;
    }
    
    
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.

Parameters:
overrides A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.
    public void setOverrides(TaskOverride overrides) {
        this. = overrides;
    }
    
    
A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.

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

Parameters:
overrides A list of container overrides in JSON format that specify the name of a container in the specified task definition and the command it should run instead of its default. A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskRequest withOverrides(TaskOverride overrides) {
        this. = overrides;
        return this;
    }

    
The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

Returns:
The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

    public Integer getCount() {
        return ;
    }
    
    
The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

Parameters:
count The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

    public void setCount(Integer count) {
        this. = count;
    }
    
    
The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

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

Parameters:
count The number of instantiations of the specified task that you would like to place on your cluster. <important>

The count parameter is limited to 10 tasks per call. </important>

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskRequest withCount(Integer count) {
        this. = count;
        return this;
    }

    

Returns:
    public String getStartedBy() {
        return ;
    }
    
    

Parameters:
startedBy
    public void setStartedBy(String startedBy) {
        this. = startedBy;
    }
    
    

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

Parameters:
startedBy
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunTaskRequest withStartedBy(String startedBy) {
        this. = startedBy;
        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 (getTaskDefinition() != nullsb.append("TaskDefinition: " + getTaskDefinition() + ",");
        if (getOverrides() != nullsb.append("Overrides: " + getOverrides() + ",");
        if (getCount() != nullsb.append("Count: " + getCount() + ",");
        if (getStartedBy() != nullsb.append("StartedBy: " + getStartedBy() );
        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 + ((getTaskDefinition() == null) ? 0 : getTaskDefinition().hashCode()); 
        hashCode = prime * hashCode + ((getOverrides() == null) ? 0 : getOverrides().hashCode()); 
        hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode()); 
        hashCode = prime * hashCode + ((getStartedBy() == null) ? 0 : getStartedBy().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RunTaskRequest == falsereturn false;
        RunTaskRequest other = (RunTaskRequest)obj;
        
        if (other.getCluster() == null ^ this.getCluster() == nullreturn false;
        if (other.getCluster() != null && other.getCluster().equals(this.getCluster()) == falsereturn false
        if (other.getTaskDefinition() == null ^ this.getTaskDefinition() == nullreturn false;
        if (other.getTaskDefinition() != null && other.getTaskDefinition().equals(this.getTaskDefinition()) == falsereturn false
        if (other.getOverrides() == null ^ this.getOverrides() == nullreturn false;
        if (other.getOverrides() != null && other.getOverrides().equals(this.getOverrides()) == falsereturn false
        if (other.getCount() == null ^ this.getCount() == nullreturn false;
        if (other.getCount() != null && other.getCount().equals(this.getCount()) == falsereturn false
        if (other.getStartedBy() == null ^ this.getStartedBy() == nullreturn false;
        if (other.getStartedBy() != null && other.getStartedBy().equals(this.getStartedBy()) == falsereturn false
        return true;
    }
    
    @Override
    public RunTaskRequest clone() {
        
            return (RunTaskRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X