2010-11-08 07:21:31 -05:00
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 07:21:31 -05:00
|
|
|
class Real
|
2012-11-15 08:48:32 -05:00
|
|
|
# Get full details of the user.
|
2012-11-02 06:31:27 -04:00
|
|
|
#
|
2012-11-15 08:48:32 -05:00
|
|
|
# @overload get_user(identifier)
|
|
|
|
# @param [String] identifier Unique reference to identify the resource
|
2012-11-02 06:31:27 -04:00
|
|
|
#
|
2012-11-15 08:48:32 -05:00
|
|
|
# @overload get_user()
|
|
|
|
# @deprecated Use {Fog::Compute::Brightbox::Real#get_authenticated_user} instead
|
2012-11-02 06:31:27 -04:00
|
|
|
#
|
2012-11-15 08:48:32 -05:00
|
|
|
# @return [Hash] The JSON response parsed to a Hash
|
2012-11-02 06:31:27 -04:00
|
|
|
#
|
2012-11-15 08:48:32 -05:00
|
|
|
# @see https://api.gb1.brightbox.com/1.0/#user_get_user
|
2012-11-02 06:31:27 -04:00
|
|
|
#
|
2012-09-14 12:30:15 -04:00
|
|
|
def get_user(identifier = nil)
|
2012-11-02 06:31:27 -04:00
|
|
|
if identifier.nil? || identifier == ""
|
|
|
|
Fog::Logger.deprecation("get_user() without a parameter is deprecated, use get_authenticated_user instead [light_black](#{caller.first})[/]")
|
|
|
|
get_authenticated_user
|
2012-09-14 12:30:15 -04:00
|
|
|
else
|
|
|
|
request("get", "/1.0/users/#{identifier}", [200])
|
|
|
|
end
|
2010-11-08 07:21:31 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-09-14 12:30:15 -04:00
|
|
|
end
|