aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3

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