Class: Fog::Compute::Cloudstack::Jobs

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/cloudstack/models/compute/jobs.rb

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
# File 'lib/fog/cloudstack/models/compute/jobs.rb', line 10

def all
  data = service.list_async_jobs["listasyncjobsresponse"]["asyncjobs"] || []
  load(data)
end

#get(job_id) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fog/cloudstack/models/compute/jobs.rb', line 15

def get(job_id)
  if job = service.query_async_job_result('jobid' => job_id)["queryasyncjobresultresponse"]
    new(job)
  end
rescue Fog::Compute::Cloudstack::BadRequest
  nil
end