Class: Fog::AWS::Glacier::Archive

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/glacier/archive.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Attribute Details

#multipart_chunk_sizeObject

must be a power of 2 multiple of 1MB



13
14
15
# File 'lib/fog/aws/models/glacier/archive.rb', line 13

def multipart_chunk_size
  @multipart_chunk_size
end

Instance Method Details

#destroyObject



31
32
33
34
# File 'lib/fog/aws/models/glacier/archive.rb', line 31

def destroy
  requires :id
  service.delete_archive(vault.id,id)
end

#saveObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/aws/models/glacier/archive.rb', line 19

def save
  requires :body, :vault

  if multipart_chunk_size && body.respond_to?(:read)
    self.id = multipart_save
  else
    data = service.create_archive(vault.id, body, 'description' => description)
    self.id = data.headers['x-amz-archive-id']
  end
  true
end

#vaultObject



15
16
17
# File 'lib/fog/aws/models/glacier/archive.rb', line 15

def vault
  @vault
end