Class: Fog::AWS::Glacier::Jobs

Inherits:
Collection show all
Defined in:
lib/fog/aws/models/glacier/jobs.rb

Instance Attribute Summary

Attributes inherited from Collection

#connection

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #destroy, #inspect, #load, model, #model, #reload, #table, #to_json

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

#initialize(attributes) ⇒ Jobs

Returns a new instance of Jobs.



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

def initialize(attributes)
  self.filters = {}
  super
end

Instance Method Details

#all(filters = self.filters) ⇒ Object

acceptable filters are: statuscode InProgress/Failed/Succeeded completed (true/false)



22
23
24
25
26
# File 'lib/fog/aws/models/glacier/jobs.rb', line 22

def all(filters = self.filters)
  self.filters = filters
  data = connection.list_jobs(vault.id, self.filters).body['JobList']
  load(data)
end

#get(key) ⇒ Object



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

def get(key)
  data = connection.describe_job(vault.id, key).body
  new(data)
rescue Excon::Errors::NotFound
  nil
end

#new(attributes = {}) ⇒ Object



35
36
37
38
# File 'lib/fog/aws/models/glacier/jobs.rb', line 35

def new(attributes = {})
  requires :vault
  super({ :vault => vault }.merge!(attributes))
end