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/snapshot.rb
CHANGED
@@ -1,478 +1,476 @@
|
|
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
|
26
|
-
|
27
|
-
# @!group Read-Only Attributes
|
8
|
+
module Aws::EC2
|
9
|
+
class Snapshot
|
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
|
28
25
|
|
29
|
-
|
30
|
-
def id
|
31
|
-
@id
|
32
|
-
end
|
33
|
-
alias :snapshot_id :id
|
34
|
-
|
35
|
-
# The ID of the volume that was used to create the snapshot. Snapshots
|
36
|
-
# created by the CopySnapshot action have an arbitrary volume ID that
|
37
|
-
# should not be used for any purpose.
|
38
|
-
# @return [String]
|
39
|
-
def volume_id
|
40
|
-
data.volume_id
|
41
|
-
end
|
26
|
+
# @!group Read-Only Attributes
|
42
27
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
28
|
+
# @return [String]
|
29
|
+
def id
|
30
|
+
@id
|
31
|
+
end
|
32
|
+
alias :snapshot_id :id
|
33
|
+
|
34
|
+
# The ID of the volume that was used to create the snapshot. Snapshots
|
35
|
+
# created by the CopySnapshot action have an arbitrary volume ID that
|
36
|
+
# should not be used for any purpose.
|
37
|
+
# @return [String]
|
38
|
+
def volume_id
|
39
|
+
data.volume_id
|
40
|
+
end
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
# operation.
|
55
|
-
# @return [String]
|
56
|
-
def state_message
|
57
|
-
data.state_message
|
58
|
-
end
|
42
|
+
# The snapshot state.
|
43
|
+
# @return [String]
|
44
|
+
def state
|
45
|
+
data.state
|
46
|
+
end
|
59
47
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
48
|
+
# Encrypted Amazon EBS snapshots are copied asynchronously. If a
|
49
|
+
# snapshot copy operation fails (for example, if the proper AWS Key
|
50
|
+
# Management Service (AWS KMS) permissions are not obtained) this field
|
51
|
+
# displays error state details to help you diagnose why the error
|
52
|
+
# occurred. This parameter is only returned by the DescribeSnapshots API
|
53
|
+
# operation.
|
54
|
+
# @return [String]
|
55
|
+
def state_message
|
56
|
+
data.state_message
|
57
|
+
end
|
65
58
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
59
|
+
# The time stamp when the snapshot was initiated.
|
60
|
+
# @return [Time]
|
61
|
+
def start_time
|
62
|
+
data.start_time
|
63
|
+
end
|
71
64
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
65
|
+
# The progress of the snapshot, as a percentage.
|
66
|
+
# @return [String]
|
67
|
+
def progress
|
68
|
+
data.progress
|
69
|
+
end
|
77
70
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
71
|
+
# The AWS account ID of the EBS snapshot owner.
|
72
|
+
# @return [String]
|
73
|
+
def owner_id
|
74
|
+
data.owner_id
|
75
|
+
end
|
83
76
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
77
|
+
# The description for the snapshot.
|
78
|
+
# @return [String]
|
79
|
+
def description
|
80
|
+
data.description
|
81
|
+
end
|
89
82
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
data.owner_alias
|
96
|
-
end
|
83
|
+
# The size of the volume, in GiB.
|
84
|
+
# @return [Integer]
|
85
|
+
def volume_size
|
86
|
+
data.volume_size
|
87
|
+
end
|
97
88
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
89
|
+
# Value from an Amazon-maintained list (`amazon` \| `aws-marketplace` \|
|
90
|
+
# `microsoft`) of snapshot owners. Not to be confused with the
|
91
|
+
# user-configured AWS account alias, which is set from the IAM console.
|
92
|
+
# @return [String]
|
93
|
+
def owner_alias
|
94
|
+
data.owner_alias
|
95
|
+
end
|
103
96
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
97
|
+
# Any tags assigned to the snapshot.
|
98
|
+
# @return [Array<Types::Tag>]
|
99
|
+
def tags
|
100
|
+
data.tags
|
101
|
+
end
|
109
102
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
data.kms_key_id
|
116
|
-
end
|
103
|
+
# Indicates whether the snapshot is encrypted.
|
104
|
+
# @return [Boolean]
|
105
|
+
def encrypted
|
106
|
+
data.encrypted
|
107
|
+
end
|
117
108
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
# @return [String]
|
126
|
-
def data_encryption_key_id
|
127
|
-
data.data_encryption_key_id
|
128
|
-
end
|
109
|
+
# The full ARN of the AWS Key Management Service (AWS KMS) customer
|
110
|
+
# master key (CMK) that was used to protect the volume encryption key
|
111
|
+
# for the parent volume.
|
112
|
+
# @return [String]
|
113
|
+
def kms_key_id
|
114
|
+
data.kms_key_id
|
115
|
+
end
|
129
116
|
|
130
|
-
|
117
|
+
# The data encryption key identifier for the snapshot. This value is a
|
118
|
+
# unique identifier that corresponds to the data encryption key that was
|
119
|
+
# used to encrypt the original volume or snapshot copy. Because data
|
120
|
+
# encryption keys are inherited by volumes created from snapshots, and
|
121
|
+
# vice versa, if snapshots share the same data encryption key
|
122
|
+
# identifier, then they belong to the same volume/snapshot lineage. This
|
123
|
+
# parameter is only returned by the DescribeSnapshots API operation.
|
124
|
+
# @return [String]
|
125
|
+
def data_encryption_key_id
|
126
|
+
data.data_encryption_key_id
|
127
|
+
end
|
131
128
|
|
132
|
-
|
133
|
-
def client
|
134
|
-
@client
|
135
|
-
end
|
129
|
+
# @!endgroup
|
136
130
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
#
|
142
|
-
# @return [self]
|
143
|
-
def load
|
144
|
-
resp = @client.describe_snapshots(snapshot_ids: [@id])
|
145
|
-
@data = resp.snapshots[0]
|
146
|
-
self
|
147
|
-
end
|
148
|
-
alias :reload :load
|
149
|
-
|
150
|
-
# @return [Types::Snapshot]
|
151
|
-
# Returns the data for this {Snapshot}. Calls
|
152
|
-
# {Client#describe_snapshots} if {#data_loaded?} is `false`.
|
153
|
-
def data
|
154
|
-
load unless @data
|
155
|
-
@data
|
156
|
-
end
|
131
|
+
# @return [Client]
|
132
|
+
def client
|
133
|
+
@client
|
134
|
+
end
|
157
135
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
136
|
+
# Loads, or reloads {#data} for the current {Snapshot}.
|
137
|
+
# Returns `self` making it possible to chain methods.
|
138
|
+
#
|
139
|
+
# snapshot.reload.data
|
140
|
+
#
|
141
|
+
# @return [self]
|
142
|
+
def load
|
143
|
+
resp = @client.describe_snapshots(snapshot_ids: [@id])
|
144
|
+
@data = resp.snapshots[0]
|
145
|
+
self
|
146
|
+
end
|
147
|
+
alias :reload :load
|
148
|
+
|
149
|
+
# @return [Types::Snapshot]
|
150
|
+
# Returns the data for this {Snapshot}. Calls
|
151
|
+
# {Client#describe_snapshots} if {#data_loaded?} is `false`.
|
152
|
+
def data
|
153
|
+
load unless @data
|
154
|
+
@data
|
155
|
+
end
|
164
156
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
def wait_until_completed(options = {})
|
172
|
-
options, params = separate_params_and_options(options)
|
173
|
-
waiter = Waiters::SnapshotCompleted.new(options)
|
174
|
-
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
175
|
-
resp = waiter.wait(params.merge(snapshot_ids: [@id]))
|
176
|
-
Snapshot.new({
|
177
|
-
id: @id,
|
178
|
-
data: resp.data.snapshots[],
|
179
|
-
client: @client
|
180
|
-
})
|
181
|
-
end
|
157
|
+
# @return [Boolean]
|
158
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
159
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
160
|
+
def data_loaded?
|
161
|
+
!!@data
|
162
|
+
end
|
182
163
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
# If you have the required permissions, the error response is
|
201
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
202
|
-
# @option options [required, String] :source_region
|
203
|
-
# The ID of the region that contains the snapshot to be copied.
|
204
|
-
# @option options [String] :description
|
205
|
-
# A description for the EBS snapshot.
|
206
|
-
# @option options [String] :destination_region
|
207
|
-
# The destination region to use in the `PresignedUrl` parameter of a
|
208
|
-
# snapshot copy operation. This parameter is only valid for specifying
|
209
|
-
# the destination region in a `PresignedUrl` parameter, where it is
|
210
|
-
# required.
|
211
|
-
#
|
212
|
-
# <note markdown="1"> `CopySnapshot` sends the snapshot copy to the regional endpoint that
|
213
|
-
# you send the HTTP request to, such as `ec2.us-east-1.amazonaws.com`
|
214
|
-
# (in the AWS CLI, this is specified with the `--region` parameter or
|
215
|
-
# the default region in your AWS configuration file).
|
216
|
-
#
|
217
|
-
# </note>
|
218
|
-
# @option options [String] :presigned_url
|
219
|
-
# The pre-signed URL that facilitates copying an encrypted snapshot.
|
220
|
-
# This parameter is only required when copying an encrypted snapshot
|
221
|
-
# with the Amazon EC2 Query API; it is available as an optional
|
222
|
-
# parameter in all other cases. The `PresignedUrl` should use the
|
223
|
-
# snapshot source endpoint, the `CopySnapshot` action, and include the
|
224
|
-
# `SourceRegion`, `SourceSnapshotId`, and `DestinationRegion`
|
225
|
-
# parameters. The `PresignedUrl` must be signed using AWS Signature
|
226
|
-
# Version 4. Because EBS snapshots are stored in Amazon S3, the signing
|
227
|
-
# algorithm for this parameter uses the same logic that is described in
|
228
|
-
# [Authenticating Requests by Using Query Parameters (AWS Signature
|
229
|
-
# Version 4)][1] in the *Amazon Simple Storage Service API Reference*.
|
230
|
-
# An invalid or improperly signed `PresignedUrl` will cause the copy
|
231
|
-
# operation to fail asynchronously, and the snapshot will move to an
|
232
|
-
# `error` state.
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
|
237
|
-
# @option options [Boolean] :encrypted
|
238
|
-
# Specifies whether the destination snapshot should be encrypted. You
|
239
|
-
# can encrypt a copy of an unencrypted snapshot using this flag, but you
|
240
|
-
# cannot use it to create an unencrypted copy from an encrypted
|
241
|
-
# snapshot. Your default CMK for EBS is used unless a non-default AWS
|
242
|
-
# Key Management Service (AWS KMS) CMK is specified with `KmsKeyId`. For
|
243
|
-
# more information, see [Amazon EBS Encryption][1] in the *Amazon
|
244
|
-
# Elastic Compute Cloud User Guide*.
|
245
|
-
#
|
246
|
-
#
|
247
|
-
#
|
248
|
-
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
|
249
|
-
# @option options [String] :kms_key_id
|
250
|
-
# The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
|
251
|
-
# when creating the snapshot copy. This parameter is only required if
|
252
|
-
# you want to use a non-default CMK; if this parameter is not specified,
|
253
|
-
# the default CMK for EBS is used. The ARN contains the `arn:aws:kms`
|
254
|
-
# namespace, followed by the region of the CMK, the AWS account ID of
|
255
|
-
# the CMK owner, the `key` namespace, and then the CMK ID. For example,
|
256
|
-
# arn:aws:kms:*us-east-1*\:*012345678910*\:key/*abcd1234-a123-456a-a12b-a123b4cd56ef*.
|
257
|
-
# The specified CMK must exist in the region that the snapshot is being
|
258
|
-
# copied to. If a `KmsKeyId` is specified, the `Encrypted` flag must
|
259
|
-
# also be set.
|
260
|
-
# @return [Types::CopySnapshotResult]
|
261
|
-
def copy(options = {})
|
262
|
-
options = options.merge(source_snapshot_id: @id)
|
263
|
-
resp = @client.copy_snapshot(options)
|
264
|
-
resp.data
|
265
|
-
end
|
164
|
+
# @param [Hash] options ({})
|
165
|
+
# @option options [Integer] :max_attempts (40)
|
166
|
+
# @option options [Float] :delay (15)
|
167
|
+
# @option options [Proc] :before_attempt
|
168
|
+
# @option options [Proc] :before_wait
|
169
|
+
# @return [Snapshot]
|
170
|
+
def wait_until_completed(options = {})
|
171
|
+
options, params = separate_params_and_options(options)
|
172
|
+
waiter = Waiters::SnapshotCompleted.new(options)
|
173
|
+
yield_waiter_and_warn(waiter, &Proc.new) if block_given?
|
174
|
+
resp = waiter.wait(params.merge(snapshot_ids: [@id]))
|
175
|
+
Snapshot.new({
|
176
|
+
id: @id,
|
177
|
+
data: resp.data.snapshots[],
|
178
|
+
client: @client
|
179
|
+
})
|
180
|
+
end
|
266
181
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
182
|
+
# @!group Actions
|
183
|
+
|
184
|
+
# @example Request syntax with placeholder values
|
185
|
+
#
|
186
|
+
# snapshot.copy({
|
187
|
+
# dry_run: false,
|
188
|
+
# source_region: "String", # required
|
189
|
+
# description: "String",
|
190
|
+
# destination_region: "String",
|
191
|
+
# presigned_url: "String",
|
192
|
+
# encrypted: false,
|
193
|
+
# kms_key_id: "String",
|
194
|
+
# })
|
195
|
+
# @param [Hash] options ({})
|
196
|
+
# @option options [Boolean] :dry_run
|
197
|
+
# Checks whether you have the required permissions for the action,
|
198
|
+
# without actually making the request, and provides an error response.
|
199
|
+
# If you have the required permissions, the error response is
|
200
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
201
|
+
# @option options [required, String] :source_region
|
202
|
+
# The ID of the region that contains the snapshot to be copied.
|
203
|
+
# @option options [String] :description
|
204
|
+
# A description for the EBS snapshot.
|
205
|
+
# @option options [String] :destination_region
|
206
|
+
# The destination region to use in the `PresignedUrl` parameter of a
|
207
|
+
# snapshot copy operation. This parameter is only valid for specifying
|
208
|
+
# the destination region in a `PresignedUrl` parameter, where it is
|
209
|
+
# required.
|
210
|
+
#
|
211
|
+
# <note markdown="1"> `CopySnapshot` sends the snapshot copy to the regional endpoint that
|
212
|
+
# you send the HTTP request to, such as `ec2.us-east-1.amazonaws.com`
|
213
|
+
# (in the AWS CLI, this is specified with the `--region` parameter or
|
214
|
+
# the default region in your AWS configuration file).
|
215
|
+
#
|
216
|
+
# </note>
|
217
|
+
# @option options [String] :presigned_url
|
218
|
+
# The pre-signed URL that facilitates copying an encrypted snapshot.
|
219
|
+
# This parameter is only required when copying an encrypted snapshot
|
220
|
+
# with the Amazon EC2 Query API; it is available as an optional
|
221
|
+
# parameter in all other cases. The `PresignedUrl` should use the
|
222
|
+
# snapshot source endpoint, the `CopySnapshot` action, and include the
|
223
|
+
# `SourceRegion`, `SourceSnapshotId`, and `DestinationRegion`
|
224
|
+
# parameters. The `PresignedUrl` must be signed using AWS Signature
|
225
|
+
# Version 4. Because EBS snapshots are stored in Amazon S3, the signing
|
226
|
+
# algorithm for this parameter uses the same logic that is described in
|
227
|
+
# [Authenticating Requests by Using Query Parameters (AWS Signature
|
228
|
+
# Version 4)][1] in the *Amazon Simple Storage Service API Reference*.
|
229
|
+
# An invalid or improperly signed `PresignedUrl` will cause the copy
|
230
|
+
# operation to fail asynchronously, and the snapshot will move to an
|
231
|
+
# `error` state.
|
232
|
+
#
|
233
|
+
#
|
234
|
+
#
|
235
|
+
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
|
236
|
+
# @option options [Boolean] :encrypted
|
237
|
+
# Specifies whether the destination snapshot should be encrypted. You
|
238
|
+
# can encrypt a copy of an unencrypted snapshot using this flag, but you
|
239
|
+
# cannot use it to create an unencrypted copy from an encrypted
|
240
|
+
# snapshot. Your default CMK for EBS is used unless a non-default AWS
|
241
|
+
# Key Management Service (AWS KMS) CMK is specified with `KmsKeyId`. For
|
242
|
+
# more information, see [Amazon EBS Encryption][1] in the *Amazon
|
243
|
+
# Elastic Compute Cloud User Guide*.
|
244
|
+
#
|
245
|
+
#
|
246
|
+
#
|
247
|
+
# [1]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
|
248
|
+
# @option options [String] :kms_key_id
|
249
|
+
# The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
|
250
|
+
# when creating the snapshot copy. This parameter is only required if
|
251
|
+
# you want to use a non-default CMK; if this parameter is not specified,
|
252
|
+
# the default CMK for EBS is used. The ARN contains the `arn:aws:kms`
|
253
|
+
# namespace, followed by the region of the CMK, the AWS account ID of
|
254
|
+
# the CMK owner, the `key` namespace, and then the CMK ID. For example,
|
255
|
+
# arn:aws:kms:*us-east-1*\:*012345678910*\:key/*abcd1234-a123-456a-a12b-a123b4cd56ef*.
|
256
|
+
# The specified CMK must exist in the region that the snapshot is being
|
257
|
+
# copied to. If a `KmsKeyId` is specified, the `Encrypted` flag must
|
258
|
+
# also be set.
|
259
|
+
# @return [Types::CopySnapshotResult]
|
260
|
+
def copy(options = {})
|
261
|
+
options = options.merge(source_snapshot_id: @id)
|
262
|
+
resp = @client.copy_snapshot(options)
|
263
|
+
resp.data
|
264
|
+
end
|
303
265
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
266
|
+
# @example Request syntax with placeholder values
|
267
|
+
#
|
268
|
+
# tag = snapshot.create_tags({
|
269
|
+
# dry_run: false,
|
270
|
+
# tags: [ # required
|
271
|
+
# {
|
272
|
+
# key: "String",
|
273
|
+
# value: "String",
|
274
|
+
# },
|
275
|
+
# ],
|
276
|
+
# })
|
277
|
+
# @param [Hash] options ({})
|
278
|
+
# @option options [Boolean] :dry_run
|
279
|
+
# Checks whether you have the required permissions for the action,
|
280
|
+
# without actually making the request, and provides an error response.
|
281
|
+
# If you have the required permissions, the error response is
|
282
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
283
|
+
# @option options [required, Array<Types::Tag>] :tags
|
284
|
+
# One or more tags. The `value` parameter is required, but if you don't
|
285
|
+
# want the tag to have a value, specify the parameter with no value, and
|
286
|
+
# we set the value to an empty string.
|
287
|
+
# @return [Tag::Collection]
|
288
|
+
def create_tags(options = {})
|
289
|
+
batch = []
|
290
|
+
options = Aws::Util.deep_merge(options, resources: [@id])
|
291
|
+
resp = @client.create_tags(options)
|
292
|
+
options[:tags].each do |t|
|
293
|
+
batch << Tag.new(
|
294
|
+
resource_id: @id,
|
295
|
+
key: t[:key],
|
296
|
+
value: t[:value],
|
297
|
+
client: @client
|
298
|
+
)
|
320
299
|
end
|
300
|
+
Tag::Collection.new([batch], size: batch.size)
|
301
|
+
end
|
321
302
|
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
resp = @client.describe_snapshot_attribute(options)
|
340
|
-
resp.data
|
341
|
-
end
|
303
|
+
# @example Request syntax with placeholder values
|
304
|
+
#
|
305
|
+
# snapshot.delete({
|
306
|
+
# dry_run: false,
|
307
|
+
# })
|
308
|
+
# @param [Hash] options ({})
|
309
|
+
# @option options [Boolean] :dry_run
|
310
|
+
# Checks whether you have the required permissions for the action,
|
311
|
+
# without actually making the request, and provides an error response.
|
312
|
+
# If you have the required permissions, the error response is
|
313
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
314
|
+
# @return [EmptyStructure]
|
315
|
+
def delete(options = {})
|
316
|
+
options = options.merge(snapshot_id: @id)
|
317
|
+
resp = @client.delete_snapshot(options)
|
318
|
+
resp.data
|
319
|
+
end
|
342
320
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
# ],
|
364
|
-
# },
|
365
|
-
# })
|
366
|
-
# @param [Hash] options ({})
|
367
|
-
# @option options [Boolean] :dry_run
|
368
|
-
# Checks whether you have the required permissions for the action,
|
369
|
-
# without actually making the request, and provides an error response.
|
370
|
-
# If you have the required permissions, the error response is
|
371
|
-
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
372
|
-
# @option options [String] :attribute
|
373
|
-
# The snapshot attribute to modify.
|
374
|
-
#
|
375
|
-
# <note markdown="1"> Only volume creation permissions may be modified at the customer
|
376
|
-
# level.
|
377
|
-
#
|
378
|
-
# </note>
|
379
|
-
# @option options [String] :operation_type
|
380
|
-
# The type of operation to perform to the attribute.
|
381
|
-
# @option options [Array<String>] :user_ids
|
382
|
-
# The account ID to modify for the snapshot.
|
383
|
-
# @option options [Array<String>] :group_names
|
384
|
-
# The group to modify for the snapshot.
|
385
|
-
# @option options [Types::CreateVolumePermissionModifications] :create_volume_permission
|
386
|
-
# A JSON representation of the snapshot attribute modification.
|
387
|
-
# @return [EmptyStructure]
|
388
|
-
def modify_attribute(options = {})
|
389
|
-
options = options.merge(snapshot_id: @id)
|
390
|
-
resp = @client.modify_snapshot_attribute(options)
|
391
|
-
resp.data
|
392
|
-
end
|
321
|
+
# @example Request syntax with placeholder values
|
322
|
+
#
|
323
|
+
# snapshot.describe_attribute({
|
324
|
+
# dry_run: false,
|
325
|
+
# attribute: "productCodes", # required, accepts productCodes, createVolumePermission
|
326
|
+
# })
|
327
|
+
# @param [Hash] options ({})
|
328
|
+
# @option options [Boolean] :dry_run
|
329
|
+
# Checks whether you have the required permissions for the action,
|
330
|
+
# without actually making the request, and provides an error response.
|
331
|
+
# If you have the required permissions, the error response is
|
332
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
333
|
+
# @option options [required, String] :attribute
|
334
|
+
# The snapshot attribute you would like to view.
|
335
|
+
# @return [Types::DescribeSnapshotAttributeResult]
|
336
|
+
def describe_attribute(options = {})
|
337
|
+
options = options.merge(snapshot_id: @id)
|
338
|
+
resp = @client.describe_snapshot_attribute(options)
|
339
|
+
resp.data
|
340
|
+
end
|
393
341
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
342
|
+
# @example Request syntax with placeholder values
|
343
|
+
#
|
344
|
+
# snapshot.modify_attribute({
|
345
|
+
# dry_run: false,
|
346
|
+
# attribute: "productCodes", # accepts productCodes, createVolumePermission
|
347
|
+
# operation_type: "add", # accepts add, remove
|
348
|
+
# user_ids: ["String"],
|
349
|
+
# group_names: ["String"],
|
350
|
+
# create_volume_permission: {
|
351
|
+
# add: [
|
352
|
+
# {
|
353
|
+
# user_id: "String",
|
354
|
+
# group: "all", # accepts all
|
355
|
+
# },
|
356
|
+
# ],
|
357
|
+
# remove: [
|
358
|
+
# {
|
359
|
+
# user_id: "String",
|
360
|
+
# group: "all", # accepts all
|
361
|
+
# },
|
362
|
+
# ],
|
363
|
+
# },
|
364
|
+
# })
|
365
|
+
# @param [Hash] options ({})
|
366
|
+
# @option options [Boolean] :dry_run
|
367
|
+
# Checks whether you have the required permissions for the action,
|
368
|
+
# without actually making the request, and provides an error response.
|
369
|
+
# If you have the required permissions, the error response is
|
370
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
371
|
+
# @option options [String] :attribute
|
372
|
+
# The snapshot attribute to modify.
|
373
|
+
#
|
374
|
+
# <note markdown="1"> Only volume creation permissions may be modified at the customer
|
375
|
+
# level.
|
376
|
+
#
|
377
|
+
# </note>
|
378
|
+
# @option options [String] :operation_type
|
379
|
+
# The type of operation to perform to the attribute.
|
380
|
+
# @option options [Array<String>] :user_ids
|
381
|
+
# The account ID to modify for the snapshot.
|
382
|
+
# @option options [Array<String>] :group_names
|
383
|
+
# The group to modify for the snapshot.
|
384
|
+
# @option options [Types::CreateVolumePermissionModifications] :create_volume_permission
|
385
|
+
# A JSON representation of the snapshot attribute modification.
|
386
|
+
# @return [EmptyStructure]
|
387
|
+
def modify_attribute(options = {})
|
388
|
+
options = options.merge(snapshot_id: @id)
|
389
|
+
resp = @client.modify_snapshot_attribute(options)
|
390
|
+
resp.data
|
391
|
+
end
|
415
392
|
|
416
|
-
|
393
|
+
# @example Request syntax with placeholder values
|
394
|
+
#
|
395
|
+
# snapshot.reset_attribute({
|
396
|
+
# dry_run: false,
|
397
|
+
# attribute: "productCodes", # required, accepts productCodes, createVolumePermission
|
398
|
+
# })
|
399
|
+
# @param [Hash] options ({})
|
400
|
+
# @option options [Boolean] :dry_run
|
401
|
+
# Checks whether you have the required permissions for the action,
|
402
|
+
# without actually making the request, and provides an error response.
|
403
|
+
# If you have the required permissions, the error response is
|
404
|
+
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
|
405
|
+
# @option options [required, String] :attribute
|
406
|
+
# The attribute to reset. Currently, only the attribute for permission
|
407
|
+
# to create volumes can be reset.
|
408
|
+
# @return [EmptyStructure]
|
409
|
+
def reset_attribute(options = {})
|
410
|
+
options = options.merge(snapshot_id: @id)
|
411
|
+
resp = @client.reset_snapshot_attribute(options)
|
412
|
+
resp.data
|
413
|
+
end
|
417
414
|
|
418
|
-
|
419
|
-
def volume
|
420
|
-
if data.volume_id
|
421
|
-
Volume.new(
|
422
|
-
id: data.volume_id,
|
423
|
-
client: @client
|
424
|
-
)
|
425
|
-
else
|
426
|
-
nil
|
427
|
-
end
|
428
|
-
end
|
415
|
+
# @!group Associations
|
429
416
|
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
417
|
+
# @return [Volume, nil]
|
418
|
+
def volume
|
419
|
+
if data.volume_id
|
420
|
+
Volume.new(
|
421
|
+
id: data.volume_id,
|
422
|
+
client: @client
|
423
|
+
)
|
424
|
+
else
|
425
|
+
nil
|
434
426
|
end
|
435
|
-
|
436
|
-
|
437
|
-
private
|
427
|
+
end
|
438
428
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
429
|
+
# @deprecated
|
430
|
+
# @api private
|
431
|
+
def identifiers
|
432
|
+
{ id: @id }
|
433
|
+
end
|
434
|
+
deprecated(:identifiers)
|
435
|
+
|
436
|
+
private
|
437
|
+
|
438
|
+
def extract_id(args, options)
|
439
|
+
value = args[0] || options.delete(:id)
|
440
|
+
case value
|
441
|
+
when String then value
|
442
|
+
when nil then raise ArgumentError, "missing required option :id"
|
443
|
+
else
|
444
|
+
msg = "expected :id to be a String, got #{value.class}"
|
445
|
+
raise ArgumentError, msg
|
448
446
|
end
|
447
|
+
end
|
449
448
|
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
end
|
457
|
-
yield(waiter.waiter)
|
449
|
+
def yield_waiter_and_warn(waiter, &block)
|
450
|
+
if !@waiter_block_warned
|
451
|
+
msg = "pass options to configure the waiter; "
|
452
|
+
msg << "yielding the waiter is deprecated"
|
453
|
+
warn(msg)
|
454
|
+
@waiter_block_warned = true
|
458
455
|
end
|
456
|
+
yield(waiter.waiter)
|
457
|
+
end
|
459
458
|
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
end
|
459
|
+
def separate_params_and_options(options)
|
460
|
+
opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
|
461
|
+
waiter_opts = {}
|
462
|
+
waiter_params = {}
|
463
|
+
options.each_pair do |key, value|
|
464
|
+
if opts.include?(key)
|
465
|
+
waiter_opts[key] = value
|
466
|
+
else
|
467
|
+
waiter_params[key] = value
|
470
468
|
end
|
471
|
-
waiter_opts[:client] ||= @client
|
472
|
-
[waiter_opts, waiter_params]
|
473
469
|
end
|
474
|
-
|
475
|
-
|
470
|
+
waiter_opts[:client] ||= @client
|
471
|
+
[waiter_opts, waiter_params]
|
476
472
|
end
|
473
|
+
|
474
|
+
class Collection < Aws::Resources::Collection; end
|
477
475
|
end
|
478
476
|
end
|