2012-01-17 11:19:21 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class IBM
|
|
|
|
class Real
|
|
|
|
|
|
|
|
# Get a location
|
|
|
|
#
|
2011-04-27 01:49:05 -04:00
|
|
|
# ==== Parameters
|
|
|
|
# * location_id<~String> - Id of location
|
|
|
|
#
|
2012-01-17 11:19:21 -05:00
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
2011-04-27 01:49:05 -04:00
|
|
|
# * body<~Hash>:
|
|
|
|
# * 'name'<~String>: location name
|
|
|
|
# * 'location'<~String>:
|
|
|
|
# * 'capabilities'<~Array>:
|
|
|
|
# * 'oss.storage.format'<~Hash>:
|
|
|
|
# * 'entries'<~Array>: list of supported volume formats
|
|
|
|
# * 'oss.instance.spec.i386'<~Array>: unsure.. returns empty array
|
|
|
|
# * 'oss.instance.spec.x86_64'<~Array>: unsure.. returns empty array
|
|
|
|
# * 'oss.storage.availabilityarea'<~Array>: availability area unsupported
|
|
|
|
# * 'id'<~String>: id of location
|
|
|
|
# * 'description'<~String>: description including geographic location
|
|
|
|
# * 'state'<~String>: state of datacenter
|
2012-01-17 11:19:21 -05:00
|
|
|
def get_location(location_id)
|
|
|
|
request(
|
|
|
|
:method => 'GET',
|
|
|
|
:expects => 200,
|
|
|
|
:path => "/locations/#{location_id}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-12-02 13:27:44 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def get_location(location_id)
|
|
|
|
response = Excon::Response.new
|
|
|
|
if location_exists? location_id
|
|
|
|
response.status = 200
|
|
|
|
response.body = self.data[:locations][location_id]
|
|
|
|
else
|
|
|
|
response.status = 404
|
|
|
|
end
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
def location_exists?(location_id)
|
|
|
|
self.data[:locations].key? location_id
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2012-01-17 11:19:21 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|