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.



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

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)



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

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

#get(key) ⇒ Object



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

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

#new(attributes = {}) ⇒ Object



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

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