Sha256: 0d7f2e5f38e4e655c4a9ce5f0b1bf808cd562f2b9a3347f5cfe48f65479888a5

Contents?: true

Size: 709 Bytes

Versions: 45

Compression:

Stored size: 709 Bytes

Contents

class Job < CloudstackCli::Base

  desc 'list', 'list async jobs'
  def list
    jobs = client.list_jobs()
    if jobs.size < 1
      say "No jobs found."
    else
      table = [["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_job(id)
    job.each do |key, value| 
      say "#{key} : "
      if value.is_a?(Hash)
        value.each {|subkey, subvalue| say "   #{subkey} : #{subvalue}"}
      else 
        say(value)
      end
    end
  end
  
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
cloudstack-cli-0.15.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.15.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.14.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.14.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.13.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.13.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.12.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.12.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.12.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.12.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.11.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.11.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.11.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.10.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.10.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.10.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.9.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.9.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/job.rb