Class: Aws::Glacier::Vault
- Inherits:
-
Object
- Object
- Aws::Glacier::Vault
- Extended by:
- Deprecations
- Defined in:
- sig/vault.rbs,
lib/aws-sdk-glacier/vault.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #account_id ⇒ String
-
#creation_date ⇒ Time
The Universal Coordinated Time (UTC) date when the vault was created.
-
#last_inventory_date ⇒ Time
The Universal Coordinated Time (UTC) date when Amazon Glacier completed the last vault inventory.
- #name ⇒ String (also: #vault_name)
-
#number_of_archives ⇒ Integer
The number of archives in the vault as of the last inventory date.
-
#size_in_bytes ⇒ Integer
Total size, in bytes, of the archives in the vault as of the last inventory date.
-
#vault_arn ⇒ String
The Amazon Resource Name (ARN) of the vault.
Actions collapse
- #create(options = {}) ⇒ Types::CreateVaultOutput
- #delete(options = {}) ⇒ EmptyStructure
- #initiate_inventory_retrieval(options = {}) ⇒ Job
- #initiate_multipart_upload(options = {}) ⇒ MultipartUpload
- #upload_archive(options = {}) ⇒ Archive
Associations collapse
- #account ⇒ Account
- #archive(id) ⇒ Archive
- #completed_jobs(options = {}) ⇒ Job::Collection
- #failed_jobs(options = {}) ⇒ Job::Collection
- #identifiers ⇒ Object deprecated private Deprecated.
- #job(id) ⇒ Job
- #jobs(options = {}) ⇒ Job::Collection
- #jobs_in_progress(options = {}) ⇒ Job::Collection
- #multipart_uplaods(options = {}) ⇒ MultipartUpload::Collection
- #multipart_upload(id) ⇒ MultipartUpload
- #notification ⇒ Notification
- #succeeded_jobs(options = {}) ⇒ Job::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::DescribeVaultOutput
Returns the data for this Vault.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ Vault
constructor
A new instance of Vault.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::Glacier::Client] #wait_until instead
Constructor Details
#initialize(account_id, name, options = {}) ⇒ Vault #initialize(options = {}) ⇒ Vault
Returns a new instance of Vault.
13 14 15 |
# File 'sig/vault.rbs', line 13
def initialize: (String account_id, String name, Hash[Symbol, untyped] options) -> void
| (account_id: String, name: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#account_id ⇒ String
18 |
# File 'sig/vault.rbs', line 18
def account_id: () -> String
|
#completed_jobs(options = {}) ⇒ Job::Collection
89 |
# File 'sig/vault.rbs', line 89
def completed_jobs: (
|
#creation_date ⇒ Time
The Universal Coordinated Time (UTC) date when the vault was created.
This value should be a string in the ISO 8601 date format, for example
2012-03-20T17:03:43.221Z.
28 |
# File 'sig/vault.rbs', line 28
def creation_date: () -> ::Time
|
#data ⇒ Types::DescribeVaultOutput
Returns the data for this Aws::Glacier::Vault. Calls
Client#describe_vault if #data_loaded? is false.
46 |
# File 'sig/vault.rbs', line 46
def data: () -> Types::DescribeVaultOutput
|
#data_loaded? ⇒ Boolean
49 |
# File 'sig/vault.rbs', line 49
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
58 |
# File 'sig/vault.rbs', line 58
def delete: (
|
#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.
615 616 617 618 619 620 |
# File 'lib/aws-sdk-glacier/vault.rb', line 615 def identifiers { account_id: @account_id, name: @name } end |
#initiate_inventory_retrieval(options = {}) ⇒ Job
63 |
# File 'sig/vault.rbs', line 63
def initiate_inventory_retrieval: (
|
#initiate_multipart_upload(options = {}) ⇒ MultipartUpload
68 |
# File 'sig/vault.rbs', line 68
def initiate_multipart_upload: (
|
#jobs_in_progress(options = {}) ⇒ Job::Collection
111 |
# File 'sig/vault.rbs', line 111
def jobs_in_progress: (
|
#last_inventory_date ⇒ Time
The Universal Coordinated Time (UTC) date when Amazon Glacier
completed the last vault inventory. This value should be a string in
the ISO 8601 date format, for example 2012-03-20T17:03:43.221Z.
31 |
# File 'sig/vault.rbs', line 31
def last_inventory_date: () -> ::Time
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::Glacier::Vault.
Returns self making it possible to chain methods.
vault.reload.data
42 |
# File 'sig/vault.rbs', line 42
def load: () -> self
|
#multipart_uplaods(options = {}) ⇒ MultipartUpload::Collection
117 |
# File 'sig/vault.rbs', line 117
def multipart_uplaods: (
|
#multipart_upload(id) ⇒ MultipartUpload
122 |
# File 'sig/vault.rbs', line 122
def multipart_upload: (String id) -> MultipartUpload
|
#name ⇒ String Also known as: vault_name
21 |
# File 'sig/vault.rbs', line 21
def name: () -> String
|
#notification ⇒ Notification
125 |
# File 'sig/vault.rbs', line 125
def notification: () -> Notification
|
#number_of_archives ⇒ Integer
The number of archives in the vault as of the last inventory date.
This field will return null if an inventory has not yet run on the
vault, for example if you just created the vault.
34 |
# File 'sig/vault.rbs', line 34
def number_of_archives: () -> ::Integer
|
#size_in_bytes ⇒ Integer
Total size, in bytes, of the archives in the vault as of the last inventory date. This field will return null if an inventory has not yet run on the vault, for example if you just created the vault.
37 |
# File 'sig/vault.rbs', line 37
def size_in_bytes: () -> ::Integer
|
#succeeded_jobs(options = {}) ⇒ Job::Collection
128 |
# File 'sig/vault.rbs', line 128
def succeeded_jobs: (
|
#vault_arn ⇒ String
The Amazon Resource Name (ARN) of the vault.
25 |
# File 'sig/vault.rbs', line 25
def vault_arn: () -> ::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
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/aws-sdk-glacier/vault.rb', line 204 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 |