Revision 86c86610 src/sunstone/routes/vcenter.rb

View differences:

src/sunstone/routes/vcenter.rb
87 87
	end
88 88
end
89 89

  
90

  
91
get '/vcenter/vms' do
92
    begin
93
        vms = vcenter_client.running_vms(
94
            $cloud_auth.client(session[:user], session[:active_zone_endpoint]))
95
        if vms.nil?
96
            msg = "No datacenter found"
97
            logger.error("[vCenter] " + msg)
98
            error = Error.new(msg)
99
            error 404, error.to_json
100
        end
101

  
102
        [200, vms.to_json]
103
    rescue Exception => e
104
        logger.error("[vCenter] " + e.message)
105
        error = Error.new(e.message)
106
        error 403, error.to_json
107
    end
108
end
109

  
110 90
get '/vcenter/networks' do
111 91
    begin
112 92
        networks = vcenter_client.vcenter_networks(

Also available in: Unified diff