Class: CloudstackCli::Cli

Inherits:
Base
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/cloudstack-cli/cli.rb

Constant Summary

Constants included from Helper

Helper::ASYNC_STATES

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Methods included from 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

#command(command, *args) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/cloudstack-cli/cli.rb', line 32

def command(command, *args)
  params = {'command' => command}
  args.each do |arg|
    arg = arg.split('=')
    params[arg[0]] = arg[1] 
  end
  data = client.send_request(params)
  puts JSON.pretty_generate(data)
end

#setupObject



27
28
29
# File 'lib/cloudstack-cli/cli.rb', line 27

def setup
  invoke "environment:add", :environment => options[:environment]
end

#versionObject



21
22
23
# File 'lib/cloudstack-cli/cli.rb', line 21

def version
  say "cloudstack-cli version #{CloudstackCli::VERSION}"
end