aws-sdk-glacier 1.0.0.rc1 → 1.0.0.rc2
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-glacier.rb +2 -2
- data/lib/aws-sdk-glacier/account.rb +116 -118
- data/lib/aws-sdk-glacier/archive.rb +148 -150
- data/lib/aws-sdk-glacier/client.rb +2657 -2425
- data/lib/aws-sdk-glacier/client_api.rb +896 -898
- data/lib/aws-sdk-glacier/errors.rb +4 -13
- data/lib/aws-sdk-glacier/job.rb +300 -302
- data/lib/aws-sdk-glacier/multipart_upload.rb +228 -230
- data/lib/aws-sdk-glacier/notification.rb +151 -153
- data/lib/aws-sdk-glacier/resource.rb +61 -63
- data/lib/aws-sdk-glacier/types.rb +2207 -2045
- data/lib/aws-sdk-glacier/vault.rb +454 -456
- data/lib/aws-sdk-glacier/waiters.rb +76 -77
- metadata +2 -2
@@ -1,23 +1,14 @@
|
|
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
|
-
module
|
10
|
-
module Errors
|
8
|
+
module Aws::Glacier
|
9
|
+
module Errors
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Errors::DynamicErrors
|
13
12
|
|
14
|
-
# Raised when calling #load or #data on a resource class that can not be
|
15
|
-
# loaded. This can happen when:
|
16
|
-
#
|
17
|
-
# * A resource class has identifiers, but no data attributes.
|
18
|
-
# * Resource data is only available when making an API call that
|
19
|
-
# enumerates all resources of that type.
|
20
|
-
class ResourceNotLoadable < RuntimeError; end
|
21
|
-
end
|
22
13
|
end
|
23
14
|
end
|
data/lib/aws-sdk-glacier/job.rb
CHANGED
@@ -1,345 +1,343 @@
|
|
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
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
8
|
+
module Aws::Glacier
|
9
|
+
class Job
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(account_id, vault_name, id, options = {})
|
14
|
+
# @param [String] account_id
|
15
|
+
# @param [String] vault_name
|
16
|
+
# @param [String] id
|
17
|
+
# @option options [Client] :client
|
18
|
+
# @overload def initialize(options = {})
|
19
|
+
# @option options [required, String] :account_id
|
20
|
+
# @option options [required, String] :vault_name
|
21
|
+
# @option options [required, String] :id
|
22
|
+
# @option options [Client] :client
|
23
|
+
def initialize(*args)
|
24
|
+
options = Hash === args.last ? args.pop.dup : {}
|
25
|
+
@account_id = extract_account_id(args, options)
|
26
|
+
@vault_name = extract_vault_name(args, options)
|
27
|
+
@id = extract_id(args, options)
|
28
|
+
@data = options.delete(:data)
|
29
|
+
@client = options.delete(:client) || Client.new(options)
|
30
|
+
end
|
32
31
|
|
33
|
-
|
32
|
+
# @!group Read-Only Attributes
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
# @return [String]
|
35
|
+
def account_id
|
36
|
+
@account_id
|
37
|
+
end
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
# @return [String]
|
40
|
+
def vault_name
|
41
|
+
@vault_name
|
42
|
+
end
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
# @return [String]
|
45
|
+
def id
|
46
|
+
@id
|
47
|
+
end
|
48
|
+
alias :job_id :id
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
# The job description you provided when you initiated the job.
|
51
|
+
# @return [String]
|
52
|
+
def job_description
|
53
|
+
data.job_description
|
54
|
+
end
|
56
55
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
# The job type. It is either ArchiveRetrieval or InventoryRetrieval.
|
57
|
+
# @return [String]
|
58
|
+
def action
|
59
|
+
data.action
|
60
|
+
end
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
# For an ArchiveRetrieval job, this is the archive ID requested for
|
63
|
+
# download. Otherwise, this field is null.
|
64
|
+
# @return [String]
|
65
|
+
def archive_id
|
66
|
+
data.archive_id
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
69
|
+
# The Amazon Resource Name (ARN) of the vault from which the archive
|
70
|
+
# retrieval was requested.
|
71
|
+
# @return [String]
|
72
|
+
def vault_arn
|
73
|
+
data.vault_arn
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
# The UTC date when the job was created. A string representation of ISO
|
77
|
+
# 8601 date format, for example, "2012-03-20T17:03:43.221Z".
|
78
|
+
# @return [Time]
|
79
|
+
def creation_date
|
80
|
+
data.creation_date
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
# The job status. When a job is completed, you get the job's output.
|
84
|
+
# @return [Boolean]
|
85
|
+
def completed
|
86
|
+
data.completed
|
87
|
+
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
89
|
+
# The status code can be InProgress, Succeeded, or Failed, and indicates
|
90
|
+
# the status of the job.
|
91
|
+
# @return [String]
|
92
|
+
def status_code
|
93
|
+
data.status_code
|
94
|
+
end
|
96
95
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
# A friendly message that describes the job status.
|
97
|
+
# @return [String]
|
98
|
+
def status_message
|
99
|
+
data.status_message
|
100
|
+
end
|
102
101
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
102
|
+
# For an ArchiveRetrieval job, this is the size in bytes of the archive
|
103
|
+
# being requested for download. For the InventoryRetrieval job, the
|
104
|
+
# value is null.
|
105
|
+
# @return [Integer]
|
106
|
+
def archive_size_in_bytes
|
107
|
+
data.archive_size_in_bytes
|
108
|
+
end
|
110
109
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
# For an InventoryRetrieval job, this is the size in bytes of the
|
111
|
+
# inventory requested for download. For the ArchiveRetrieval job, the
|
112
|
+
# value is null.
|
113
|
+
# @return [Integer]
|
114
|
+
def inventory_size_in_bytes
|
115
|
+
data.inventory_size_in_bytes
|
116
|
+
end
|
118
117
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
118
|
+
# An Amazon Simple Notification Service (Amazon SNS) topic that receives
|
119
|
+
# notification.
|
120
|
+
# @return [String]
|
121
|
+
def sns_topic
|
122
|
+
data.sns_topic
|
123
|
+
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
125
|
+
# The UTC time that the archive retrieval request completed. While the
|
126
|
+
# job is in progress, the value will be null.
|
127
|
+
# @return [Time]
|
128
|
+
def completion_date
|
129
|
+
data.completion_date
|
130
|
+
end
|
132
131
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
132
|
+
# For an ArchiveRetrieval job, it is the checksum of the archive.
|
133
|
+
# Otherwise, the value is null.
|
134
|
+
#
|
135
|
+
# The SHA256 tree hash value for the requested range of an archive. If
|
136
|
+
# the Initiate a Job request for an archive specified a tree-hash
|
137
|
+
# aligned range, then this field returns a value.
|
138
|
+
#
|
139
|
+
# For the specific case when the whole archive is retrieved, this value
|
140
|
+
# is the same as the ArchiveSHA256TreeHash value.
|
141
|
+
#
|
142
|
+
# This field is null in the following situations:
|
143
|
+
#
|
144
|
+
# * Archive retrieval jobs that specify a range that is not tree-hash
|
145
|
+
# aligned.
|
146
|
+
#
|
147
|
+
# ^
|
148
|
+
# ^
|
149
|
+
#
|
150
|
+
# * Archival jobs that specify a range that is equal to the whole
|
151
|
+
# archive and the job status is InProgress.
|
152
|
+
#
|
153
|
+
# ^
|
154
|
+
# ^
|
155
|
+
#
|
156
|
+
# * Inventory jobs.
|
157
|
+
#
|
158
|
+
# ^
|
159
|
+
# @return [String]
|
160
|
+
def sha256_tree_hash
|
161
|
+
data.sha256_tree_hash
|
162
|
+
end
|
164
163
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
164
|
+
# The SHA256 tree hash of the entire archive for an archive retrieval.
|
165
|
+
# For inventory retrieval jobs, this field is null.
|
166
|
+
# @return [String]
|
167
|
+
def archive_sha256_tree_hash
|
168
|
+
data.archive_sha256_tree_hash
|
169
|
+
end
|
171
170
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
171
|
+
# The retrieved byte range for archive retrieval jobs in the form
|
172
|
+
# "*StartByteValue*-*EndByteValue*" If no range was specified in the
|
173
|
+
# archive retrieval, then the whole archive is retrieved and
|
174
|
+
# *StartByteValue* equals 0 and *EndByteValue* equals the size of the
|
175
|
+
# archive minus 1. For inventory retrieval jobs this field is null.
|
176
|
+
# @return [String]
|
177
|
+
def retrieval_byte_range
|
178
|
+
data.retrieval_byte_range
|
179
|
+
end
|
181
180
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
# The retrieval option to use for the archive retrieval. Valid values
|
182
|
+
# are `Expedited`, `Standard`, or `Bulk`. `Standard` is the default.
|
183
|
+
# @return [String]
|
184
|
+
def tier
|
185
|
+
data.tier
|
186
|
+
end
|
188
187
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
188
|
+
# Parameters used for range inventory retrieval.
|
189
|
+
# @return [Types::InventoryRetrievalJobDescription]
|
190
|
+
def inventory_retrieval_parameters
|
191
|
+
data.inventory_retrieval_parameters
|
192
|
+
end
|
194
193
|
|
195
|
-
|
194
|
+
# @!endgroup
|
196
195
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
196
|
+
# @return [Client]
|
197
|
+
def client
|
198
|
+
@client
|
199
|
+
end
|
201
200
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
201
|
+
# Loads, or reloads {#data} for the current {Job}.
|
202
|
+
# Returns `self` making it possible to chain methods.
|
203
|
+
#
|
204
|
+
# job.reload.data
|
205
|
+
#
|
206
|
+
# @return [self]
|
207
|
+
def load
|
208
|
+
resp = @client.describe_job(
|
209
|
+
account_id: @account_id,
|
210
|
+
vault_name: @vault_name,
|
211
|
+
job_id: @id
|
212
|
+
)
|
213
|
+
@data = resp.data
|
214
|
+
self
|
215
|
+
end
|
216
|
+
alias :reload :load
|
217
|
+
|
218
|
+
# @return [Types::GlacierJobDescription]
|
219
|
+
# Returns the data for this {Job}. Calls
|
220
|
+
# {Client#describe_job} if {#data_loaded?} is `false`.
|
221
|
+
def data
|
222
|
+
load unless @data
|
223
|
+
@data
|
224
|
+
end
|
226
225
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
226
|
+
# @return [Boolean]
|
227
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
228
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
229
|
+
def data_loaded?
|
230
|
+
!!@data
|
231
|
+
end
|
233
232
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
233
|
+
# @!group Actions
|
234
|
+
|
235
|
+
# @example Request syntax with placeholder values
|
236
|
+
#
|
237
|
+
# job.get_output({
|
238
|
+
# range: "string",
|
239
|
+
# })
|
240
|
+
# @param [Hash] options ({})
|
241
|
+
# @option options [String] :range
|
242
|
+
# The range of bytes to retrieve from the output. For example, if you
|
243
|
+
# want to download the first 1,048,576 bytes, specify the range as
|
244
|
+
# `bytes=0-1048575`. By default, this operation downloads the entire
|
245
|
+
# output.
|
246
|
+
#
|
247
|
+
# If the job output is large, then you can use a range to retrieve a
|
248
|
+
# portion of the output. This allows you to download the entire output
|
249
|
+
# in smaller chunks of bytes. For example, suppose you have 1 GB of job
|
250
|
+
# output you want to download and you decide to download 128 MB chunks
|
251
|
+
# of data at a time, which is a total of eight Get Job Output requests.
|
252
|
+
# You use the following process to download the job output:
|
253
|
+
#
|
254
|
+
# 1. Download a 128 MB chunk of output by specifying the appropriate
|
255
|
+
# byte range. Verify that all 128 MB of data was received.
|
256
|
+
#
|
257
|
+
# 2. Along with the data, the response includes a SHA256 tree hash of
|
258
|
+
# the payload. You compute the checksum of the payload on the client
|
259
|
+
# and compare it with the checksum you received in the response to
|
260
|
+
# ensure you received all the expected data.
|
261
|
+
#
|
262
|
+
# 3. Repeat steps 1 and 2 for all the eight 128 MB chunks of output
|
263
|
+
# data, each time specifying the appropriate byte range.
|
264
|
+
#
|
265
|
+
# 4. After downloading all the parts of the job output, you have a list
|
266
|
+
# of eight checksum values. Compute the tree hash of these values to
|
267
|
+
# find the checksum of the entire output. Using the DescribeJob API,
|
268
|
+
# obtain job information of the job that provided you the output.
|
269
|
+
# The response includes the checksum of the entire archive stored in
|
270
|
+
# Amazon Glacier. You compare this value with the checksum you
|
271
|
+
# computed to ensure you have downloaded the entire archive content
|
272
|
+
# with no errors.
|
273
|
+
# @return [Types::GetJobOutputOutput]
|
274
|
+
def get_output(options = {})
|
275
|
+
options = options.merge(
|
276
|
+
account_id: @account_id,
|
277
|
+
vault_name: @vault_name,
|
278
|
+
job_id: @id
|
279
|
+
)
|
280
|
+
resp = @client.get_job_output(options)
|
281
|
+
resp.data
|
282
|
+
end
|
284
283
|
|
285
|
-
|
284
|
+
# @!group Associations
|
286
285
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
286
|
+
# @return [Vault]
|
287
|
+
def vault
|
288
|
+
Vault.new(
|
289
|
+
account_id: @account_id,
|
290
|
+
name: @vault_name,
|
291
|
+
client: @client
|
292
|
+
)
|
293
|
+
end
|
295
294
|
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
end
|
295
|
+
# @deprecated
|
296
|
+
# @api private
|
297
|
+
def identifiers
|
298
|
+
{
|
299
|
+
account_id: @account_id,
|
300
|
+
vault_name: @vault_name,
|
301
|
+
id: @id
|
302
|
+
}
|
303
|
+
end
|
304
|
+
deprecated(:identifiers)
|
305
|
+
|
306
|
+
private
|
307
|
+
|
308
|
+
def extract_account_id(args, options)
|
309
|
+
value = args[0] || options.delete(:account_id)
|
310
|
+
case value
|
311
|
+
when String then value
|
312
|
+
when nil then raise ArgumentError, "missing required option :account_id"
|
313
|
+
else
|
314
|
+
msg = "expected :account_id to be a String, got #{value.class}"
|
315
|
+
raise ArgumentError, msg
|
318
316
|
end
|
317
|
+
end
|
319
318
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
end
|
319
|
+
def extract_vault_name(args, options)
|
320
|
+
value = args[1] || options.delete(:vault_name)
|
321
|
+
case value
|
322
|
+
when String then value
|
323
|
+
when nil then raise ArgumentError, "missing required option :vault_name"
|
324
|
+
else
|
325
|
+
msg = "expected :vault_name to be a String, got #{value.class}"
|
326
|
+
raise ArgumentError, msg
|
329
327
|
end
|
328
|
+
end
|
330
329
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
end
|
330
|
+
def extract_id(args, options)
|
331
|
+
value = args[2] || options.delete(:id)
|
332
|
+
case value
|
333
|
+
when String then value
|
334
|
+
when nil then raise ArgumentError, "missing required option :id"
|
335
|
+
else
|
336
|
+
msg = "expected :id to be a String, got #{value.class}"
|
337
|
+
raise ArgumentError, msg
|
340
338
|
end
|
341
|
-
|
342
|
-
class Collection < Aws::Resources::Collection; end
|
343
339
|
end
|
340
|
+
|
341
|
+
class Collection < Aws::Resources::Collection; end
|
344
342
|
end
|
345
343
|
end
|