lib/opendistro/client/users.rb
# Creates a new user.
# Requires authentication from an admin account.
#
# @example
#   Opendistro.create_user('joe','secret', { attribute1: ...})
#   or
#   Opendistro.create_user('joe','secret', { description: 'user for test' })
#
# @param  [String] username(required) The username of a user.
# @param  [String] password(required) The password of a user.
# @param  [Hash] options A customizable set of options.
# @return [Opendistro::ObjectifiedHash] Information about created user.
Creates a new user.
Requires authentication from an admin account.
Creates a new user . Requires authentication from an admin account .
def create_user(username, password, options = {})
      raise ArgumentError, 'Missing required parameters' unless username || password
      put("/_opendistro/_security/api/internalusers/#{username}", body: { password: password }.merge!(options))
    end
def create_user ( username , password , options = { } ) raise ArgumentError , 'Missing required parameters' unless username || password put ( "/_opendistro/_security/api/internalusers/#{username}" , body : { password : password } . merge! ( options ) ) end
Creates a new user.
Creates a new user .
Information about created user.
Information about created user .
Opendistro::ObjectifiedHash
username
password
options
options A customizable set of options.
options A customizable set of options .
example
Opendistro.create_user('joe','secret', { attribute1: ...}) or Opendistro.create_user('joe','secret', { description: 'user for test' })
Opendistro . create_user ( ' joe ' ' secret ' { attribute1 : ... } ) or Opendistro . create_user ( ' joe ' ' secret ' { description : ' user for test ' } )