Sha256: 0b5960993b3a54e56cf158a084662295de2ab392ae15de20d4988e5631a207b5

Contents?: true

Size: 604 Bytes

Versions: 40

Compression:

Stored size: 604 Bytes

Contents

require 'fog/core/collection'
require 'fog/cloudstack/models/compute/job'

module Fog
  module Compute
    class Cloudstack
      class Jobs < Fog::Collection
        model Fog::Compute::Cloudstack::Job

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

        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
      end
    end
  end
end

Version data entries

40 entries across 38 versions & 5 rubygems

Version Path
fog-2.1.0 lib/fog/cloudstack/models/compute/jobs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/jobs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/jobs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/jobs.rb
fog-1.42.1 lib/fog/cloudstack/models/compute/jobs.rb
fog-2.0.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.42.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.41.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.40.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.39.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.38.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.37.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.36.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.35.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-2.0.0.pre.0 lib/fog/cloudstack/models/compute/jobs.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/cloudstack/models/compute/jobs.rb
fog-1.34.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.33.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.32.0 lib/fog/cloudstack/models/compute/jobs.rb
fog-1.31.0 lib/fog/cloudstack/models/compute/jobs.rb