Class: Job
- Inherits:
-
CloudstackCli::Base
- Object
- Thor
- CloudstackCli::Base
- Job
- Defined in:
- lib/cloudstack-cli/commands/job.rb
Constant Summary
Constants included from CloudstackCli::Helper
CloudstackCli::Helper::ASYNC_STATES
Instance Attribute Summary
Attributes inherited from CloudstackCli::Base
Instance Method Summary collapse
Methods inherited from CloudstackCli::Base
Methods included from CloudstackCli::Helper
#ask_number, #bootstrap_server, #bootstrap_server_interactive, #create_port_rules, #create_server, #print_job_status, #print_options, #update_job_status, #watch_jobs
Instance Method Details
#list ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cloudstack-cli/commands/job.rb', line 4 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 |
#query(id) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cloudstack-cli/commands/job.rb', line 18 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 |