Class: Project
- Inherits:
-
CloudstackCli::Base
- Object
- Thor
- CloudstackCli::Base
- Project
- Defined in:
- lib/cloudstack-cli/commands/project.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
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cloudstack-cli/commands/project.rb', line 16 def list projects = client.list_projects if projects.size < 1 puts "No projects found." else table = [["Name", "Displaytext", "Domain"]] projects.each do |project| table << [project['name'], project['displaytext'], project['domain']] end print_table(table) say "Total number of projects: #{projects.count}" end end |
#show(name) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/cloudstack-cli/commands/project.rb', line 4 def show(name) unless project = client.get_project(name) puts "No project with name #{name} found." else table = project.map do |key, value| [ set_color("#{key}", :yellow), "#{value}" ] end print_table table end end |