1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloudng/requests/compute/get_network.rb

43 lines
1.2 KiB
Ruby
Raw Normal View History

2013-06-12 13:50:20 -04:00
module Fog
2013-06-18 10:57:32 -04:00
module Compute
class Vcloudng
2013-06-12 13:50:20 -04:00
class Real
2013-06-18 10:57:32 -04:00
2013-06-12 13:50:20 -04:00
require 'fog/vcloudng/parsers/compute/get_network'
# Get details for a Network
#
# ==== Parameters
# * network_id<~String> - Id of the network to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
#
# ==== How to get the catalog_uuid?
#
# org_uuid = vcloud.get_organizations.data[:body]["OrgList"].first["href"].split('/').last
# org = vcloud.get_organization(org_uuid)
#
# network_id = org.data[:body]["Links"].detect {|l| l["type"] =~ /vcloud.orgNetwork/ }["href"].split('/').last
def get_network(network_id)
request(
:expects => 200,
:headers => { 'Accept' => 'application/*+xml;version=1.5' },
:method => 'GET',
2013-06-18 10:57:32 -04:00
:parser => Fog::Parsers::Compute::Vcloudng::GetNetwork.new,
2013-06-12 13:50:20 -04:00
:path => "network/#{network_id}"
)
end
def network_end_point(network_id = nil)
end_point + ( network_id ? "network/#{network_id}" : "network" )
end
end
end
end
end