Method: Chef::UserV1.load

Defined in:
lib/chef/user_v1.rb

.load(username) ⇒ Object



304
305
306
307
308
# File 'lib/chef/user_v1.rb', line 304

def self.load(username)
  # will default to the current API version (Chef::Authenticator::DEFAULT_SERVER_API_VERSION)
  response = Chef::ServerAPI.new(Chef::Config[:chef_server_url]).get("users/#{username}")
  Chef::UserV1.from_hash(response)
end