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/hp/requests/lb/get_version.rb
2013-10-30 19:01:58 -04:00

47 lines
No EOL
1.1 KiB
Ruby

module Fog
module HP
class LB
class Real
# Get details for existing database flavor instance
#
# ==== Parameters
# * flavor_id<~Integer> - Id of the flavor to get
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * TBD
def get_version(version_id)
response = request(
:expects => 200,
:method => 'GET',
:path => "/#{version_id}/",
:version => true
)
response
end
end
class Mock # :nodoc:all
def get_version(version_id)
unless version_id
raise ArgumentError.new('version_id is required')
end
response = Excon::Response.new
if version = list_versions.body['versions'].detect { |_| _['id'] == version_id }
response.status = 200
response.body = {'version' => version}
response
else
raise Fog::HP::LB::NotFound
end
end
end
end
end
end