You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Glacier::Resource

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Overview

This class provides a resource oriented interface for Amazon Glacier. To create a resource object:

resource = Aws::Glacier::Resource.new

You can supply a client object with custom configuration that will be used for all resource operations. If you do not pass :client, a default client will be constructed.

client = Aws::Glacier::Client.new(region: 'us-west-2')
resource = Aws::Glacier::Resource.new(client: client)

Resource Resource Classes

Aws::Glacier::Resource has the following resource classes:

Instance Attribute Summary

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Method Details

#account(id) ⇒ Account

Parameters:

Returns:

#create_vault(options = {}) ⇒ Vault

Examples:

Request syntax example with placeholder values


glacier.create_vault({
  vault_name: "string", # required
})

Basic usage

vault = glacier.create_vault(options)
vault.name
#=> "vault-name"

Options Hash (options):

  • :vault_name (required, String)

    The name of the vault.

Returns:

See Also:

#vaults(options = {}) ⇒ Collection<Vault>

Returns a Collection of Vault resources. No API requests are made until you call an enumerable method on the collection. Client#list_vaults will be called multiple times until every Vault has been yielded.

Examples:

Request syntax example with placeholder values


glacier.vaults({
  marker: "string",
  limit: 1,
})

Enumerating Vault resources.

glacier.vaults.each do |vault|
  # yields each vault
end

Enumerating Vault resources with a limit.

glacier.vaults.limit(10).each do |vault|
  # yields at most 10 vaults
end

Options Hash (options):

  • :marker (String)

    A string used for pagination. The marker specifies the vault ARN after which the listing of vaults should begin.

  • :limit (Integer)

Returns:

See Also: