Sha256: d32ea46d90e4e0422daac789258d0d1588065efd17503b709be6bbbce54f58dc

Contents?: true

Size: 775 Bytes

Versions: 7

Compression:

Stored size: 775 Bytes

Contents

class Project < CloudstackCli::Base

  desc "show NAME", "show detailed infos about a project"
  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

  desc "list", "list projects"
  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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cloudstack-cli-0.14.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.13.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.13.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.12.3 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.12.2 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.12.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.12.0 lib/cloudstack-cli/commands/project.rb