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

NOTE: This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.

Registers an Amazon EC2 instance into the specified cluster. This instance will become available to place containers on.

 
 public class RegisterContainerInstanceRequest extends AmazonWebServiceRequest implements SerializableCloneable {

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

    
The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/
 
     private String instanceIdentityDocument;

    
The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
 
     private String instanceIdentityDocumentSignature;

    
The resources available on the instance.
 
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
 
     private VersionInfo versionInfo;

    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. 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 register your container instance with. 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 register your container instance with. 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 register your container instance with. 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 register your container instance with. 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 register your container instance with. 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.
        this. = cluster;
        return this;
    }

    
The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/

Returns:
The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/
        return ;
    }
    
    
The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/

Parameters:
instanceIdentityDocument The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/
    public void setInstanceIdentityDocument(String instanceIdentityDocument) {
        this. = instanceIdentityDocument;
    }
    
    
The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/

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

Parameters:
instanceIdentityDocument The instance identity document for the Amazon EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withInstanceIdentityDocument(String instanceIdentityDocument) {
        this. = instanceIdentityDocument;
        return this;
    }

    
The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/

Returns:
The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
        return ;
    }
    
    
The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/

Parameters:
instanceIdentityDocumentSignature The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
    public void setInstanceIdentityDocumentSignature(String instanceIdentityDocumentSignature) {
        this. = instanceIdentityDocumentSignature;
    }
    
    
The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/

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

Parameters:
instanceIdentityDocumentSignature The instance identity document signature for the Amazon EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withInstanceIdentityDocumentSignature(String instanceIdentityDocumentSignature) {
        this. = instanceIdentityDocumentSignature;
        return this;
    }

    
The resources available on the instance.

Returns:
The resources available on the instance.
    public java.util.List<ResourcegetTotalResources() {
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The resources available on the instance.

Parameters:
totalResources The resources available on the instance.
    public void setTotalResources(java.util.Collection<ResourcetotalResources) {
        if (totalResources == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<ResourcetotalResourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Resource>(totalResources.size());
        totalResourcesCopy.addAll(totalResources);
        this. = totalResourcesCopy;
    }
    
    
The resources available on the instance.

NOTE: This method appends the values to the existing list (if any). Use setTotalResources(java.util.Collection) or withTotalResources(java.util.Collection) if you want to override the existing values.

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

Parameters:
totalResources The resources available on the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withTotalResources(Resource... totalResources) {
        if (getTotalResources() == nullsetTotalResources(new java.util.ArrayList<Resource>(totalResources.length));
        for (Resource value : totalResources) {
            getTotalResources().add(value);
        }
        return this;
    }
    
    
The resources available on the instance.

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

Parameters:
totalResources The resources available on the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (totalResources == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ResourcetotalResourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Resource>(totalResources.size());
            totalResourcesCopy.addAll(totalResources);
            this. = totalResourcesCopy;
        }
        return this;
    }

    
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

Returns:
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
    public VersionInfo getVersionInfo() {
        return ;
    }
    
    
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

Parameters:
versionInfo The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
    public void setVersionInfo(VersionInfo versionInfo) {
        this. = versionInfo;
    }
    
    
The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

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

Parameters:
versionInfo The version information for the Amazon ECS container agent and Docker daemon running on the container instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = versionInfo;
        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 (getInstanceIdentityDocument() != nullsb.append("InstanceIdentityDocument: " + getInstanceIdentityDocument() + ",");
        if (getInstanceIdentityDocumentSignature() != nullsb.append("InstanceIdentityDocumentSignature: " + getInstanceIdentityDocumentSignature() + ",");
        if (getTotalResources() != nullsb.append("TotalResources: " + getTotalResources() + ",");
        if (getVersionInfo() != nullsb.append("VersionInfo: " + getVersionInfo() );
        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 + ((getInstanceIdentityDocument() == null) ? 0 : getInstanceIdentityDocument().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIdentityDocumentSignature() == null) ? 0 : getInstanceIdentityDocumentSignature().hashCode()); 
        hashCode = prime * hashCode + ((getTotalResources() == null) ? 0 : getTotalResources().hashCode()); 
        hashCode = prime * hashCode + ((getVersionInfo() == null) ? 0 : getVersionInfo().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RegisterContainerInstanceRequest == falsereturn false;
        
        if (other.getCluster() == null ^ this.getCluster() == nullreturn false;
        if (other.getCluster() != null && other.getCluster().equals(this.getCluster()) == falsereturn false
        if (other.getInstanceIdentityDocument() == null ^ this.getInstanceIdentityDocument() == nullreturn false;
        if (other.getInstanceIdentityDocument() != null && other.getInstanceIdentityDocument().equals(this.getInstanceIdentityDocument()) == falsereturn false
        if (other.getInstanceIdentityDocumentSignature() == null ^ this.getInstanceIdentityDocumentSignature() == nullreturn false;
        if (other.getInstanceIdentityDocumentSignature() != null && other.getInstanceIdentityDocumentSignature().equals(this.getInstanceIdentityDocumentSignature()) == falsereturn false
        if (other.getTotalResources() == null ^ this.getTotalResources() == nullreturn false;
        if (other.getTotalResources() != null && other.getTotalResources().equals(this.getTotalResources()) == falsereturn false
        if (other.getVersionInfo() == null ^ this.getVersionInfo() == nullreturn false;
        if (other.getVersionInfo() != null && other.getVersionInfo().equals(this.getVersionInfo()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (RegisterContainerInstanceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X