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

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

Instance Method Summary collapse

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 = service.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 = service.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