Class: Aws::Glacier::Job
- Inherits:
-
Object
- Object
- Aws::Glacier::Job
- Extended by:
- Deprecations
- Defined in:
- sig/job.rbs,
lib/aws-sdk-glacier/job.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #account_id ⇒ String
-
#action ⇒ String
The job type.
-
#archive_id ⇒ String
The archive ID requested for a select job or archive retrieval.
-
#archive_sha256_tree_hash ⇒ String
The SHA256 tree hash of the entire archive for an archive retrieval.
-
#archive_size_in_bytes ⇒ Integer
For an archive retrieval job, this value is the size in bytes of the archive being requested for download.
-
#completed ⇒ Boolean
The job status.
-
#completion_date ⇒ Time
The UTC time that the job request completed.
-
#creation_date ⇒ Time
The UTC date when the job was created.
- #id ⇒ String (also: #job_id)
-
#inventory_retrieval_parameters ⇒ Types::InventoryRetrievalJobDescription
Parameters used for range inventory retrieval.
-
#inventory_size_in_bytes ⇒ Integer
For an inventory retrieval job, this value is the size in bytes of the inventory requested for download.
-
#job_description ⇒ String
The job description provided when initiating the job.
-
#job_output_path ⇒ String
Contains the job output location.
-
#output_location ⇒ Types::OutputLocation
Contains the location where the data from the select job is stored.
-
#retrieval_byte_range ⇒ String
The retrieved byte range for archive retrieval jobs in the form StartByteValue-EndByteValue.
-
#select_parameters ⇒ Types::SelectParameters
Contains the parameters used for a select.
-
#sha256_tree_hash ⇒ String
For an archive retrieval job, this value is the checksum of the archive.
-
#sns_topic ⇒ String
An Amazon SNS topic that receives notification.
-
#status_code ⇒ String
The status code can be
InProgress,Succeeded, orFailed, and indicates the status of the job. -
#status_message ⇒ String
A friendly message that describes the job status.
-
#tier ⇒ String
The tier to use for a select or an archive retrieval.
-
#vault_arn ⇒ String
The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested.
- #vault_name ⇒ String
Actions collapse
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #vault ⇒ Vault
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::GlacierJobDescription
Returns the data for this Job.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ Job
constructor
A new instance of Job.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::Glacier::Client] #wait_until instead
Constructor Details
#initialize(account_id, vault_name, id, options = {}) ⇒ Job #initialize(options = {}) ⇒ Job
Returns a new instance of Job.
13 14 15 |
# File 'sig/job.rbs', line 13
def initialize: (String account_id, String vault_name, String id, Hash[Symbol, untyped] options) -> void
| (account_id: String, vault_name: String, id: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#account_id ⇒ String
18 |
# File 'sig/job.rbs', line 18
def account_id: () -> String
|
#action ⇒ String
The job type. This value is either ArchiveRetrieval,
InventoryRetrieval, or Select.
31 |
# File 'sig/job.rbs', line 31
def action: () -> ("ArchiveRetrieval" | "InventoryRetrieval" | "Select")
|
#archive_id ⇒ String
The archive ID requested for a select job or archive retrieval. Otherwise, this field is null.
34 |
# File 'sig/job.rbs', line 34
def archive_id: () -> ::String
|
#archive_sha256_tree_hash ⇒ String
The SHA256 tree hash of the entire archive for an archive retrieval. For inventory retrieval or select jobs, this field is null.
67 |
# File 'sig/job.rbs', line 67
def archive_sha256_tree_hash: () -> ::String
|
#archive_size_in_bytes ⇒ Integer
For an archive retrieval job, this value is the size in bytes of the archive being requested for download. For an inventory retrieval or select job, this value is null.
52 |
# File 'sig/job.rbs', line 52
def archive_size_in_bytes: () -> ::Integer
|
#completed ⇒ Boolean
The job status. When a job is completed, you get the job's output using Get Job Output (GET output).
43 |
# File 'sig/job.rbs', line 43
def completed: () -> bool
|
#completion_date ⇒ Time
The UTC time that the job request completed. While the job is in progress, the value is null.
61 |
# File 'sig/job.rbs', line 61
def completion_date: () -> ::Time
|
#creation_date ⇒ Time
The UTC date when the job was created. This value is a string
representation of ISO 8601 date format, for example
"2012-03-20T17:03:43.221Z".
40 |
# File 'sig/job.rbs', line 40
def creation_date: () -> ::Time
|
#data ⇒ Types::GlacierJobDescription
Returns the data for this Aws::Glacier::Job. Calls
Client#describe_job if #data_loaded? is false.
94 |
# File 'sig/job.rbs', line 94
def data: () -> Types::GlacierJobDescription
|
#data_loaded? ⇒ Boolean
97 |
# File 'sig/job.rbs', line 97
def data_loaded?: () -> bool
|
#get_output(options = {}, &block) ⇒ Types::GetJobOutputOutput
101 |
# File 'sig/job.rbs', line 101
def get_output: (
|
#id ⇒ String Also known as: job_id
24 |
# File 'sig/job.rbs', line 24
def id: () -> String
|
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
425 426 427 428 429 430 431 |
# File 'lib/aws-sdk-glacier/job.rb', line 425 def identifiers { account_id: @account_id, vault_name: @vault_name, id: @id } end |
#inventory_retrieval_parameters ⇒ Types::InventoryRetrievalJobDescription
Parameters used for range inventory retrieval.
76 |
# File 'sig/job.rbs', line 76
def inventory_retrieval_parameters: () -> Types::InventoryRetrievalJobDescription
|
#inventory_size_in_bytes ⇒ Integer
For an inventory retrieval job, this value is the size in bytes of the inventory requested for download. For an archive retrieval or select job, this value is null.
55 |
# File 'sig/job.rbs', line 55
def inventory_size_in_bytes: () -> ::Integer
|
#job_description ⇒ String
The job description provided when initiating the job.
28 |
# File 'sig/job.rbs', line 28
def job_description: () -> ::String
|
#job_output_path ⇒ String
Contains the job output location.
79 |
# File 'sig/job.rbs', line 79
def job_output_path: () -> ::String
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::Glacier::Job.
Returns self making it possible to chain methods.
job.reload.data
90 |
# File 'sig/job.rbs', line 90
def load: () -> self
|
#output_location ⇒ Types::OutputLocation
Contains the location where the data from the select job is stored.
85 |
# File 'sig/job.rbs', line 85
def output_location: () -> Types::OutputLocation
|
#retrieval_byte_range ⇒ String
The retrieved byte range for archive retrieval jobs in the form StartByteValue-EndByteValue. If no range was specified in the archive retrieval, then the whole archive is retrieved. In this case, StartByteValue equals 0 and EndByteValue equals the size of the archive minus 1. For inventory retrieval or select jobs, this field is null.
70 |
# File 'sig/job.rbs', line 70
def retrieval_byte_range: () -> ::String
|
#select_parameters ⇒ Types::SelectParameters
Contains the parameters used for a select.
82 |
# File 'sig/job.rbs', line 82
def select_parameters: () -> Types::SelectParameters
|
#sha256_tree_hash ⇒ String
For an archive retrieval job, this value is the checksum of the archive. Otherwise, this value is null.
The SHA256 tree hash value for the requested range of an archive. If the InitiateJob request for an archive specified a tree-hash aligned range, then this field returns a value.
If the whole archive is retrieved, this value is the same as the ArchiveSHA256TreeHash value.
This field is null for the following:
- Archive retrieval jobs that specify a range that is not tree-hash aligned
^ ^
- Archival jobs that specify a range that is equal to the whole
archive, when the job status is
InProgress
^ ^
-
Inventory jobs
-
Select jobs
64 |
# File 'sig/job.rbs', line 64
def sha256_tree_hash: () -> ::String
|
#sns_topic ⇒ String
An Amazon SNS topic that receives notification.
58 |
# File 'sig/job.rbs', line 58
def sns_topic: () -> ::String
|
#status_code ⇒ String
The status code can be InProgress, Succeeded, or Failed, and
indicates the status of the job.
46 |
# File 'sig/job.rbs', line 46
def status_code: () -> ("InProgress" | "Succeeded" | "Failed")
|
#status_message ⇒ String
A friendly message that describes the job status.
49 |
# File 'sig/job.rbs', line 49
def status_message: () -> ::String
|
#tier ⇒ String
The tier to use for a select or an archive retrieval. Valid values are
Expedited, Standard, or Bulk. Standard is the default.
73 |
# File 'sig/job.rbs', line 73
def tier: () -> ::String
|
#vault_arn ⇒ String
The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested.
37 |
# File 'sig/job.rbs', line 37
def vault_arn: () -> ::String
|
#vault_name ⇒ String
21 |
# File 'sig/job.rbs', line 21
def vault_name: () -> String
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::Glacier::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/aws-sdk-glacier/job.rb', line 340 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |