module Elasticsearch::API::Security::Actions

Public Instance Methods

activate_user_profile(arguments = {}) click to toggle source

Creates or updates the user profile on behalf of another user.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The grant type and user’s credential (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-activate-user-profile.html

# File lib/elasticsearch/api/actions/security/activate_user_profile.rb, line 32
def activate_user_profile(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.activate_user_profile' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/profile/_activate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
authenticate(arguments = {}) click to toggle source

Enables authentication as a user and retrieve information about the authenticated user.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-authenticate.html

# File lib/elasticsearch/api/actions/security/authenticate.rb, line 31
def authenticate(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.authenticate' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/_authenticate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
bulk_delete_role(arguments = {}) click to toggle source

Bulk delete roles in the native realm.

@option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The roles to delete (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-bulk-delete-role.html

# File lib/elasticsearch/api/actions/security/bulk_delete_role.rb, line 33
def bulk_delete_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_delete_role' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_DELETE
  path   = '_security/role'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
bulk_put_role(arguments = {}) click to toggle source

Bulk adds and updates roles in the native realm.

@option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The roles to add (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-bulk-put-role.html

# File lib/elasticsearch/api/actions/security/bulk_put_role.rb, line 33
def bulk_put_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_put_role' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/role'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
bulk_update_api_keys(arguments = {}) click to toggle source

Updates the attributes of multiple existing API keys.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The API key request to update the attributes of multiple API keys. (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-bulk-update-api-keys.html

# File lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb, line 32
def bulk_update_api_keys(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_update_api_keys' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/api_key/_bulk_update'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
change_password(arguments = {}) click to toggle source

Changes the passwords of users in the native realm and built-in users.

@option arguments [String] :username The username of the user to change the password for @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body the new password for the user (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-change-password.html

# File lib/elasticsearch/api/actions/security/change_password.rb, line 34
def change_password(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.change_password' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_PUT
  path   = if _username
             "_security/user/#{Utils.__listify(_username)}/_password"
           else
             '_security/user/_password'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
clear_api_key_cache(arguments = {}) click to toggle source

Clear a subset or all entries from the API key cache.

@option arguments [List] :ids A comma-separated list of IDs of API keys to clear from the cache @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-clear-api-key-cache.html

# File lib/elasticsearch/api/actions/security/clear_api_key_cache.rb, line 32
def clear_api_key_cache(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.clear_api_key_cache' }

  defined_params = [:ids].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'ids' missing" unless arguments[:ids]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _ids = arguments.delete(:ids)

  method = Elasticsearch::API::HTTP_POST
  path   = "_security/api_key/#{Utils.__listify(_ids)}/_clear_cache"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
clear_cached_privileges(arguments = {}) click to toggle source

Evicts application privileges from the native application privileges cache.

@option arguments [List] :application A comma-separated list of application names @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-clear-privilege-cache.html

# File lib/elasticsearch/api/actions/security/clear_cached_privileges.rb, line 32
def clear_cached_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_privileges' }

  defined_params = [:application].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'application' missing" unless arguments[:application]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _application = arguments.delete(:application)

  method = Elasticsearch::API::HTTP_POST
  path   = "_security/privilege/#{Utils.__listify(_application)}/_clear_cache"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
clear_cached_realms(arguments = {}) click to toggle source

Evicts users from the user cache. Can completely clear the cache or evict specific users.

@option arguments [List] :realms Comma-separated list of realms to clear @option arguments [List] :usernames Comma-separated list of usernames to clear from the cache @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-clear-cache.html

# File lib/elasticsearch/api/actions/security/clear_cached_realms.rb, line 33
def clear_cached_realms(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_realms' }

  defined_params = [:realms].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'realms' missing" unless arguments[:realms]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _realms = arguments.delete(:realms)

  method = Elasticsearch::API::HTTP_POST
  path   = "_security/realm/#{Utils.__listify(_realms)}/_clear_cache"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
clear_cached_roles(arguments = {}) click to toggle source

Evicts roles from the native role cache.

@option arguments [List] :name Role name @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-clear-role-cache.html

# File lib/elasticsearch/api/actions/security/clear_cached_roles.rb, line 32
def clear_cached_roles(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_roles' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_security/role/#{Utils.__listify(_name)}/_clear_cache"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
clear_cached_service_tokens(arguments = {}) click to toggle source

Evicts tokens from the service account token caches.

@option arguments [String] :namespace An identifier for the namespace @option arguments [String] :service An identifier for the service name @option arguments [List] :name A comma-separated list of service token names @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-clear-service-token-caches.html

# File lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb, line 34
def clear_cached_service_tokens(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_service_tokens' }

  defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'namespace' missing" unless arguments[:namespace]
  raise ArgumentError, "Required argument 'service' missing" unless arguments[:service]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _namespace = arguments.delete(:namespace)

  _service = arguments.delete(:service)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}/_clear_cache"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
create_api_key(arguments = {}) click to toggle source

Creates an API key for access without requiring basic authentication.

@option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The api key request to create an API key (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-create-api-key.html

# File lib/elasticsearch/api/actions/security/create_api_key.rb, line 33
def create_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.create_api_key' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_PUT
  path   = '_security/api_key'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
create_cross_cluster_api_key(arguments = {}) click to toggle source

Creates a cross-cluster API key for API key based remote cluster access.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The request to create a cross-cluster API key (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-create-cross-cluster-api-key.html

# File lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb, line 32
def create_cross_cluster_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.create_cross_cluster_api_key' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/cross_cluster/api_key'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
create_service_token(arguments = {}) click to toggle source

Creates a service account token for access without requiring basic authentication.

@option arguments [String] :namespace An identifier for the namespace @option arguments [String] :service An identifier for the service name @option arguments [String] :name An identifier for the token name @option arguments [String] :refresh If ‘true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-create-service-token.html

# File lib/elasticsearch/api/actions/security/create_service_token.rb, line 35
def create_service_token(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.create_service_token' }

  defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'namespace' missing" unless arguments[:namespace]
  raise ArgumentError, "Required argument 'service' missing" unless arguments[:service]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _namespace = arguments.delete(:namespace)

  _service = arguments.delete(:service)

  _name = arguments.delete(:name)

  method = _name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST
  path   = if _namespace && _service && _name
             "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}"
           else
             "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token"
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_privileges(arguments = {}) click to toggle source

Removes application privileges.

@option arguments [String] :application Application name @option arguments [String] :name Privilege name @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-delete-privilege.html

# File lib/elasticsearch/api/actions/security/delete_privileges.rb, line 34
def delete_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.delete_privileges' }

  defined_params = %i[application name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'application' missing" unless arguments[:application]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _application = arguments.delete(:application)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_security/privilege/#{Utils.__listify(_application)}/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_role(arguments = {}) click to toggle source

Removes roles in the native realm.

@option arguments [String] :name Role name @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-delete-role.html

# File lib/elasticsearch/api/actions/security/delete_role.rb, line 33
def delete_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.delete_role' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_security/role/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_role_mapping(arguments = {}) click to toggle source

Removes role mappings.

@option arguments [String] :name Role-mapping name @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-delete-role-mapping.html

# File lib/elasticsearch/api/actions/security/delete_role_mapping.rb, line 33
def delete_role_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.delete_role_mapping' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_security/role_mapping/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_service_token(arguments = {}) click to toggle source

Deletes a service account token.

@option arguments [String] :namespace An identifier for the namespace @option arguments [String] :service An identifier for the service name @option arguments [String] :name An identifier for the token name @option arguments [String] :refresh If ‘true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-delete-service-token.html

# File lib/elasticsearch/api/actions/security/delete_service_token.rb, line 35
def delete_service_token(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.delete_service_token' }

  defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'namespace' missing" unless arguments[:namespace]
  raise ArgumentError, "Required argument 'service' missing" unless arguments[:service]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _namespace = arguments.delete(:namespace)

  _service = arguments.delete(:service)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
delete_user(arguments = {}) click to toggle source

Deletes users from the native realm.

@option arguments [String] :username username @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-delete-user.html

# File lib/elasticsearch/api/actions/security/delete_user.rb, line 33
def delete_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.delete_user' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'username' missing" unless arguments[:username]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_security/user/#{Utils.__listify(_username)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
disable_user(arguments = {}) click to toggle source

Disables users in the native realm.

@option arguments [String] :username The username of the user to disable @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-disable-user.html

# File lib/elasticsearch/api/actions/security/disable_user.rb, line 33
def disable_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'username' missing" unless arguments[:username]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/user/#{Utils.__listify(_username)}/_disable"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
disable_user_profile(arguments = {}) click to toggle source

Disables a user profile so it’s not visible in user profile searches.

@option arguments [String] :uid Unique identifier for the user profile @option arguments [String] :refresh If ‘true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-disable-user-profile.html

# File lib/elasticsearch/api/actions/security/disable_user_profile.rb, line 33
def disable_user_profile(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user_profile' }

  defined_params = [:uid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _uid = arguments.delete(:uid)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/profile/#{Utils.__listify(_uid)}/_disable"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
enable_user(arguments = {}) click to toggle source

Enables users in the native realm.

@option arguments [String] :username The username of the user to enable @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-enable-user.html

# File lib/elasticsearch/api/actions/security/enable_user.rb, line 33
def enable_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'username' missing" unless arguments[:username]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/user/#{Utils.__listify(_username)}/_enable"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
enable_user_profile(arguments = {}) click to toggle source

Enables a user profile so it’s visible in user profile searches.

@option arguments [String] :uid An unique identifier of the user profile @option arguments [String] :refresh If ‘true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-enable-user-profile.html

# File lib/elasticsearch/api/actions/security/enable_user_profile.rb, line 33
def enable_user_profile(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user_profile' }

  defined_params = [:uid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _uid = arguments.delete(:uid)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/profile/#{Utils.__listify(_uid)}/_enable"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
enroll_kibana(arguments = {}) click to toggle source

Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-kibana-enrollment.html

# File lib/elasticsearch/api/actions/security/enroll_kibana.rb, line 31
def enroll_kibana(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.enroll_kibana' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/enroll/kibana'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
enroll_node(arguments = {}) click to toggle source

Allows a new node to enroll to an existing cluster with security enabled.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-node-enrollment.html

# File lib/elasticsearch/api/actions/security/enroll_node.rb, line 31
def enroll_node(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.enroll_node' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/enroll/node'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_api_key(arguments = {}) click to toggle source

Retrieves information for one or more API keys.

@option arguments [String] :id API key id of the API key to be retrieved @option arguments [String] :name API key name of the API key to be retrieved @option arguments [String] :username user name of the user who created this API key to be retrieved @option arguments [String] :realm_name realm name of the user who created this API key to be retrieved @option arguments [Boolean] :owner flag to query API keys owned by the currently authenticated user @option arguments [Boolean] :with_limited_by flag to show the limited-by role descriptors of API Keys @option arguments [Boolean] :with_profile_uid flag to also retrieve the API Key’s owner profile uid, if it exists @option arguments [Boolean] :active_only flag to limit response to only active (not invalidated or expired) API keys @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-api-key.html

# File lib/elasticsearch/api/actions/security/get_api_key.rb, line 39
def get_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_api_key' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/api_key'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_builtin_privileges(arguments = {}) click to toggle source

Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-builtin-privileges.html

# File lib/elasticsearch/api/actions/security/get_builtin_privileges.rb, line 31
def get_builtin_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_builtin_privileges' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/privilege/_builtin'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_privileges(arguments = {}) click to toggle source

Retrieves application privileges.

@option arguments [String] :application Application name @option arguments [String] :name Privilege name @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-privileges.html

# File lib/elasticsearch/api/actions/security/get_privileges.rb, line 33
def get_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_privileges' }

  defined_params = %i[application name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _application = arguments.delete(:application)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _application && _name
             "_security/privilege/#{Utils.__listify(_application)}/#{Utils.__listify(_name)}"
           elsif _application
             "_security/privilege/#{Utils.__listify(_application)}"
           else
             '_security/privilege'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_role(arguments = {}) click to toggle source

Retrieves roles in the native realm.

@option arguments [List] :name A comma-separated list of role names @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-role.html

# File lib/elasticsearch/api/actions/security/get_role.rb, line 32
def get_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_role' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_security/role/#{Utils.__listify(_name)}"
           else
             '_security/role'
           end
  params = Utils.process_params(arguments)

  if Array(arguments[:ignore]).include?(404)
    Utils.__rescue_from_not_found do
      Elasticsearch::API::Response.new(
        perform_request(method, path, params, body, headers, request_opts)
      )
    end
  else
    Elasticsearch::API::Response.new(
      perform_request(method, path, params, body, headers, request_opts)
    )
  end
end
get_role_mapping(arguments = {}) click to toggle source

Retrieves role mappings.

@option arguments [List] :name A comma-separated list of role-mapping names @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-role-mapping.html

# File lib/elasticsearch/api/actions/security/get_role_mapping.rb, line 32
def get_role_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_role_mapping' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_security/role_mapping/#{Utils.__listify(_name)}"
           else
             '_security/role_mapping'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_service_accounts(arguments = {}) click to toggle source

Retrieves information about service accounts.

@option arguments [String] :namespace An identifier for the namespace @option arguments [String] :service An identifier for the service name @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-service-accounts.html

# File lib/elasticsearch/api/actions/security/get_service_accounts.rb, line 33
def get_service_accounts(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_service_accounts' }

  defined_params = %i[namespace service].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _namespace = arguments.delete(:namespace)

  _service = arguments.delete(:service)

  method = Elasticsearch::API::HTTP_GET
  path   = if _namespace && _service
             "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}"
           elsif _namespace
             "_security/service/#{Utils.__listify(_namespace)}"
           else
             '_security/service'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_service_credentials(arguments = {}) click to toggle source

Retrieves information of all service credentials for a service account.

@option arguments [String] :namespace An identifier for the namespace @option arguments [String] :service An identifier for the service name @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-service-credentials.html

# File lib/elasticsearch/api/actions/security/get_service_credentials.rb, line 33
def get_service_credentials(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_service_credentials' }

  defined_params = %i[namespace service].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'namespace' missing" unless arguments[:namespace]
  raise ArgumentError, "Required argument 'service' missing" unless arguments[:service]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _namespace = arguments.delete(:namespace)

  _service = arguments.delete(:service)

  method = Elasticsearch::API::HTTP_GET
  path   = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_settings(arguments = {}) click to toggle source

Retrieve settings for the security system indices

@option arguments [Time] :master_timeout Timeout for connection to master @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-settings.html

# File lib/elasticsearch/api/actions/security/get_settings.rb, line 32
def get_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_settings' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/settings'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_token(arguments = {}) click to toggle source

Creates a bearer token for access without requiring basic authentication.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The token request to get (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-token.html

# File lib/elasticsearch/api/actions/security/get_token.rb, line 32
def get_token(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_token' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/oauth2/token'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_user(arguments = {}) click to toggle source

Retrieves information about users in the native realm and built-in users.

@option arguments [List] :username A comma-separated list of usernames @option arguments [Boolean] :with_profile_uid flag to retrieve profile uid (if exists) associated to the user @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-user.html

# File lib/elasticsearch/api/actions/security/get_user.rb, line 33
def get_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_user' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_GET
  path   = if _username
             "_security/user/#{Utils.__listify(_username)}"
           else
             '_security/user'
           end
  params = Utils.process_params(arguments)

  if Array(arguments[:ignore]).include?(404)
    Utils.__rescue_from_not_found do
      Elasticsearch::API::Response.new(
        perform_request(method, path, params, body, headers, request_opts)
      )
    end
  else
    Elasticsearch::API::Response.new(
      perform_request(method, path, params, body, headers, request_opts)
    )
  end
end
get_user_privileges(arguments = {}) click to toggle source

Retrieves security privileges for the logged in user.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-user-privileges.html

# File lib/elasticsearch/api/actions/security/get_user_privileges.rb, line 31
def get_user_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_privileges' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_security/user/_privileges'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_user_profile(arguments = {}) click to toggle source

Retrieves user profiles for the given unique ID(s).

@option arguments [List] :uid A comma-separated list of unique identifier for user profiles @option arguments [List] :data A comma-separated list of keys for which the corresponding application data are retrieved. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-get-user-profile.html

# File lib/elasticsearch/api/actions/security/get_user_profile.rb, line 33
def get_user_profile(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_profile' }

  defined_params = [:uid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _uid = arguments.delete(:uid)

  method = Elasticsearch::API::HTTP_GET
  path   = "_security/profile/#{Utils.__listify(_uid)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
grant_api_key(arguments = {}) click to toggle source

Creates an API key on behalf of another user.

@option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The api key request to create an API key (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-grant-api-key.html

# File lib/elasticsearch/api/actions/security/grant_api_key.rb, line 33
def grant_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.grant_api_key' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/api_key/grant'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
has_privileges(arguments = {}) click to toggle source

Determines whether the specified user has a specified list of privileges.

@option arguments [String] :user Username @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The privileges to test (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-has-privileges.html

# File lib/elasticsearch/api/actions/security/has_privileges.rb, line 33
def has_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges' }

  defined_params = [:user].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _user = arguments.delete(:user)

  method = Elasticsearch::API::HTTP_POST
  path   = if _user
             "_security/user/#{Utils.__listify(_user)}/_has_privileges"
           else
             '_security/user/_has_privileges'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
has_privileges_user_profile(arguments = {}) click to toggle source

Determines whether the users associated with the specified profile IDs have all the requested privileges.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The privileges to check and the list of profile IDs (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-has-privileges-user-profile.html

# File lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb, line 32
def has_privileges_user_profile(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges_user_profile' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/profile/_has_privileges'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
invalidate_api_key(arguments = {}) click to toggle source

Invalidates one or more API keys.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The api key request to invalidate API key(s) (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-invalidate-api-key.html

# File lib/elasticsearch/api/actions/security/invalidate_api_key.rb, line 32
def invalidate_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.invalidate_api_key' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_DELETE
  path   = '_security/api_key'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
invalidate_token(arguments = {}) click to toggle source

Invalidates one or more access tokens or refresh tokens.

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The token to invalidate (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-invalidate-token.html

# File lib/elasticsearch/api/actions/security/invalidate_token.rb, line 32
def invalidate_token(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.invalidate_token' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_DELETE
  path   = '_security/oauth2/token'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
oidc_authenticate(arguments = {}) click to toggle source

Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The OpenID Connect response to authenticate (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-oidc-authenticate.html

# File lib/elasticsearch/api/actions/security/oidc_authenticate.rb, line 32
def oidc_authenticate(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_authenticate' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/oidc/authenticate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
oidc_logout(arguments = {}) click to toggle source

Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body Access token and refresh token to invalidate (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-oidc-logout.html

# File lib/elasticsearch/api/actions/security/oidc_logout.rb, line 32
def oidc_logout(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_logout' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/oidc/logout'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
oidc_prepare_authentication(arguments = {}) click to toggle source

Creates an OAuth 2.0 authentication request as a URL string

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The OpenID Connect authentication realm configuration (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-oidc-prepare-authentication.html

# File lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb, line 32
def oidc_prepare_authentication(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_prepare_authentication' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/oidc/prepare'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_privileges(arguments = {}) click to toggle source

Adds or updates application privileges.

@option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The privilege(s) to add (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-put-privileges.html

# File lib/elasticsearch/api/actions/security/put_privileges.rb, line 33
def put_privileges(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.put_privileges' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_PUT
  path   = '_security/privilege'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_role(arguments = {}) click to toggle source

Adds and updates roles in the native realm.

@option arguments [String] :name Role name @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The role to add (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-put-role.html

# File lib/elasticsearch/api/actions/security/put_role.rb, line 34
def put_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.put_role' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/role/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_role_mapping(arguments = {}) click to toggle source

Creates and updates role mappings.

@option arguments [String] :name Role-mapping name @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The role mapping to add (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-put-role-mapping.html

# File lib/elasticsearch/api/actions/security/put_role_mapping.rb, line 34
def put_role_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.put_role_mapping' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/role_mapping/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_user(arguments = {}) click to toggle source

Adds and updates users in the native realm. These users are commonly referred to as native users.

@option arguments [String] :username The username of the User @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The user to add (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-put-user.html

# File lib/elasticsearch/api/actions/security/put_user.rb, line 34
def put_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.put_user' }

  defined_params = [:username].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'username' missing" unless arguments[:username]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/user/#{Utils.__listify(_username)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
query_api_keys(arguments = {}) click to toggle source

Retrieves information for API keys using a subset of query DSL

@option arguments [Boolean] :with_limited_by flag to show the limited-by role descriptors of API Keys @option arguments [Boolean] :with_profile_uid flag to also retrieve the API Key’s owner profile uid, if it exists @option arguments [Boolean] :typed_keys flag to prefix aggregation names by their respective types in the response @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body From, size, query, sort and search_after

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-query-api-key.html

# File lib/elasticsearch/api/actions/security/query_api_keys.rb, line 35
def query_api_keys(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.query_api_keys' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = '_security/_query/api_key'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
query_role(arguments = {}) click to toggle source

Retrieves information for Roles using a subset of query DSL

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body From, size, query, sort and search_after

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-query-role.html

# File lib/elasticsearch/api/actions/security/query_role.rb, line 32
def query_role(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.query_role' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = '_security/_query/role'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
query_user(arguments = {}) click to toggle source

Retrieves information for Users using a subset of query DSL

@option arguments [Boolean] :with_profile_uid flag to retrieve profile uid (if exists) associated with the user @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body From, size, query, sort and search_after

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-query-user.html

# File lib/elasticsearch/api/actions/security/query_user.rb, line 33
def query_user(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.query_user' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = '_security/_query/user'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_authenticate(arguments = {}) click to toggle source

Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The SAML response to authenticate (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-authenticate.html

# File lib/elasticsearch/api/actions/security/saml_authenticate.rb, line 32
def saml_authenticate(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_authenticate' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/saml/authenticate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_complete_logout(arguments = {}) click to toggle source

Verifies the logout response sent from the SAML IdP

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The logout response to verify (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-complete-logout.html

# File lib/elasticsearch/api/actions/security/saml_complete_logout.rb, line 32
def saml_complete_logout(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_complete_logout' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/saml/complete_logout'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_invalidate(arguments = {}) click to toggle source

Consumes a SAML LogoutRequest

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The LogoutRequest message (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-invalidate.html

# File lib/elasticsearch/api/actions/security/saml_invalidate.rb, line 32
def saml_invalidate(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_invalidate' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/saml/invalidate'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_logout(arguments = {}) click to toggle source

Invalidates an access token and a refresh token that were generated via the SAML Authenticate API

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The tokens to invalidate (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-logout.html

# File lib/elasticsearch/api/actions/security/saml_logout.rb, line 32
def saml_logout(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_logout' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/saml/logout'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_prepare_authentication(arguments = {}) click to toggle source

Creates a SAML authentication request

@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The realm for which to create the authentication request, identified by either its name or the ACS URL (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-prepare-authentication.html

# File lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb, line 32
def saml_prepare_authentication(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_prepare_authentication' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_security/saml/prepare'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
saml_service_provider_metadata(arguments = {}) click to toggle source

Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider

@option arguments [String] :realm_name The name of the SAML realm to get the metadata for @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-saml-sp-metadata.html

# File lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb, line 32
def saml_service_provider_metadata(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.saml_service_provider_metadata' }

  defined_params = [:realm_name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'realm_name' missing" unless arguments[:realm_name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _realm_name = arguments.delete(:realm_name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_security/saml/metadata/#{Utils.__listify(_realm_name)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
suggest_user_profiles(arguments = {}) click to toggle source

Get suggestions for user profiles that match specified search criteria.

@option arguments [List] :data A comma-separated list of keys for which the corresponding application data are retrieved. @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The suggestion definition for user profiles

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-suggest-user-profile.html

# File lib/elasticsearch/api/actions/security/suggest_user_profiles.rb, line 33
def suggest_user_profiles(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.suggest_user_profiles' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = '_security/profile/_suggest'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_api_key(arguments = {}) click to toggle source

Updates attributes of an existing API key.

@option arguments [String] :id The ID of the API key to update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The API key request to update attributes of an API key.

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-update-api-key.html

# File lib/elasticsearch/api/actions/security/update_api_key.rb, line 33
def update_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.update_api_key' }

  defined_params = [:id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/api_key/#{Utils.__listify(_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_cross_cluster_api_key(arguments = {}) click to toggle source

Updates attributes of an existing cross-cluster API key.

@option arguments [String] :id The ID of the cross-cluster API key to update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The request to update attributes of a cross-cluster API key. (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-update-cross-cluster-api-key.html

# File lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb, line 33
def update_cross_cluster_api_key(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.update_cross_cluster_api_key' }

  defined_params = [:id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _id = arguments.delete(:id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/cross_cluster/api_key/#{Utils.__listify(_id)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_settings(arguments = {}) click to toggle source

Update settings for the security system index

@option arguments [Time] :master_timeout Timeout for connection to master @option arguments [Time] :timeout Timeout for acknowledgements from all nodes @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body An object with the new settings for each index, if any (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-update-settings.html

# File lib/elasticsearch/api/actions/security/update_settings.rb, line 34
def update_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.update_settings' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_PUT
  path   = '_security/settings'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_user_profile_data(arguments = {}) click to toggle source

Update application specific data for the user profile of the given unique ID.

@option arguments [String] :uid An unique identifier of the user profile @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term @option arguments [String] :refresh If ‘true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The application data to update (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-update-user-profile-data.html

# File lib/elasticsearch/api/actions/security/update_user_profile_data.rb, line 36
def update_user_profile_data(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'security.update_user_profile_data' }

  defined_params = [:uid].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _uid = arguments.delete(:uid)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_security/profile/#{Utils.__listify(_uid)}/_data"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end