mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
end_point helpers
This commit is contained in:
parent
aeae34e948
commit
79eedad51b
3 changed files with 14 additions and 4 deletions
|
@ -34,7 +34,8 @@ module Fog
|
|||
end
|
||||
|
||||
class Real
|
||||
|
||||
attr_reader :end_point
|
||||
|
||||
include Fog::Vcloudng::Shared::Real
|
||||
include Fog::Vcloudng::Shared::Parser
|
||||
|
||||
|
@ -48,6 +49,7 @@ module Fog
|
|||
@port = options[:port] || Fog::Vcloudng::Compute::Defaults::PORT
|
||||
@scheme = options[:scheme] || Fog::Vcloudng::Compute::Defaults::SCHEME
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
||||
@end_point = "#{@scheme}://#{@host}:#{@port}#{@path}/"
|
||||
end
|
||||
|
||||
def default_vdc_id
|
||||
|
|
|
@ -31,16 +31,20 @@ module Fog
|
|||
# catalog = vcloud.get_catalog(catalog_uuid)
|
||||
# catalog_item_uuid = catalog.body["CatalogItems"].first["href"].split('/').last # get the first one
|
||||
#
|
||||
def get_catalog_item(catalog_item_uuid)
|
||||
def get_catalog_item(catalog_item_id)
|
||||
request(
|
||||
:expects => 200,
|
||||
:headers => { 'Accept' => 'application/*+xml;version=1.5' },
|
||||
:method => 'GET',
|
||||
:parser => Fog::Parsers::Vcloudng::Compute::GetCatalogItem.new,
|
||||
:path => "catalogItem/#{catalog_item_uuid}"
|
||||
:path => "catalogItem/#{catalog_item_id}"
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
def catalog_item_end_point(catalog_item_id = nil)
|
||||
end_point + ( catalog_item_id ? "catalogItem/#{catalog_item_id}" : "catalogItem" )
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,6 +38,10 @@ module Fog
|
|||
:path => "vdc/#{vdc_id}"
|
||||
)
|
||||
end
|
||||
|
||||
def vdc_end_point(vdc_id = nil)
|
||||
end_point + ( vdc_id ? "vdc/#{vdc_id}" : "vdc" )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue