Sha256: 52d27b5e9831f6ebe250f77ab42bf231081d01c670425cfde89ebbefd8f9c7a7

Contents?: true

Size: 697 Bytes

Versions: 27

Compression:

Stored size: 697 Bytes

Contents

class Job < CloudstackCli::Base

  desc 'list', 'list async jobs'
  def list
    jobs = client.list_async_jobs
    if jobs.size < 1
      say "No jobs found."
    else
      table = [%w(Command Created Status ID User-ID)]
      jobs.each do |job|
        table << [
          job['cmd'].split('.')[-1],
          job['created'],
          job['jobstatus'],
          job['jobid'],
          job['userid']
        ]
      end
      print_table table
    end
  end

  desc 'query ID', 'query async job'
  def query(id)
    job = client.query_async_job_result(jobid: id)
    table = job.map do |key, value|
      [ set_color("#{key}:", :yellow), "#{value}" ]
    end
    print_table table
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstack-cli-1.4.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.4.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.3.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.3.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.3.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.3.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.7 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.6 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/job.rb