aws-sdk-glacier 1.0.0.rc1 → 1.0.0.rc2

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