Class: Aws::EC2::Volume
- Inherits:
-
Object
- Object
- Aws::EC2::Volume
- Extended by:
- Deprecations
- Defined in:
- sig/volume.rbs,
lib/aws-sdk-ec2/volume.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#attachments ⇒ Array<Types::VolumeAttachment>
This parameter is not returned by CreateVolume. -
#availability_zone ⇒ String
The Availability Zone for the volume.
-
#availability_zone_id ⇒ String
The ID of the Availability Zone for the volume.
-
#create_time ⇒ Time
The time stamp when volume creation was initiated.
-
#encrypted ⇒ Boolean
Indicates whether the volume is encrypted.
-
#fast_restored ⇒ Boolean
This parameter is not returned by CreateVolume. - #id ⇒ String (also: #volume_id)
-
#iops ⇒ Integer
The number of I/O operations per second (IOPS).
-
#kms_key_id ⇒ String
The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.
-
#multi_attach_enabled ⇒ Boolean
Indicates whether Amazon EBS Multi-Attach is enabled.
-
#operator ⇒ Types::OperatorResponse
The service provider that manages the volume.
-
#outpost_arn ⇒ String
The Amazon Resource Name (ARN) of the Outpost.
-
#size ⇒ Integer
The size of the volume, in GiBs.
-
#snapshot_id ⇒ String
The snapshot from which the volume was created, if applicable.
-
#source_volume_id ⇒ String
The ID of the source volume from which the volume copy was created.
-
#sse_type ⇒ String
This parameter is not returned by CreateVolume. -
#state ⇒ String
The volume state.
-
#tags ⇒ Array<Types::Tag>
Any tags assigned to the volume.
-
#throughput ⇒ Integer
The throughput that the volume supports, in MiB/s.
-
#volume_initialization_rate ⇒ Integer
The Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate) specified for the volume during creation, in MiB/s.
-
#volume_type ⇒ String
The volume type.
Actions collapse
- #attach_to_instance(options = {}) ⇒ Types::VolumeAttachment
- #create_snapshot(options = {}) ⇒ Snapshot
- #create_tags(options = {}) ⇒ Tag::Collection
- #delete(options = {}) ⇒ EmptyStructure
- #delete_tags(options = {}) ⇒ Tag::Collection
- #describe_attribute(options = {}) ⇒ Types::DescribeVolumeAttributeResult
- #describe_status(options = {}) ⇒ Types::DescribeVolumeStatusResult
- #detach_from_instance(options = {}) ⇒ Types::VolumeAttachment
- #enable_io(options = {}) ⇒ EmptyStructure
- #modify_attribute(options = {}) ⇒ EmptyStructure
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #snapshots(options = {}) ⇒ Snapshot::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Volume
Returns the data for this Volume.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ Volume
constructor
A new instance of Volume.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
Constructor Details
Instance Method Details
#attach_to_instance(options = {}) ⇒ Types::VolumeAttachment
95 |
# File 'sig/volume.rbs', line 95
def attach_to_instance: (
|
#attachments ⇒ Array<Types::VolumeAttachment>
Information about the volume attachments.
73 |
# File 'sig/volume.rbs', line 73
def attachments: () -> ::Array[Types::VolumeAttachment]
|
#availability_zone ⇒ String
The Availability Zone for the volume.
64 |
# File 'sig/volume.rbs', line 64
def availability_zone: () -> ::String
|
#availability_zone_id ⇒ String
The ID of the Availability Zone for the volume.
22 |
# File 'sig/volume.rbs', line 22
def availability_zone_id: () -> ::String
|
#create_snapshot(options = {}) ⇒ Snapshot
104 |
# File 'sig/volume.rbs', line 104
def create_snapshot: (
|
#create_tags(options = {}) ⇒ Tag::Collection
124 |
# File 'sig/volume.rbs', line 124
def create_tags: (
|
#create_time ⇒ Time
The time stamp when volume creation was initiated.
70 |
# File 'sig/volume.rbs', line 70
def create_time: () -> ::Time
|
#data ⇒ Types::Volume
Returns the data for this Aws::EC2::Volume. Calls
Client#describe_volumes if #data_loaded? is false.
88 |
# File 'sig/volume.rbs', line 88
def data: () -> Types::Volume
|
#data_loaded? ⇒ Boolean
91 |
# File 'sig/volume.rbs', line 91
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
148 |
# File 'sig/volume.rbs', line 148
def delete: (
|
#delete_tags(options = {}) ⇒ Tag::Collection
136 |
# File 'sig/volume.rbs', line 136
def delete_tags: (
|
#describe_attribute(options = {}) ⇒ Types::DescribeVolumeAttributeResult
154 |
# File 'sig/volume.rbs', line 154
def describe_attribute: (
|
#describe_status(options = {}) ⇒ Types::DescribeVolumeStatusResult
161 |
# File 'sig/volume.rbs', line 161
def describe_status: (
|
#detach_from_instance(options = {}) ⇒ Types::VolumeAttachment
176 |
# File 'sig/volume.rbs', line 176
def detach_from_instance: (
|
#enable_io(options = {}) ⇒ EmptyStructure
185 |
# File 'sig/volume.rbs', line 185
def enable_io: (
|
#encrypted ⇒ Boolean
Indicates whether the volume is encrypted.
76 |
# File 'sig/volume.rbs', line 76
def encrypted: () -> bool
|
#fast_restored ⇒ Boolean
Indicates whether the volume was created using fast snapshot restore.
40 |
# File 'sig/volume.rbs', line 40
def fast_restored: () -> bool
|
#id ⇒ String Also known as: volume_id
18 |
# File 'sig/volume.rbs', line 18
def id: () -> String
|
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
818 819 820 |
# File 'lib/aws-sdk-ec2/volume.rb', line 818 def identifiers { id: @id } end |
#iops ⇒ Integer
The number of I/O operations per second (IOPS). For gp3, io1, and
io2 volumes, this represents the number of IOPS that are provisioned
for the volume. For gp2 volumes, this represents the baseline
performance of the volume and the rate at which the volume accumulates
I/O credits for bursting.
31 |
# File 'sig/volume.rbs', line 31
def iops: () -> ::Integer
|
#kms_key_id ⇒ String
The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.
79 |
# File 'sig/volume.rbs', line 79
def kms_key_id: () -> ::String
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::Volume.
Returns self making it possible to chain methods.
volume.reload.data
84 |
# File 'sig/volume.rbs', line 84
def load: () -> self
|
#modify_attribute(options = {}) ⇒ EmptyStructure
191 |
# File 'sig/volume.rbs', line 191
def modify_attribute: (
|
#multi_attach_enabled ⇒ Boolean
Indicates whether Amazon EBS Multi-Attach is enabled.
43 |
# File 'sig/volume.rbs', line 43
def multi_attach_enabled: () -> bool
|
#operator ⇒ Types::OperatorResponse
The service provider that manages the volume.
52 |
# File 'sig/volume.rbs', line 52
def operator: () -> Types::OperatorResponse
|
#outpost_arn ⇒ String
The Amazon Resource Name (ARN) of the Outpost.
25 |
# File 'sig/volume.rbs', line 25
def outpost_arn: () -> ::String
|
#size ⇒ Integer
The size of the volume, in GiBs.
58 |
# File 'sig/volume.rbs', line 58
def size: () -> ::Integer
|
#snapshot_id ⇒ String
The snapshot from which the volume was created, if applicable.
61 |
# File 'sig/volume.rbs', line 61
def snapshot_id: () -> ::String
|
#snapshots(options = {}) ⇒ Snapshot::Collection
200 |
# File 'sig/volume.rbs', line 200
def snapshots: (
|
#source_volume_id ⇒ String
The ID of the source volume from which the volume copy was created. Only for volume copies.
28 |
# File 'sig/volume.rbs', line 28
def source_volume_id: () -> ::String
|
#sse_type ⇒ String
Reserved for future use.
49 |
# File 'sig/volume.rbs', line 49
def sse_type: () -> ("sse-ebs" | "sse-kms" | "none")
|
#state ⇒ String
The volume state.
67 |
# File 'sig/volume.rbs', line 67
def state: () -> ("creating" | "available" | "in-use" | "deleting" | "deleted" | "error")
|
#tags ⇒ Array<Types::Tag>
Any tags assigned to the volume.
34 |
# File 'sig/volume.rbs', line 34
def tags: () -> ::Array[Types::Tag]
|
#throughput ⇒ Integer
The throughput that the volume supports, in MiB/s.
46 |
# File 'sig/volume.rbs', line 46
def throughput: () -> ::Integer
|
#volume_initialization_rate ⇒ Integer
The Amazon EBS Provisioned Rate for Volume Initialization (volume
initialization rate) specified for the volume during creation, in
MiB/s. If no volume initialization rate was specified, the value is
null.
55 |
# File 'sig/volume.rbs', line 55
def volume_initialization_rate: () -> ::Integer
|
#volume_type ⇒ String
The volume type.
37 |
# File 'sig/volume.rbs', line 37
def volume_type: () -> ("standard" | "io1" | "io2" | "gp2" | "sc1" | "st1" | "gp3")
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::EC2::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/aws-sdk-ec2/volume.rb', line 296 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |