Class: Vcli::CLI::Show
- Inherits:
-
Thor
- Object
- Thor
- Vcli::CLI::Show
- Defined in:
- lib/vcli/cli/show.rb
Instance Method Summary collapse
- #datacenters ⇒ Object
- #enterprise ⇒ Object
- #limits ⇒ Object
- #resources ⇒ Object
- #users ⇒ Object
- #virtualappliances ⇒ Object
- #virtualdatacenters ⇒ Object
Instance Method Details
#datacenters ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/vcli/cli/show.rb', line 22 def datacenters( ) abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target, :abiquo_username => Vcli::user, :abiquo_password => Vcli::password) link=AbiquoAPI::Link.new(:href => 'api/admin/datacenters' , :type => 'application/vnd.abiquo.datacenters+json') dc=abq.list(link) dc.each { |l| puts "#{l.name} \t - #{l.id} \t - #{l.location}" } end |
#enterprise ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/vcli/cli/show.rb', line 72 def enterprise( ) abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target, :abiquo_username => Vcli::user, :abiquo_password => Vcli::password) link=AbiquoAPI::Link.new(:href => 'api/admin/enterprises', :type => 'application/vnd.abiquo.enterprises+json') dc=abq.list(link) dc.each { |l| puts "#{l.id} \t - #{l.name}" } end |
#limits ⇒ Object
92 93 94 95 |
# File 'lib/vcli/cli/show.rb', line 92 def limits( ) command = "showing limit details" puts command end |
#resources ⇒ Object
84 85 86 87 |
# File 'lib/vcli/cli/show.rb', line 84 def resources( ) command = "showing resources details" puts command end |
#users ⇒ Object
65 66 67 68 |
# File 'lib/vcli/cli/show.rb', line 65 def users( ) command = "showing all users" puts command end |
#virtualappliances ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vcli/cli/show.rb', line 34 def virtualappliances( ) abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target, :abiquo_username => Vcli::user, :abiquo_password => Vcli::password) # Get something on the screen puts "VDC,Appliance ID,Appliance Name" # If --vdc parameter passed vdc=[:vdc].to_s if vdc.length != 0 link2=AbiquoAPI::Link.new(:href => 'api/cloud/virtualdatacenters/' + vdc + '/virtualappliances' , :type => 'application/vnd.abiquo.virtualappliances+json') va=abq.list(link2) va.each { |l| puts "#{vdc},#{l.name},#{l.id}" } # If no --vdc parameter passwd else # Cycle through all virtualdatacenters link=AbiquoAPI::Link.new(:href => 'api/cloud/virtualdatacenters', :type => 'application/vnd.abiquo.virtualdatacenters+json') vdc=abq.list(link) # Cycle through all virtual appliances in virtual datacenter vdc.each { |l| link2=AbiquoAPI::Link.new(:href => 'api/cloud/virtualdatacenters/' + l.id.to_s + '/virtualappliances' , :type => 'application/vnd.abiquo.virtualappliances+json') dc=abq.list(link2) dc.each { |m| puts "#{l.id},#{m.id},#{m.name}" } } end end |
#virtualdatacenters ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vcli/cli/show.rb', line 99 def virtualdatacenters( ) abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target, :abiquo_username => Vcli::user, :abiquo_password => Vcli::password) link=AbiquoAPI::Link.new(:href => 'api/cloud/virtualdatacenters', :type => 'application/vnd.abiquo.virtualdatacenters+json') vdc=abq.list(link) vdc.each { |l| puts "#{l.id} \t - #{l.name}" } end |