com.amazonaws.services.ec2.model
Class CreateVolumeRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateVolumeRequest
All Implemented Interfaces:
DryRunSupportedRequest<CreateVolumeRequest>, java.io.Serializable

public class CreateVolumeRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<CreateVolumeRequest>

Container for the parameters to the CreateVolume operation.

Creates an Amazon EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the specified region.

You can create a new empty volume or restore a volume from an Amazon EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes with the Encrypted parameter. Encrypted volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .

For more information, see Creating or Restoring an Amazon EBS Volume in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.createVolume(CreateVolumeRequest), Serialized Form

Constructor Summary
CreateVolumeRequest()
          Default constructor for a new CreateVolumeRequest object.
CreateVolumeRequest(java.lang.Integer size, java.lang.String availabilityZone)
          Constructs a new CreateVolumeRequest object.
CreateVolumeRequest(java.lang.String snapshotId, java.lang.String availabilityZone)
          Constructs a new CreateVolumeRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAvailabilityZone()
          The Availability Zone in which to create the volume.
 Request<CreateVolumeRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.Boolean getEncrypted()
          Specifies whether the volume should be encrypted.
 java.lang.Integer getIops()
          The number of I/O operations per second (IOPS) that the volume supports.
 java.lang.Integer getSize()
          The size of the volume, in GiBs.
 java.lang.String getSnapshotId()
          The snapshot from which to create the volume.
 java.lang.String getVolumeType()
          The volume type.
 int hashCode()
           
 java.lang.Boolean isEncrypted()
          Specifies whether the volume should be encrypted.
 void setAvailabilityZone(java.lang.String availabilityZone)
          The Availability Zone in which to create the volume.
 void setEncrypted(java.lang.Boolean encrypted)
          Specifies whether the volume should be encrypted.
 void setIops(java.lang.Integer iops)
          The number of I/O operations per second (IOPS) that the volume supports.
 void setSize(java.lang.Integer size)
          The size of the volume, in GiBs.
 void setSnapshotId(java.lang.String snapshotId)
          The snapshot from which to create the volume.
 void setVolumeType(java.lang.String volumeType)
          The volume type.
 void setVolumeType(VolumeType volumeType)
          The volume type.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateVolumeRequest withAvailabilityZone(java.lang.String availabilityZone)
          The Availability Zone in which to create the volume.
 CreateVolumeRequest withEncrypted(java.lang.Boolean encrypted)
          Specifies whether the volume should be encrypted.
 CreateVolumeRequest withIops(java.lang.Integer iops)
          The number of I/O operations per second (IOPS) that the volume supports.
 CreateVolumeRequest withSize(java.lang.Integer size)
          The size of the volume, in GiBs.
 CreateVolumeRequest withSnapshotId(java.lang.String snapshotId)
          The snapshot from which to create the volume.
 CreateVolumeRequest withVolumeType(java.lang.String volumeType)
          The volume type.
 CreateVolumeRequest withVolumeType(VolumeType volumeType)
          The volume type.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateVolumeRequest

public CreateVolumeRequest()
Default constructor for a new CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


CreateVolumeRequest

public CreateVolumeRequest(java.lang.Integer size,
                           java.lang.String availabilityZone)
Constructs a new CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
size - The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

CreateVolumeRequest

public CreateVolumeRequest(java.lang.String snapshotId,
                           java.lang.String availabilityZone)
Constructs a new CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
snapshotId - The snapshot from which to create the volume.
availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
Method Detail

getSize

public java.lang.Integer getSize()
The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

Returns:
The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.


setSize

public void setSize(java.lang.Integer size)
The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

Parameters:
size - The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.


withSize

public CreateVolumeRequest withSize(java.lang.Integer size)
The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

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

Parameters:
size - The size of the volume, in GiBs.

Constraints: If the volume type is io1, the minimum size of the volume is 10 GiB.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

Returns:
A reference to this updated object so that method calls can be chained together.

getSnapshotId

public java.lang.String getSnapshotId()
The snapshot from which to create the volume.

Returns:
The snapshot from which to create the volume.

setSnapshotId

public void setSnapshotId(java.lang.String snapshotId)
The snapshot from which to create the volume.

Parameters:
snapshotId - The snapshot from which to create the volume.

withSnapshotId

public CreateVolumeRequest withSnapshotId(java.lang.String snapshotId)
The snapshot from which to create the volume.

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

Parameters:
snapshotId - The snapshot from which to create the volume.
Returns:
A reference to this updated object so that method calls can be chained together.

getAvailabilityZone

public java.lang.String getAvailabilityZone()
The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

Returns:
The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

setAvailabilityZone

public void setAvailabilityZone(java.lang.String availabilityZone)
The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

Parameters:
availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

withAvailabilityZone

public CreateVolumeRequest withAvailabilityZone(java.lang.String availabilityZone)
The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

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

Parameters:
availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
Returns:
A reference to this updated object so that method calls can be chained together.

getVolumeType

public java.lang.String getVolumeType()
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

Constraints:
Allowed Values: standard, io1

Returns:
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

See Also:
VolumeType

setVolumeType

public void setVolumeType(java.lang.String volumeType)
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

Constraints:
Allowed Values: standard, io1

Parameters:
volumeType - The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

See Also:
VolumeType

withVolumeType

public CreateVolumeRequest withVolumeType(java.lang.String volumeType)
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

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

Constraints:
Allowed Values: standard, io1

Parameters:
volumeType - The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
VolumeType

setVolumeType

public void setVolumeType(VolumeType volumeType)
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

Constraints:
Allowed Values: standard, io1

Parameters:
volumeType - The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

See Also:
VolumeType

withVolumeType

public CreateVolumeRequest withVolumeType(VolumeType volumeType)
The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

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

Constraints:
Allowed Values: standard, io1

Parameters:
volumeType - The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes.

Default: standard

Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
VolumeType

getIops

public java.lang.Integer getIops()
The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.

Returns:
The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.

setIops

public void setIops(java.lang.Integer iops)
The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.

Parameters:
iops - The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.

withIops

public CreateVolumeRequest withIops(java.lang.Integer iops)
The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.

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

Parameters:
iops - The number of I/O operations per second (IOPS) that the volume supports. This parameter is not used with Magnetic or General Purpose (SSD) volumes, but is required when the volume type is io1.
Returns:
A reference to this updated object so that method calls can be chained together.

isEncrypted

public java.lang.Boolean isEncrypted()
Specifies whether the volume should be encrypted.

Returns:
Specifies whether the volume should be encrypted.

setEncrypted

public void setEncrypted(java.lang.Boolean encrypted)
Specifies whether the volume should be encrypted.

Parameters:
encrypted - Specifies whether the volume should be encrypted.

withEncrypted

public CreateVolumeRequest withEncrypted(java.lang.Boolean encrypted)
Specifies whether the volume should be encrypted.

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

Parameters:
encrypted - Specifies whether the volume should be encrypted.
Returns:
A reference to this updated object so that method calls can be chained together.

getEncrypted

public java.lang.Boolean getEncrypted()
Specifies whether the volume should be encrypted.

Returns:
Specifies whether the volume should be encrypted.

getDryRunRequest

public Request<CreateVolumeRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<CreateVolumeRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.