Class: Fog::AWS::Glacier::Job
- Defined in:
- lib/fog/aws/models/glacier/job.rb
Constant Summary collapse
- ARCHIVE =
'archive-retrieval'
- INVENTORY =
'inventory-retrieval'
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#get_output(options = {}) ⇒ Object
pass :range => 1..1234 to only retrieve those bytes pass :io => f to stream the response to that tio.
- #ready? ⇒ Boolean
- #save ⇒ Object
- #vault ⇒ Object
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 Fog::Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#get_output(options = {}) ⇒ Object
pass :range => 1..1234 to only retrieve those bytes pass :io => f to stream the response to that tio
49 50 51 52 53 54 55 |
# File 'lib/fog/aws/models/glacier/job.rb', line 49 def get_output(={}) if io = .delete(:io) = .merge :response_block => lambda {|chunk, remaining_bytes, total_bytes| io.write chunk} end ['Range'] = .delete :range connection.get_job_output(vault.id, id, ) end |
#ready? ⇒ Boolean
30 31 32 |
# File 'lib/fog/aws/models/glacier/job.rb', line 30 def ready? completed end |
#save ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/fog/aws/models/glacier/job.rb', line 34 def save requires :vault, :type specification = {'Type' => type, 'ArchiveId' => archive_id, 'Format' => format, 'Description' => description, 'SNSTopic' => sns_topic}.reject{|k,v| v.nil?} data = connection.initiate_job(vault.id, specification) self.id = data.headers['x-amz-job-id'] reload end |
#vault ⇒ Object
43 44 45 |
# File 'lib/fog/aws/models/glacier/job.rb', line 43 def vault @vault end |