Browse Source

not fixed yet

Chris Mague 7 years ago
parent
commit
2d2d95e3c3
2 changed files with 6 additions and 2 deletions
  1. 4 0
      lib/neoinfra/vpcs.rb
  2. 2 2
      web/controllers/views.rb

+ 4 - 0
lib/neoinfra/vpcs.rb

@@ -19,6 +19,10 @@ module NeoInfra
       22
     end
 
+    def list_vpcs
+      Vpc.all.collect{|x| {'vpc_id' => x.vpc_id, 'name'=>x.name, 'region' => x.region.region, 'owner' => x.owned.name, 'cidr' => x.cidr, 'default' => x.default} }.select{ |y| y['default'] == "false"}      
+    end
+
     def load
       aws = NeoInfra::Aws.new
       @cfg = NeoInfra::Config.new

+ 2 - 2
web/controllers/views.rb

@@ -16,8 +16,8 @@ class Views < Sinatra::Base
   set :views, File.join(File.dirname(__FILE__), '..', '/views')
 
   get '/vpcs' do
-    status 200
-    puts Vpc
+    w = NeoInfra::Vpcs.new
+    w.list_vpcs.to_json
   end
 
   get '/buckets' do