Sha256: 5556fa616db13ea490f5e9ca4fdc5da6f6a77c4dc07ad864fe66d8821d435853

Contents?: true

Size: 765 Bytes

Versions: 15

Compression:

Stored size: 765 Bytes

Contents

class Project < CloudstackCli::Base

  desc "show NAME", "show detailed infos about a project"
  option :project
  def show(name)
    unless project = client.get_project(name)
      puts "No project with name #{name} found."
    else
      project.each do |key, value|
        say "#{key}: ", :yellow
        say "#{value}"
      end
    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

15 entries across 15 versions & 1 rubygems

Version Path
cloudstack-cli-0.10.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.10.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.9.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.9.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.8.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.8.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.7.4 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.7.3 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.7.2 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.7.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.7.0 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.6.1 lib/cloudstack-cli/commands/project.rb
cloudstack-cli-0.6.0 lib/cloudstack-cli/commands/project.rb