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.ec2.model;
 
 
Container for the parameters to the RegisterImage operation.

Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide .

NOTE: For Amazon EBS-backed instances, CreateImage creates and registers the AMI in a single request, so you don't have to register the AMI yourself.

You can also use RegisterImage to create an Amazon EBS-backed AMI from a snapshot of a root device volume. For more information, see Launching an Instance from a Snapshot in the Amazon Elastic Compute Cloud User Guide .

If needed, you can deregister an AMI at any time. Any modifications you make to an AMI backed by an instance store volume invalidates its registration. If you make changes to an image, deregister the previous image and register the new image.

NOTE: You can't register an image where a secondary (non-root) snapshot has AWS Marketplace product codes.

 
The full path to your AMI manifest in Amazon S3 storage.
 
     private String imageLocation;

    
A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

 
     private String name;

    
A description for your AMI.
 
     private String description;

    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Constraints:
Allowed Values: i386, x86_64

 
     private String architecture;

    
The ID of the kernel.
 
     private String kernelId;

    
The ID of the RAM disk.
 
     private String ramdiskId;

    
The name of the root device (for example, /dev/sda1, or /dev/xvda).
    private String rootDeviceName;

    
One or more block device mapping entries.
The type of virtualization.

Default: paravirtual

    private String virtualizationType;

    
Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

    private String sriovNetSupport;

    
Default constructor for a new RegisterImageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
    public RegisterImageRequest() {}
    
    
Constructs a new RegisterImageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
imageLocation The full path to your AMI manifest in Amazon S3 storage.
    public RegisterImageRequest(String imageLocation) {
        setImageLocation(imageLocation);
    }

    
The full path to your AMI manifest in Amazon S3 storage.

Returns:
The full path to your AMI manifest in Amazon S3 storage.
    public String getImageLocation() {
        return ;
    }
    
    
The full path to your AMI manifest in Amazon S3 storage.

Parameters:
imageLocation The full path to your AMI manifest in Amazon S3 storage.
    public void setImageLocation(String imageLocation) {
        this. = imageLocation;
    }
    
    
The full path to your AMI manifest in Amazon S3 storage.

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

Parameters:
imageLocation The full path to your AMI manifest in Amazon S3 storage.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withImageLocation(String imageLocation) {
        this. = imageLocation;
        return this;
    }

    
A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Returns:
A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

    public String getName() {
        return ;
    }
    
    
A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Parameters:
name A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

    public void setName(String name) {
        this. = name;
    }
    
    
A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

Parameters:
name A name for your AMI.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withName(String name) {
        this. = name;
        return this;
    }

    
A description for your AMI.

Returns:
A description for your AMI.
    public String getDescription() {
        return ;
    }
    
    
A description for your AMI.

Parameters:
description A description for your AMI.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description for your AMI.

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

Parameters:
description A description for your AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withDescription(String description) {
        this. = description;
        return this;
    }

    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Constraints:
Allowed Values: i386, x86_64

Returns:
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

See also:
ArchitectureValues
    public String getArchitecture() {
        return ;
    }
    
    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

See also:
ArchitectureValues
    public void setArchitecture(String architecture) {
        this. = architecture;
    }
    
    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

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

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
    public RegisterImageRequest withArchitecture(String architecture) {
        this. = architecture;
        return this;
    }

    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

See also:
ArchitectureValues
    public void setArchitecture(ArchitectureValues architecture) {
        this. = architecture.toString();
    }
    
    
The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

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

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the AMI.

Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, the architecture specified in the manifest file.

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
        this. = architecture.toString();
        return this;
    }

    
The ID of the kernel.

Returns:
The ID of the kernel.
    public String getKernelId() {
        return ;
    }
    
    
The ID of the kernel.

Parameters:
kernelId The ID of the kernel.
    public void setKernelId(String kernelId) {
        this. = kernelId;
    }
    
    
The ID of the kernel.

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

Parameters:
kernelId The ID of the kernel.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withKernelId(String kernelId) {
        this. = kernelId;
        return this;
    }

    
The ID of the RAM disk.

Returns:
The ID of the RAM disk.
    public String getRamdiskId() {
        return ;
    }
    
    
The ID of the RAM disk.

Parameters:
ramdiskId The ID of the RAM disk.
    public void setRamdiskId(String ramdiskId) {
        this. = ramdiskId;
    }
    
    
The ID of the RAM disk.

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

Parameters:
ramdiskId The ID of the RAM disk.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withRamdiskId(String ramdiskId) {
        this. = ramdiskId;
        return this;
    }

    
The name of the root device (for example, /dev/sda1, or /dev/xvda).

Returns:
The name of the root device (for example, /dev/sda1, or /dev/xvda).
    public String getRootDeviceName() {
        return ;
    }
    
    
The name of the root device (for example, /dev/sda1, or /dev/xvda).

Parameters:
rootDeviceName The name of the root device (for example, /dev/sda1, or /dev/xvda).
    public void setRootDeviceName(String rootDeviceName) {
        this. = rootDeviceName;
    }
    
    
The name of the root device (for example, /dev/sda1, or /dev/xvda).

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

Parameters:
rootDeviceName The name of the root device (for example, /dev/sda1, or /dev/xvda).
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withRootDeviceName(String rootDeviceName) {
        this. = rootDeviceName;
        return this;
    }

    
One or more block device mapping entries.

Returns:
One or more block device mapping entries.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more block device mapping entries.

Parameters:
blockDeviceMappings One or more block device mapping entries.
    public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        if (blockDeviceMappings == null) {
            this. = null;
            return;
        }
        blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        this. = blockDeviceMappingsCopy;
    }
    
    
One or more block device mapping entries.

NOTE: This method appends the values to the existing list (if any). Use setBlockDeviceMappings(java.util.Collection) or withBlockDeviceMappings(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:
blockDeviceMappings One or more block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
        if (getBlockDeviceMappings() == nullsetBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
        for (BlockDeviceMapping value : blockDeviceMappings) {
            getBlockDeviceMappings().add(value);
        }
        return this;
    }
    
    
One or more block device mapping entries.

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

Parameters:
blockDeviceMappings One or more block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (blockDeviceMappings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMappingblockDeviceMappingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMapping>(blockDeviceMappings.size());
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
            this. = blockDeviceMappingsCopy;
        }
        return this;
    }

    
The type of virtualization.

Default: paravirtual

Returns:
The type of virtualization.

Default: paravirtual

    public String getVirtualizationType() {
        return ;
    }
    
    
The type of virtualization.

Default: paravirtual

Parameters:
virtualizationType The type of virtualization.

Default: paravirtual

    public void setVirtualizationType(String virtualizationType) {
        this. = virtualizationType;
    }
    
    
The type of virtualization.

Default: paravirtual

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

Parameters:
virtualizationType The type of virtualization.

Default: paravirtual

Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withVirtualizationType(String virtualizationType) {
        this. = virtualizationType;
        return this;
    }

    
Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

Returns:
Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

    public String getSriovNetSupport() {
        return ;
    }
    
    
Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

Parameters:
sriovNetSupport Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

    public void setSriovNetSupport(String sriovNetSupport) {
        this. = sriovNetSupport;
    }
    
    
Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

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

Parameters:
sriovNetSupport Set to simple to enable enhanced networking for the AMI and any instances that you launch from the AMI.

There is no way to disable enhanced networking at this time.

This option is supported only for HVM AMIs. Specifying this option with a PV AMI can make instances launched from the AMI unreachable.

Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterImageRequest withSriovNetSupport(String sriovNetSupport) {
        this. = sriovNetSupport;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<RegisterImageRequestrequest = new RegisterImageRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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 (getImageLocation() != nullsb.append("ImageLocation: " + getImageLocation() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getArchitecture() != nullsb.append("Architecture: " + getArchitecture() + ",");
        if (getKernelId() != nullsb.append("KernelId: " + getKernelId() + ",");
        if (getRamdiskId() != nullsb.append("RamdiskId: " + getRamdiskId() + ",");
        if (getRootDeviceName() != nullsb.append("RootDeviceName: " + getRootDeviceName() + ",");
        if (getBlockDeviceMappings() != nullsb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ",");
        if (getVirtualizationType() != nullsb.append("VirtualizationType: " + getVirtualizationType() + ",");
        if (getSriovNetSupport() != nullsb.append("SriovNetSupport: " + getSriovNetSupport() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getImageLocation() == null) ? 0 : getImageLocation().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); 
        hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); 
        hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); 
        hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode()); 
        hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); 
        hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode()); 
        hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RegisterImageRequest == falsereturn false;
        RegisterImageRequest other = (RegisterImageRequest)obj;
        
        if (other.getImageLocation() == null ^ this.getImageLocation() == nullreturn false;
        if (other.getImageLocation() != null && other.getImageLocation().equals(this.getImageLocation()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getArchitecture() == null ^ this.getArchitecture() == nullreturn false;
        if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == falsereturn false
        if (other.getKernelId() == null ^ this.getKernelId() == nullreturn false;
        if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == falsereturn false
        if (other.getRamdiskId() == null ^ this.getRamdiskId() == nullreturn false;
        if (other.getRamdiskId() != null && other.getRamdiskId().equals(this.getRamdiskId()) == falsereturn false
        if (other.getRootDeviceName() == null ^ this.getRootDeviceName() == nullreturn false;
        if (other.getRootDeviceName() != null && other.getRootDeviceName().equals(this.getRootDeviceName()) == falsereturn false
        if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == nullreturn false;
        if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == falsereturn false
        if (other.getVirtualizationType() == null ^ this.getVirtualizationType() == nullreturn false;
        if (other.getVirtualizationType() != null && other.getVirtualizationType().equals(this.getVirtualizationType()) == falsereturn false
        if (other.getSriovNetSupport() == null ^ this.getSriovNetSupport() == nullreturn false;
        if (other.getSriovNetSupport() != null && other.getSriovNetSupport().equals(this.getSriovNetSupport()) == falsereturn false
        return true;
    }
    
    @Override
    public RegisterImageRequest clone() {
        
            return (RegisterImageRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X