Class: Fog::AWS::Glacier::Job
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::Glacier::Job
- Defined in:
- lib/fog/aws/models/glacier/job.rb
Constant Summary collapse
- ARCHIVE =
'archive-retrieval'
- INVENTORY =
'inventory-retrieval'
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
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
44 45 46 47 48 49 50 |
# File 'lib/fog/aws/models/glacier/job.rb', line 44 def get_output(={}) if io = .delete(:io) = .merge :response_block => lambda {|chunk, remaining_bytes, total_bytes| io.write chunk} end ['Range'] = .delete :range service.get_job_output(vault.id, id, ) end |
#ready? ⇒ Boolean
25 26 27 |
# File 'lib/fog/aws/models/glacier/job.rb', line 25 def ready? completed end |
#save ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/fog/aws/models/glacier/job.rb', line 29 def save requires :vault, :type specification = {'Type' => type, 'ArchiveId' => archive_id, 'Format' => format, 'Description' => description, 'SNSTopic' => sns_topic}.reject{|k,v| v.nil?} data = service.initiate_job(vault.id, specification) self.id = data.headers['x-amz-job-id'] reload end |
#vault ⇒ Object
38 39 40 |
# File 'lib/fog/aws/models/glacier/job.rb', line 38 def vault @vault end |