Security Client

class opensearchpy.client.security.SecurityClient(client)[source]

Bases: NamespacedClient

Parameters:

client (Any) –

change_password(body, params=None, headers=None)[source]

Changes the password for the current user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_action_group(action_group, body, params=None, headers=None)[source]

Creates or replaces the specified action group.

Parameters:
  • action_group (Any) – The name of the action group to create or replace

  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • action_group

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_role(role, body, params=None, headers=None)[source]

Creates or replaces the specified role.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_role_mapping(role, body, params=None, headers=None)[source]

Creates or replaces the specified role mapping.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_tenant(tenant, body, params=None, headers=None)[source]

Creates or replaces the specified tenant.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • tenant (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_user(username, body, params=None, headers=None)[source]

Creates or replaces the specified user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • username (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_action_group(action_group, params=None, headers=None)[source]

Delete a specified action group.

Parameters:
  • action_group (Any) – Action group to delete.

  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • action_group

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_distinguished_names(cluster_name, params=None, headers=None)[source]

Deletes all distinguished names in the specified cluster’s or node’s allow list.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • cluster_name (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_role(role, params=None, headers=None)[source]

Delete the specified role.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_role_mapping(role, params=None, headers=None)[source]

Deletes the specified role mapping.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_tenant(tenant, params=None, headers=None)[source]

Delete the specified tenant.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • tenant (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_user(username, params=None, headers=None)[source]

Delete the specified user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • username (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

flush_cache(params=None, headers=None)[source]

Flushes the Security plugin user, authentication, and authorization cache.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_account_details(params=None, headers=None)[source]

Returns account details for the current user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_action_group(action_group, params=None, headers=None)[source]

Retrieves one action group.

Parameters:
  • action_group (Any) – Action group to retrieve.

  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • action_group

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_action_groups(params=None, headers=None)[source]

Retrieves all action groups.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_audit_configuration(params=None, headers=None)[source]

Retrieves the audit configuration.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_certificates(params=None, headers=None)[source]

Retrieves the cluster’s security certificates.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_configuration(params=None, headers=None)[source]

Returns the current Security plugin configuration in JSON format.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_distinguished_names(cluster_name=None, params=None, headers=None)[source]

Retrieves distinguished names.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • cluster_name (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_role(role, params=None, headers=None)[source]

Retrieves one role.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_role_mapping(role, params=None, headers=None)[source]

Retrieves one role mapping.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_role_mappings(params=None, headers=None)[source]

Retrieves all role mappings.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_roles(params=None, headers=None)[source]

Retrieves all roles.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_tenant(tenant, params=None, headers=None)[source]

Retrieves one tenant.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • tenant (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_tenants(params=None, headers=None)[source]

Retrieves all tenants.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_user(username, params=None, headers=None)[source]

Retrieve one internal user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • username (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_users(params=None, headers=None)[source]

Retrieve all internal users.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

health(params=None, headers=None)[source]

Checks to see if the Security plugin is up and running.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

health_check(params=None, headers=None)

Checks to see if the Security plugin is up and running.

Warning

This API will be removed in a future version. Use ‘health’ API instead.

Parameters:
  • self (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_action_group(action_group, body, params=None, headers=None)[source]

Updates individual attributes of an action group.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • action_group (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_action_groups(body, params=None, headers=None)[source]

Creates, updates, or deletes multiple action groups in a single call.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_audit_configuration(body, params=None, headers=None)[source]

A PATCH call is used to update specified fields in the audit configuration.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_configuration(body, params=None, headers=None)[source]

A PATCH call is used to update the existing configuration using the REST API.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_distinguished_names(body, params=None, headers=None)[source]

Bulk update of distinguished names.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_role(role, body, params=None, headers=None)[source]

Updates individual attributes of a role.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_role_mapping(role, body, params=None, headers=None)[source]

Updates individual attributes of a role mapping.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • role (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_role_mappings(body, params=None, headers=None)[source]

Creates or updates multiple role mappings in a single call.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_roles(body, params=None, headers=None)[source]

Creates, updates, or deletes multiple roles in a single call.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_tenant(tenant, body, params=None, headers=None)[source]

Add, delete, or modify a single tenant.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • tenant (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_tenants(body, params=None, headers=None)[source]

Add, delete, or modify multiple tenants in a single call.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_user(username, body, params=None, headers=None)[source]

Updates individual attributes of an internal user.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • username (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

patch_users(body, params=None, headers=None)[source]

Creates, updates, or deletes multiple internal users in a single call.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

reload_http_certificates(params=None, headers=None)[source]

Reload HTTP layer communication certificates.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

reload_transport_certificates(params=None, headers=None)[source]

Reload transport layer communication certificates.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • params (Any) –

  • headers (Any) –

Return type:

Any

update_audit_config(body, params=None, headers=None)

A PUT call updates the audit configuration.

Warning

This API will be removed in a future version. Use ‘update_audit_configuration’ API instead.

Parameters:
  • self (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

update_audit_configuration(body, params=None, headers=None)[source]

Updates the audit configuration.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

update_configuration(body, params=None, headers=None)[source]

Adds or updates the existing configuration using the REST API.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any

update_distinguished_names(cluster_name, body=None, params=None, headers=None)[source]

Adds or updates the specified distinguished names in the cluster’s or node’s allow list.

Parameters:
  • error_trace – Whether to include the stack trace of returned errors.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • cluster_name (Any) –

  • body (Any) –

  • params (Any) –

  • headers (Any) –

Return type:

Any