com.amazonaws.services.ec2.model
Class CreateVolumeRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateVolumeRequest

public class CreateVolumeRequest
extends AmazonWebServiceRequest

Container for the parameters to the CreateVolume operation.

Initializes an empty volume of a given size.

See Also:
AmazonEC2.createVolume(CreateVolumeRequest)

Constructor Summary
CreateVolumeRequest()
          Default constructor for a new CreateVolumeRequest object.
CreateVolumeRequest(Integer size, String availabilityZone)
          Constructs a new CreateVolumeRequest object.
CreateVolumeRequest(String snapshotId, String availabilityZone)
          Constructs a new CreateVolumeRequest object.
 
Method Summary
 boolean equals(Object obj)
           
 String getAvailabilityZone()
          The Availability Zone in which to create the new volume.
 Integer getSize()
          The size of the volume, in gigabytes.
 String getSnapshotId()
          The ID of the snapshot from which to create the new volume.
 int hashCode()
           
 void setAvailabilityZone(String availabilityZone)
          The Availability Zone in which to create the new volume.
 void setSize(Integer size)
          The size of the volume, in gigabytes.
 void setSnapshotId(String snapshotId)
          The ID of the snapshot from which to create the new volume.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateVolumeRequest withAvailabilityZone(String availabilityZone)
          The Availability Zone in which to create the new volume.
 CreateVolumeRequest withSize(Integer size)
          The size of the volume, in gigabytes.
 CreateVolumeRequest withSnapshotId(String snapshotId)
          The ID of the snapshot from which to create the new volume.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentials
 
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(Integer size,
                           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 gigabytes. Required if you are not creating a volume from a snapshot.
availabilityZone - The Availability Zone in which to create the new volume.

CreateVolumeRequest

public CreateVolumeRequest(String snapshotId,
                           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 ID of the snapshot from which to create the new volume.
availabilityZone - The Availability Zone in which to create the new volume.
Method Detail

getSize

public Integer getSize()
The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.

Returns:
The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.

setSize

public void setSize(Integer size)
The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.

Parameters:
size - The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.

withSize

public CreateVolumeRequest withSize(Integer size)
The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.

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

Parameters:
size - The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.

getSnapshotId

public String getSnapshotId()
The ID of the snapshot from which to create the new volume.

Returns:
The ID of the snapshot from which to create the new volume.

setSnapshotId

public void setSnapshotId(String snapshotId)
The ID of the snapshot from which to create the new volume.

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

withSnapshotId

public CreateVolumeRequest withSnapshotId(String snapshotId)
The ID of the snapshot from which to create the new volume.

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

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

getAvailabilityZone

public String getAvailabilityZone()
The Availability Zone in which to create the new volume.

Returns:
The Availability Zone in which to create the new volume.

setAvailabilityZone

public void setAvailabilityZone(String availabilityZone)
The Availability Zone in which to create the new volume.

Parameters:
availabilityZone - The Availability Zone in which to create the new volume.

withAvailabilityZone

public CreateVolumeRequest withAvailabilityZone(String availabilityZone)
The Availability Zone in which to create the new volume.

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

Parameters:
availabilityZone - The Availability Zone in which to create the new volume.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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