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
2013-06-18 16:59:42 +02:00

43 lines
No EOL
1.2 KiB
Ruby

module Fog
module Compute
class Vcloudng
class Real
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',
:parser => Fog::Parsers::Compute::Vcloudng::GetNetwork.new,
: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