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.8.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.8.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.7.4 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.7.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.7.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.7.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.7.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.6.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.6.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.8 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.5 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.4 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.3 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.2 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.1 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.5.0 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.3.10 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.3.9 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.3.8 lib/cloudstack-cli/commands/job.rb
cloudstack-cli-0.3.7 lib/cloudstack-cli/commands/job.rb