Class: Aws::Glacier::Resource
- Inherits:
-
Object
- Object
- Aws::Glacier::Resource
- Defined in:
- lib/aws-sdk-glacier/resource.rb
Actions collapse
Associations collapse
Instance Method Summary collapse
- #client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#account(id) ⇒ Account
47 48 49 50 51 52 |
# File 'lib/aws-sdk-glacier/resource.rb', line 47 def account(id) Account.new( id: id, client: @client ) end |
#create_vault(options = {}) ⇒ Vault
33 34 35 36 37 38 39 40 41 |
# File 'lib/aws-sdk-glacier/resource.rb', line 33 def create_vault( = {}) = .merge(account_id: "-") resp = @client.create_vault() Vault.new( account_id: [:account_id], name: [:vault_name], client: @client ) end |
#vaults(options = {}) ⇒ Vault::Collection
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/aws-sdk-glacier/resource.rb', line 59 def vaults( = {}) batches = Enumerator.new do |y| = .merge(account_id: "-") resp = @client.list_vaults() resp.each_page do |page| batch = [] page.data.vault_list.each do |v| batch << Vault.new( account_id: [:account_id], name: v.vault_name, data: v, client: @client ) end y.yield(batch) end end Vault::Collection.new(batches) end |