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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#multipart_chunk_sizeObject

must be a power of 2 multiple of 1MB



11
12
13
# File 'lib/fog/aws/models/glacier/archive.rb', line 11

def multipart_chunk_size
  @multipart_chunk_size
end

Instance Method Details

#destroyObject



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

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

#saveObject



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

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



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

def vault
  @vault
end