aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-ec2.rb +2 -2
- data/lib/aws-sdk-ec2/classic_address.rb +198 -200
- data/lib/aws-sdk-ec2/client.rb +17169 -14563
- data/lib/aws-sdk-ec2/client_api.rb +6458 -6301
- data/lib/aws-sdk-ec2/dhcp_options.rb +158 -160
- data/lib/aws-sdk-ec2/errors.rb +4 -13
- data/lib/aws-sdk-ec2/image.rb +404 -406
- data/lib/aws-sdk-ec2/instance.rb +1423 -1422
- data/lib/aws-sdk-ec2/internet_gateway.rb +178 -180
- data/lib/aws-sdk-ec2/key_pair.rb +98 -100
- data/lib/aws-sdk-ec2/key_pair_info.rb +102 -104
- data/lib/aws-sdk-ec2/network_acl.rb +326 -328
- data/lib/aws-sdk-ec2/network_interface.rb +428 -430
- data/lib/aws-sdk-ec2/network_interface_association.rb +126 -128
- data/lib/aws-sdk-ec2/placement_group.rb +400 -399
- data/lib/aws-sdk-ec2/resource.rb +2696 -2659
- data/lib/aws-sdk-ec2/route.rb +229 -231
- data/lib/aws-sdk-ec2/route_table.rb +243 -245
- data/lib/aws-sdk-ec2/route_table_association.rb +148 -150
- data/lib/aws-sdk-ec2/security_group.rb +515 -517
- data/lib/aws-sdk-ec2/snapshot.rb +431 -433
- data/lib/aws-sdk-ec2/subnet.rb +981 -977
- data/lib/aws-sdk-ec2/tag.rb +185 -187
- data/lib/aws-sdk-ec2/types.rb +24081 -20965
- data/lib/aws-sdk-ec2/volume.rb +513 -512
- data/lib/aws-sdk-ec2/vpc.rb +1671 -1649
- data/lib/aws-sdk-ec2/vpc_address.rb +189 -191
- data/lib/aws-sdk-ec2/vpc_peering_connection.rb +219 -221
- data/lib/aws-sdk-ec2/waiters.rb +1252 -1210
- metadata +2 -2
data/lib/aws-sdk-ec2/volume.rb
CHANGED
@@ -1,555 +1,556 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::EC2
|
9
|
+
class Volume
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(id, options = {})
|
14
|
+
# @param [String] id
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :id
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@id = extract_id(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :volume_id :id
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The size of the volume, in GiBs.
|
35
|
+
# @return [Integer]
|
36
|
+
def size
|
37
|
+
data.size
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The snapshot from which the volume was created, if applicable.
|
41
|
+
# @return [String]
|
42
|
+
def snapshot_id
|
43
|
+
data.snapshot_id
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The Availability Zone for the volume.
|
47
|
+
# @return [String]
|
48
|
+
def availability_zone
|
49
|
+
data.availability_zone
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
# The volume state.
|
53
|
+
# @return [String]
|
54
|
+
def state
|
55
|
+
data.state
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
# The time stamp when volume creation was initiated.
|
59
|
+
# @return [Time]
|
60
|
+
def create_time
|
61
|
+
data.create_time
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
# Information about the volume attachments.
|
65
|
+
# @return [Array<Types::VolumeAttachment>]
|
66
|
+
def attachments
|
67
|
+
data.attachments
|
68
|
+
end
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
# Any tags assigned to the volume.
|
71
|
+
# @return [Array<Types::Tag>]
|
72
|
+
def tags
|
73
|
+
data.tags
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
76
|
+
# The volume type. This can be `gp2` for General Purpose SSD, `io1` for
|
77
|
+
# Provisioned IOPS SSD, `st1` for Throughput Optimized HDD, `sc1` for
|
78
|
+
# Cold HDD, or `standard` for Magnetic volumes.
|
79
|
+
# @return [String]
|
80
|
+
def volume_type
|
81
|
+
data.volume_type
|
82
|
+
end
|
84
83
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
84
|
+
# The number of I/O operations per second (IOPS) that the volume
|
85
|
+
# supports. For Provisioned IOPS SSD volumes, this represents the number
|
86
|
+
# of IOPS that are provisioned for the volume. For General Purpose SSD
|
87
|
+
# volumes, this represents the baseline performance of the volume and
|
88
|
+
# the rate at which the volume accumulates I/O credits for bursting. For
|
89
|
+
# more information on General Purpose SSD baseline performance, I/O
|
90
|
+
# credits, and bursting, see [Amazon EBS Volume Types][1] in the *Amazon
|
91
|
+
# Elastic Compute Cloud User Guide*.
|
92
|
+
#
|
93
|
+
# Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS
|
94
|
+
# for `gp2` volumes.
|
95
|
+
#
|
96
|
+
# Condition: This parameter is required for requests to create `io1`
|
97
|
+
# volumes; it is not used in requests to create `gp2`, `st1`, `sc1`, or
|
98
|
+
# `standard` volumes.
|
99
|
+
#
|
100
|
+
#
|
101
|
+
#
|
102
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
|
103
|
+
# @return [Integer]
|
104
|
+
def iops
|
105
|
+
data.iops
|
106
|
+
end
|
108
107
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
108
|
+
# Indicates whether the volume will be encrypted.
|
109
|
+
# @return [Boolean]
|
110
|
+
def encrypted
|
111
|
+
data.encrypted
|
112
|
+
end
|
114
113
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
114
|
+
# The full ARN of the AWS Key Management Service (AWS KMS) customer
|
115
|
+
# master key (CMK) that was used to protect the volume encryption key
|
116
|
+
# for the volume.
|
117
|
+
# @return [String]
|
118
|
+
def kms_key_id
|
119
|
+
data.kms_key_id
|
120
|
+
end
|
122
121
|
|
123
|
-
|
122
|
+
# @!endgroup
|
124
123
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
124
|
+
# @return [Client]
|
125
|
+
def client
|
126
|
+
@client
|
127
|
+
end
|
129
128
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
129
|
+
# Loads, or reloads {#data} for the current {Volume}.
|
130
|
+
# Returns `self` making it possible to chain methods.
|
131
|
+
#
|
132
|
+
# volume.reload.data
|
133
|
+
#
|
134
|
+
# @return [self]
|
135
|
+
def load
|
136
|
+
resp = @client.describe_volumes(volume_ids: [@id])
|
137
|
+
@data = resp.volumes[0]
|
138
|
+
self
|
139
|
+
end
|
140
|
+
alias :reload :load
|
141
|
+
|
142
|
+
# @return [Types::Volume]
|
143
|
+
# Returns the data for this {Volume}. Calls
|
144
|
+
# {Client#describe_volumes} if {#data_loaded?} is `false`.
|
145
|
+
def data
|
146
|
+
load unless @data
|
147
|
+
@data
|
148
|
+
end
|
150
149
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
150
|
+
# @return [Boolean]
|
151
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
152
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
153
|
+
def data_loaded?
|
154
|
+
!!@data
|
155
|
+
end
|
157
156
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
157
|
+
# @!group Actions
|
158
|
+
|
159
|
+
# @example Request syntax with placeholder values
|
160
|
+
#
|
161
|
+
# volume.attach_to_instance({
|
162
|
+
# dry_run: false,
|
163
|
+
# instance_id: "String", # required
|
164
|
+
# device: "String", # required
|
165
|
+
# })
|
166
|
+
# @param [Hash] options ({})
|
167
|
+
# @option options [Boolean] :dry_run
|
168
|
+
# Checks whether you have the required permissions for the action,
|
169
|
+
# without actually making the request, and provides an error response.
|
170
|
+
# If you have the required permissions, the error response is
|
171
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
172
|
+
# @option options [required, String] :instance_id
|
173
|
+
# The ID of the instance.
|
174
|
+
# @option options [required, String] :device
|
175
|
+
# The device name to expose to the instance (for example, `/dev/sdh` or
|
176
|
+
# `xvdh`).
|
177
|
+
# @return [Types::VolumeAttachment]
|
178
|
+
def attach_to_instance(options = {})
|
179
|
+
options = options.merge(volume_id: @id)
|
180
|
+
resp = @client.attach_volume(options)
|
181
|
+
resp.data
|
182
|
+
end
|
183
|
+
|
184
|
+
# @example Request syntax with placeholder values
|
185
|
+
#
|
186
|
+
# snapshot = volume.create_snapshot({
|
187
|
+
# dry_run: false,
|
188
|
+
# description: "String",
|
189
|
+
# })
|
190
|
+
# @param [Hash] options ({})
|
191
|
+
# @option options [Boolean] :dry_run
|
192
|
+
# Checks whether you have the required permissions for the action,
|
193
|
+
# without actually making the request, and provides an error response.
|
194
|
+
# If you have the required permissions, the error response is
|
195
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
196
|
+
# @option options [String] :description
|
197
|
+
# A description for the snapshot.
|
198
|
+
# @return [Snapshot]
|
199
|
+
def create_snapshot(options = {})
|
200
|
+
options = options.merge(volume_id: @id)
|
201
|
+
resp = @client.create_snapshot(options)
|
202
|
+
Snapshot.new(
|
203
|
+
id: resp.data.snapshot_id,
|
204
|
+
data: resp.data,
|
205
|
+
client: @client
|
206
|
+
)
|
207
|
+
end
|
184
208
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
209
|
+
# @example Request syntax with placeholder values
|
210
|
+
#
|
211
|
+
# tag = volume.create_tags({
|
212
|
+
# dry_run: false,
|
213
|
+
# tags: [ # required
|
214
|
+
# {
|
215
|
+
# key: "String",
|
216
|
+
# value: "String",
|
217
|
+
# },
|
218
|
+
# ],
|
219
|
+
# })
|
220
|
+
# @param [Hash] options ({})
|
221
|
+
# @option options [Boolean] :dry_run
|
222
|
+
# Checks whether you have the required permissions for the action,
|
223
|
+
# without actually making the request, and provides an error response.
|
224
|
+
# If you have the required permissions, the error response is
|
225
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
226
|
+
# @option options [required, Array<Types::Tag>] :tags
|
227
|
+
# One or more tags. The `value` parameter is required, but if you don't
|
228
|
+
# want the tag to have a value, specify the parameter with no value, and
|
229
|
+
# we set the value to an empty string.
|
230
|
+
# @return [Tag::Collection]
|
231
|
+
def create_tags(options = {})
|
232
|
+
batch = []
|
233
|
+
options = Aws::Util.deep_merge(options, resources: [@id])
|
234
|
+
resp = @client.create_tags(options)
|
235
|
+
options[:tags].each do |t|
|
236
|
+
batch << Tag.new(
|
237
|
+
resource_id: @id,
|
238
|
+
key: t[:key],
|
239
|
+
value: t[:value],
|
206
240
|
client: @client
|
207
241
|
)
|
208
242
|
end
|
243
|
+
Tag::Collection.new([batch], size: batch.size)
|
244
|
+
end
|
209
245
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
# @option options [required, Array<Types::Tag>] :tags
|
228
|
-
# One or more tags. The `value` parameter is required, but if you don't
|
229
|
-
# want the tag to have a value, specify the parameter with no value, and
|
230
|
-
# we set the value to an empty string.
|
231
|
-
# @return [Tag::Collection]
|
232
|
-
def create_tags(options = {})
|
233
|
-
batch = []
|
234
|
-
options = Aws::Util.deep_merge(options, resources: [@id])
|
235
|
-
resp = @client.create_tags(options)
|
236
|
-
options[:tags].each do |t|
|
237
|
-
batch << Tag.new(
|
238
|
-
resource_id: @id,
|
239
|
-
key: t[:key],
|
240
|
-
value: t[:value],
|
241
|
-
client: @client
|
242
|
-
)
|
243
|
-
end
|
244
|
-
Tag::Collection.new([batch], size: batch.size)
|
245
|
-
end
|
246
|
-
|
247
|
-
# @example Request syntax with placeholder values
|
248
|
-
#
|
249
|
-
# volume.delete({
|
250
|
-
# dry_run: false,
|
251
|
-
# })
|
252
|
-
# @param [Hash] options ({})
|
253
|
-
# @option options [Boolean] :dry_run
|
254
|
-
# Checks whether you have the required permissions for the action,
|
255
|
-
# without actually making the request, and provides an error response.
|
256
|
-
# If you have the required permissions, the error response is
|
257
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
258
|
-
# @return [EmptyStructure]
|
259
|
-
def delete(options = {})
|
260
|
-
options = options.merge(volume_id: @id)
|
261
|
-
resp = @client.delete_volume(options)
|
262
|
-
resp.data
|
263
|
-
end
|
246
|
+
# @example Request syntax with placeholder values
|
247
|
+
#
|
248
|
+
# volume.delete({
|
249
|
+
# dry_run: false,
|
250
|
+
# })
|
251
|
+
# @param [Hash] options ({})
|
252
|
+
# @option options [Boolean] :dry_run
|
253
|
+
# Checks whether you have the required permissions for the action,
|
254
|
+
# without actually making the request, and provides an error response.
|
255
|
+
# If you have the required permissions, the error response is
|
256
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
257
|
+
# @return [EmptyStructure]
|
258
|
+
def delete(options = {})
|
259
|
+
options = options.merge(volume_id: @id)
|
260
|
+
resp = @client.delete_volume(options)
|
261
|
+
resp.data
|
262
|
+
end
|
264
263
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
264
|
+
# @example Request syntax with placeholder values
|
265
|
+
#
|
266
|
+
# volume.describe_attribute({
|
267
|
+
# dry_run: false,
|
268
|
+
# attribute: "autoEnableIO", # accepts autoEnableIO, productCodes
|
269
|
+
# })
|
270
|
+
# @param [Hash] options ({})
|
271
|
+
# @option options [Boolean] :dry_run
|
272
|
+
# Checks whether you have the required permissions for the action,
|
273
|
+
# without actually making the request, and provides an error response.
|
274
|
+
# If you have the required permissions, the error response is
|
275
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
276
|
+
# @option options [String] :attribute
|
277
|
+
# The instance attribute.
|
278
|
+
# @return [Types::DescribeVolumeAttributeResult]
|
279
|
+
def describe_attribute(options = {})
|
280
|
+
options = options.merge(volume_id: @id)
|
281
|
+
resp = @client.describe_volume_attribute(options)
|
282
|
+
resp.data
|
283
|
+
end
|
285
284
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
285
|
+
# @example Request syntax with placeholder values
|
286
|
+
#
|
287
|
+
# volume.describe_status({
|
288
|
+
# dry_run: false,
|
289
|
+
# filters: [
|
290
|
+
# {
|
291
|
+
# name: "String",
|
292
|
+
# values: ["String"],
|
293
|
+
# },
|
294
|
+
# ],
|
295
|
+
# next_token: "String",
|
296
|
+
# max_results: 1,
|
297
|
+
# })
|
298
|
+
# @param [Hash] options ({})
|
299
|
+
# @option options [Boolean] :dry_run
|
300
|
+
# Checks whether you have the required permissions for the action,
|
301
|
+
# without actually making the request, and provides an error response.
|
302
|
+
# If you have the required permissions, the error response is
|
303
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
304
|
+
# @option options [Array<Types::Filter>] :filters
|
305
|
+
# One or more filters.
|
306
|
+
#
|
307
|
+
# * `action.code` - The action code for the event (for example,
|
308
|
+
# `enable-volume-io`).
|
309
|
+
#
|
310
|
+
# * `action.description` - A description of the action.
|
311
|
+
#
|
312
|
+
# * `action.event-id` - The event ID associated with the action.
|
313
|
+
#
|
314
|
+
# * `availability-zone` - The Availability Zone of the instance.
|
315
|
+
#
|
316
|
+
# * `event.description` - A description of the event.
|
317
|
+
#
|
318
|
+
# * `event.event-id` - The event ID.
|
319
|
+
#
|
320
|
+
# * `event.event-type` - The event type (for `io-enabled`\: `passed` \|
|
321
|
+
# `failed`; for `io-performance`\: `io-performance:degraded` \|
|
322
|
+
# `io-performance:severely-degraded` \| `io-performance:stalled`).
|
323
|
+
#
|
324
|
+
# * `event.not-after` - The latest end time for the event.
|
325
|
+
#
|
326
|
+
# * `event.not-before` - The earliest start time for the event.
|
327
|
+
#
|
328
|
+
# * `volume-status.details-name` - The cause for `volume-status.status`
|
329
|
+
# (`io-enabled` \| `io-performance`).
|
330
|
+
#
|
331
|
+
# * `volume-status.details-status` - The status of
|
332
|
+
# `volume-status.details-name` (for `io-enabled`\: `passed` \|
|
333
|
+
# `failed`; for `io-performance`\: `normal` \| `degraded` \|
|
334
|
+
# `severely-degraded` \| `stalled`).
|
335
|
+
#
|
336
|
+
# * `volume-status.status` - The status of the volume (`ok` \|
|
337
|
+
# `impaired` \| `warning` \| `insufficient-data`).
|
338
|
+
# @option options [String] :next_token
|
339
|
+
# The `NextToken` value to include in a future `DescribeVolumeStatus`
|
340
|
+
# request. When the results of the request exceed `MaxResults`, this
|
341
|
+
# value can be used to retrieve the next page of results. This value is
|
342
|
+
# `null` when there are no more results to return.
|
343
|
+
# @option options [Integer] :max_results
|
344
|
+
# The maximum number of volume results returned by
|
345
|
+
# `DescribeVolumeStatus` in paginated output. When this parameter is
|
346
|
+
# used, the request only returns `MaxResults` results in a single page
|
347
|
+
# along with a `NextToken` response element. The remaining results of
|
348
|
+
# the initial request can be seen by sending another request with the
|
349
|
+
# returned `NextToken` value. This value can be between 5 and 1000; if
|
350
|
+
# `MaxResults` is given a value larger than 1000, only 1000 results are
|
351
|
+
# returned. If this parameter is not used, then `DescribeVolumeStatus`
|
352
|
+
# returns all results. You cannot specify this parameter and the volume
|
353
|
+
# IDs parameter in the same request.
|
354
|
+
# @return [Types::DescribeVolumeStatusResult]
|
355
|
+
def describe_status(options = {})
|
356
|
+
options = Aws::Util.deep_merge(options, volume_ids: [@id])
|
357
|
+
resp = @client.describe_volume_status(options)
|
358
|
+
resp.data
|
359
|
+
end
|
361
360
|
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
361
|
+
# @example Request syntax with placeholder values
|
362
|
+
#
|
363
|
+
# volume.detach_from_instance({
|
364
|
+
# dry_run: false,
|
365
|
+
# instance_id: "String",
|
366
|
+
# device: "String",
|
367
|
+
# force: false,
|
368
|
+
# })
|
369
|
+
# @param [Hash] options ({})
|
370
|
+
# @option options [Boolean] :dry_run
|
371
|
+
# Checks whether you have the required permissions for the action,
|
372
|
+
# without actually making the request, and provides an error response.
|
373
|
+
# If you have the required permissions, the error response is
|
374
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
375
|
+
# @option options [String] :instance_id
|
376
|
+
# The ID of the instance.
|
377
|
+
# @option options [String] :device
|
378
|
+
# The device name.
|
379
|
+
# @option options [Boolean] :force
|
380
|
+
# Forces detachment if the previous detachment attempt did not occur
|
381
|
+
# cleanly (for example, logging into an instance, unmounting the volume,
|
382
|
+
# and detaching normally). This option can lead to data loss or a
|
383
|
+
# corrupted file system. Use this option only as a last resort to detach
|
384
|
+
# a volume from a failed instance. The instance won't have an
|
385
|
+
# opportunity to flush file system caches or file system metadata. If
|
386
|
+
# you use this option, you must perform file system check and repair
|
387
|
+
# procedures.
|
388
|
+
# @return [Types::VolumeAttachment]
|
389
|
+
def detach_from_instance(options = {})
|
390
|
+
options = options.merge(volume_id: @id)
|
391
|
+
resp = @client.detach_volume(options)
|
392
|
+
resp.data
|
393
|
+
end
|
395
394
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
395
|
+
# @example Request syntax with placeholder values
|
396
|
+
#
|
397
|
+
# volume.enable_io({
|
398
|
+
# dry_run: false,
|
399
|
+
# })
|
400
|
+
# @param [Hash] options ({})
|
401
|
+
# @option options [Boolean] :dry_run
|
402
|
+
# Checks whether you have the required permissions for the action,
|
403
|
+
# without actually making the request, and provides an error response.
|
404
|
+
# If you have the required permissions, the error response is
|
405
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
406
|
+
# @return [EmptyStructure]
|
407
|
+
def enable_io(options = {})
|
408
|
+
options = options.merge(volume_id: @id)
|
409
|
+
resp = @client.enable_volume_io(options)
|
410
|
+
resp.data
|
411
|
+
end
|
413
412
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
413
|
+
# @example Request syntax with placeholder values
|
414
|
+
#
|
415
|
+
# volume.modify_attribute({
|
416
|
+
# dry_run: false,
|
417
|
+
# auto_enable_io: {
|
418
|
+
# value: false,
|
419
|
+
# },
|
420
|
+
# })
|
421
|
+
# @param [Hash] options ({})
|
422
|
+
# @option options [Boolean] :dry_run
|
423
|
+
# Checks whether you have the required permissions for the action,
|
424
|
+
# without actually making the request, and provides an error response.
|
425
|
+
# If you have the required permissions, the error response is
|
426
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
427
|
+
# @option options [Types::AttributeBooleanValue] :auto_enable_io
|
428
|
+
# Indicates whether the volume should be auto-enabled for I/O
|
429
|
+
# operations.
|
430
|
+
# @return [EmptyStructure]
|
431
|
+
def modify_attribute(options = {})
|
432
|
+
options = options.merge(volume_id: @id)
|
433
|
+
resp = @client.modify_volume_attribute(options)
|
434
|
+
resp.data
|
435
|
+
end
|
437
436
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
437
|
+
# @!group Associations
|
438
|
+
|
439
|
+
# @example Request syntax with placeholder values
|
440
|
+
#
|
441
|
+
# snapshots = volume.snapshots({
|
442
|
+
# dry_run: false,
|
443
|
+
# snapshot_ids: ["String"],
|
444
|
+
# owner_ids: ["String"],
|
445
|
+
# restorable_by_user_ids: ["String"],
|
446
|
+
# filters: [
|
447
|
+
# {
|
448
|
+
# name: "String",
|
449
|
+
# values: ["String"],
|
450
|
+
# },
|
451
|
+
# ],
|
452
|
+
# })
|
453
|
+
# @param [Hash] options ({})
|
454
|
+
# @option options [Boolean] :dry_run
|
455
|
+
# Checks whether you have the required permissions for the action,
|
456
|
+
# without actually making the request, and provides an error response.
|
457
|
+
# If you have the required permissions, the error response is
|
458
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
459
|
+
# @option options [Array<String>] :snapshot_ids
|
460
|
+
# One or more snapshot IDs.
|
461
|
+
#
|
462
|
+
# Default: Describes snapshots for which you have launch permissions.
|
463
|
+
# @option options [Array<String>] :owner_ids
|
464
|
+
# Returns the snapshots owned by the specified owner. Multiple owners
|
465
|
+
# can be specified.
|
466
|
+
# @option options [Array<String>] :restorable_by_user_ids
|
467
|
+
# One or more AWS accounts IDs that can create volumes from the
|
468
|
+
# snapshot.
|
469
|
+
# @option options [Array<Types::Filter>] :filters
|
470
|
+
# One or more filters.
|
471
|
+
#
|
472
|
+
# * `description` - A description of the snapshot.
|
473
|
+
#
|
474
|
+
# * `owner-alias` - Value from an Amazon-maintained list (`amazon` \|
|
475
|
+
# `aws-marketplace` \| `microsoft`) of snapshot owners. Not to be
|
476
|
+
# confused with the user-configured AWS account alias, which is set
|
477
|
+
# from the IAM consolew.
|
478
|
+
#
|
479
|
+
# * `owner-id` - The ID of the AWS account that owns the snapshot.
|
480
|
+
#
|
481
|
+
# * `progress` - The progress of the snapshot, as a percentage (for
|
482
|
+
# example, 80%).
|
483
|
+
#
|
484
|
+
# * `snapshot-id` - The snapshot ID.
|
485
|
+
#
|
486
|
+
# * `start-time` - The time stamp when the snapshot was initiated.
|
487
|
+
#
|
488
|
+
# * `status` - The status of the snapshot (`pending` \| `completed` \|
|
489
|
+
# `error`).
|
490
|
+
#
|
491
|
+
# * `tag`\:*key*=*value* - The key/value combination of a tag assigned
|
492
|
+
# to the resource. Specify the key of the tag in the filter name and
|
493
|
+
# the value of the tag in the filter value. For example, for the tag
|
494
|
+
# Purpose=X, specify `tag:Purpose` for the filter name and `X` for the
|
495
|
+
# filter value.
|
496
|
+
#
|
497
|
+
# * `tag-key` - The key of a tag assigned to the resource. This filter
|
498
|
+
# is independent of the `tag-value` filter. For example, if you use
|
499
|
+
# both the filter "tag-key=Purpose" and the filter "tag-value=X",
|
500
|
+
# you get any resources assigned both the tag key Purpose (regardless
|
501
|
+
# of what the tag's value is), and the tag value X (regardless of
|
502
|
+
# what the tag's key is). If you want to list only resources where
|
503
|
+
# Purpose is X, see the `tag`\:*key*=*value* filter.
|
504
|
+
#
|
505
|
+
# * `tag-value` - The value of a tag assigned to the resource. This
|
506
|
+
# filter is independent of the `tag-key` filter.
|
507
|
+
#
|
508
|
+
# * `volume-id` - The ID of the volume the snapshot is for.
|
509
|
+
#
|
510
|
+
# * `volume-size` - The size of the volume, in GiB.
|
511
|
+
# @return [Snapshot::Collection]
|
512
|
+
def snapshots(options = {})
|
513
|
+
batches = Enumerator.new do |y|
|
514
|
+
options = Aws::Util.deep_merge(options, filters: [{
|
515
|
+
name: "volume-id",
|
516
|
+
values: [@id]
|
517
|
+
}])
|
518
|
+
resp = @client.describe_snapshots(options)
|
519
|
+
resp.each_page do |page|
|
520
|
+
batch = []
|
521
|
+
page.data.snapshots.each do |s|
|
522
|
+
batch << Snapshot.new(
|
523
|
+
id: s.snapshot_id,
|
524
|
+
data: s,
|
525
|
+
client: @client
|
526
|
+
)
|
527
527
|
end
|
528
|
+
y.yield(batch)
|
528
529
|
end
|
529
|
-
Snapshot::Collection.new(batches)
|
530
530
|
end
|
531
|
+
Snapshot::Collection.new(batches)
|
532
|
+
end
|
531
533
|
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
end
|
534
|
+
# @deprecated
|
535
|
+
# @api private
|
536
|
+
def identifiers
|
537
|
+
{ id: @id }
|
538
|
+
end
|
539
|
+
deprecated(:identifiers)
|
540
|
+
|
541
|
+
private
|
542
|
+
|
543
|
+
def extract_id(args, options)
|
544
|
+
value = args[0] || options.delete(:id)
|
545
|
+
case value
|
546
|
+
when String then value
|
547
|
+
when nil then raise ArgumentError, "missing required option :id"
|
548
|
+
else
|
549
|
+
msg = "expected :id to be a String, got #{value.class}"
|
550
|
+
raise ArgumentError, msg
|
550
551
|
end
|
551
|
-
|
552
|
-
class Collection < Aws::Resources::Collection; end
|
553
552
|
end
|
553
|
+
|
554
|
+
class Collection < Aws::Resources::Collection; end
|
554
555
|
end
|
555
556
|
end
|