# SPDX-License-Identifier: Apache-2.0## The OpenSearch Contributors require contributions made to# this file be licensed under the Apache-2.0 license or a# compatible open source license.## Modifications Copyright OpenSearch Contributors. See# GitHub history for details.# ------------------------------------------------------------------------------------------# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST## To contribute, kindly make modifications in the opensearch-py client generator# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md# and https://github.com/opensearch-project/opensearch-api-specification for details.# -----------------------------------------------------------------------------------------+fromtypingimportAnyfrom.utilsimportSKIP_IN_PATH,NamespacedClient,_make_path,query_params
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_account_details(self,params:Any=None,headers:Any=None,)->Any:""" Returns account details for the current user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/account",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defchange_password(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Changes the password for the current user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PUT","/_plugins/_security/api/account",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_action_group(self,action_group:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves one action group. :arg action_group: The name of the action group to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifaction_groupinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'action_group'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","actiongroups",action_group),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_action_groups(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves all action groups. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/actiongroups",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_action_group(self,action_group:Any,params:Any=None,headers:Any=None,)->Any:""" Delete a specified action group. :arg action_group: The name of the action group to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifaction_groupinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'action_group'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","actiongroups",action_group),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_action_group(self,action_group:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified action group. :arg action_group: The name of the action group to create or replace. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(action_group,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","actiongroups",action_group),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_action_group(self,action_group:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates individual attributes of an action group. :arg action_group: The name of the action group to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(action_group,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","actiongroups",action_group),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_action_groups(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates, updates, or deletes multiple action groups in a single call. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/actiongroups",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_user(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieve one internal user. :arg username: The name of the user to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","internalusers",username),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_users(self,params:Any=None,headers:Any=None,)->Any:""" Retrieve all internal users. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/internalusers",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_user(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Delete the specified user. :arg username: The name of the user to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","internalusers",username),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_user(self,username:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified user. :arg username: The name of the user to be created. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(username,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","internalusers",username),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_user(self,username:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates individual attributes of an internal user. :arg username: The name of the user to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(username,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","internalusers",username),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_users(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates, updates, or deletes multiple internal users in a single call. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/internalusers",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_role(self,role:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves one role. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifroleinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'role'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","roles",role),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_roles(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves all roles. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/roles",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_role(self,role:Any,params:Any=None,headers:Any=None,)->Any:""" Delete the specified role. :arg role: The name of the role to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifroleinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'role'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","roles",role),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_role(self,role:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified role. :arg role: The name of the role to be created. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(role,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","roles",role),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_role(self,role:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates individual attributes of a role. :arg role: The name of the role to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(role,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","roles",role),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_roles(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates, updates, or deletes multiple roles in a single call. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/roles",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_role_mapping(self,role:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves one role mapping. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifroleinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'role'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","rolesmapping",role),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_role_mappings(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves all role mappings. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/rolesmapping",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_role_mapping(self,role:Any,params:Any=None,headers:Any=None,)->Any:""" Deletes the specified role mapping. :arg role: The name of the role whose mapping needs to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifroleinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'role'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","rolesmapping",role),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_role_mapping(self,role:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified role mapping. :arg role: The name of the role to create a role mapping for. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(role,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","rolesmapping",role),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_role_mapping(self,role:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates individual attributes of a role mapping. :arg role: The name of the role to update role-mapping for. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(role,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","rolesmapping",role),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_role_mappings(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or updates multiple role mappings in a single call. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/rolesmapping",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_tenant(self,tenant:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves one tenant. :arg tenant: The name of the tenant to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """iftenantinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'tenant'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","tenants",tenant),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_tenants(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves all tenants. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/tenants",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_tenant(self,tenant:Any,params:Any=None,headers:Any=None,)->Any:""" Delete the specified tenant. :arg tenant: The name of the tenant to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """iftenantinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'tenant'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","tenants",tenant),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_tenant(self,tenant:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified tenant. :arg tenant: The name of the tenant to be created. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(tenant,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","tenants",tenant),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_tenant(self,tenant:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Add, delete, or modify a single tenant. :arg tenant: The name of the tenant to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(tenant,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","tenants",tenant),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_tenants(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Add, delete, or modify multiple tenants in a single call. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/tenants",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_configuration(self,params:Any=None,headers:Any=None,)->Any:""" Returns the current Security plugin configuration in JSON format. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/securityconfig",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defupdate_configuration(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Adds or updates the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PUT","/_plugins/_security/api/securityconfig/config",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_configuration(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" A `PATCH` call is used to update the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/securityconfig",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","show_all","source")defget_distinguished_names(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves distinguished names. Only accessible to super-admins and with rest- api permissions when enabled. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg show_all: A Boolean flag to include/exclude static nodes DN from final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/nodesdn",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_certificates(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the cluster security certificates. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/ssl/certs",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defreload_transport_certificates(self,params:Any=None,headers:Any=None,)->Any:""" Reload Transport layer communication certificates. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("PUT","/_plugins/_security/api/ssl/transport/reloadcerts",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defreload_http_certificates(self,params:Any=None,headers:Any=None,)->Any:""" Reload HTTP layer communication certificates. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("PUT","/_plugins/_security/api/ssl/http/reloadcerts",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defflush_cache(self,params:Any=None,headers:Any=None,)->Any:""" Flushes the Security plugin user, authentication, and authorization cache. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("DELETE","/_plugins/_security/api/cache",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","mode","pretty","source")defhealth(self,params:Any=None,headers:Any=None,)->Any:""" Checks to see if the Security plugin is up and running. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg mode: A flag to indicate whether service should consider security-plugin's status before returning health response. `strict` mode indicates service should check Security plugin status. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/health",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_audit_configuration(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the audit configuration. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/audit",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defupdate_audit_configuration(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates the audit configuration. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PUT","/_plugins/_security/api/audit/config",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_audit_configuration(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" A PATCH call is used to update specified fields in the audit configuration. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/audit",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_distinguished_names(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Bulk update of distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/nodesdn",params=params,headers=headers,body=body,)
[docs]@query_params("auth_type","error_trace","filter_path","human","pretty","source","verbose",)defauthinfo(self,params:Any=None,headers:Any=None,)->Any:""" Returns the authentication information. :arg auth_type: The type of current authentication request. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. :arg verbose: Indicates whether a verbose response should be returned. """returnself.transport.perform_request("GET","/_plugins/_security/authinfo",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defauthtoken(self,params:Any=None,headers:Any=None,)->Any:""" Returns the authorization token. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("POST","/_plugins/_security/api/authtoken",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcache(self,params:Any=None,headers:Any=None,)->Any:""" Not supported for cache API. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("PUT","/_plugins/_security/api/cache",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defconfig_upgrade_check(self,params:Any=None,headers:Any=None,)->Any:""" Check whether or not an upgrade can be performed and what resources can be updated. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/_upgrade_check",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defconfig_upgrade_perform(self,body:Any=None,params:Any=None,headers:Any=None,)->Any:""" Helps cluster operator upgrade missing defaults and stale default definitions. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("POST","/_plugins/_security/api/_upgrade_perform",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_allowlist(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the permitted APIs. Accessible using Super Admin certificate or REST API permission. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PUT","/_plugins/_security/api/allowlist",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_update_tenancy_config(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the multi-tenancy configuration. Only accessible to admins and users with REST API permissions. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PUT","/_plugins/_security/api/tenancy/config",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defcreate_user_legacy(self,username:Any,body:Any,params:Any=None,headers:Any=None,)->Any:""" Creates or replaces the specified user. Legacy API. :arg username: The name of the user to be created. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """forparamin(username,body):ifparaminSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","user",username),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_distinguished_name(self,cluster_name:Any,params:Any=None,headers:Any=None,)->Any:""" Deletes all distinguished names in the specified cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. :arg cluster_name: The cluster-name to delete from list of distinguished names. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifcluster_nameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'cluster_name'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","nodesdn",cluster_name),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defdelete_user_legacy(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Delete the specified user. Legacy API. :arg username: The name of the user to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("DELETE",_make_path("_plugins","_security","api","user",username),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defgenerate_obo_token(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Generates On-Behalf-Of token for the current user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("POST","/_plugins/_security/api/generateonbehalfoftoken",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defgenerate_user_token(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Generates authorization token for the given user. :arg username: The name of the user for whom an auth token is to be vended. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("POST",_make_path("_plugins","_security","api","internalusers",username,"authtoken"),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defgenerate_user_token_legacy(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Generates authorization token for the given user. Legacy API. Not Implemented. :arg username: The name of the user for whom an auth token is to be vended. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("POST",_make_path("_plugins","_security","api","user",username,"authtoken"),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_allowlist(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the current list of allowed API accessible to normal user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/allowlist",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_dashboards_info(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the current security-dashboards plugin configuration. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/dashboardsinfo",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","show_all","source")defget_distinguished_name(self,cluster_name:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves distinguished names. Only accessible to super-admins and with rest- api permissions when enabled. :arg cluster_name: The cluster-name to retrieve nodes DN setting for. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg show_all: A Boolean flag to include/exclude static nodes DN from final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifcluster_nameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'cluster_name'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","nodesdn",cluster_name),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_permissions_info(self,params:Any=None,headers:Any=None,)->Any:""" Gets the evaluated REST API permissions for the currently logged in user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/permissionsinfo",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","show_dn","source")defget_sslinfo(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the SSL configuration information. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg show_dn: A Boolean flag to indicate whether all domain names should be returned. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_opendistro/_security/sslinfo",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_tenancy_config(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves multi-tenancy configuration. Only accessible to admins and users with REST API permissions. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/tenancy/config",params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_user_legacy(self,username:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieve one user. Legacy API. :arg username: The name of the user to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifusernameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'username'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","user",username),params=params,headers=headers,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defget_users_legacy(self,params:Any=None,headers:Any=None,)->Any:""" Retrieve all internal users. Legacy API. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/user",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defmigrate(self,params:Any=None,headers:Any=None,)->Any:""" Migrates security configuration from v6 to v7. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("POST","/_plugins/_security/api/migrate",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_allowlist(self,body:Any,params:Any=None,headers:Any=None,)->Any:""" Updates the current list of allowed API accessible to normal user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifbodyinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'body'.")returnself.transport.perform_request("PATCH","/_plugins/_security/api/allowlist",params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpatch_distinguished_name(self,cluster_name:Any,body:Any=None,params:Any=None,headers:Any=None,)->Any:""" Updates a distinguished cluster name for a specific cluster. Only accessible to super-admins and with rest-api permissions when enabled. :arg cluster_name: The cluster name to update `nodesDn` value. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifcluster_nameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'cluster_name'.")returnself.transport.perform_request("PATCH",_make_path("_plugins","_security","api","nodesdn",cluster_name),params=params,headers=headers,body=body,)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defpost_dashboards_info(self,params:Any=None,headers:Any=None,)->Any:""" Updates the current security-dashboards plugin configuration. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("POST","/_plugins/_security/dashboardsinfo",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")deftenant_info(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the tenant names if any exist. Only accessible to super admins or kibanaserver user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/tenantinfo",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defupdate_distinguished_name(self,cluster_name:Any,body:Any=None,params:Any=None,headers:Any=None,)->Any:""" Adds or updates the specified distinguished names in the cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. :arg cluster_name: The cluster-name to create/update `nodesDn` value for. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ifcluster_nameinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'cluster_name'.")returnself.transport.perform_request("PUT",_make_path("_plugins","_security","api","nodesdn",cluster_name),params=params,headers=headers,body=body,)
[docs]@query_params("accept_invalid","error_trace","filter_path","human","pretty","source")defvalidate(self,params:Any=None,headers:Any=None,)->Any:""" Checks whether the v6 security configuration is valid and ready to be migrated to v7. :arg accept_invalid: A Boolean flag to indicate whether invalid v6 configuration should be allowed. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/api/validate",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defwho_am_i(self,params:Any=None,headers:Any=None,)->Any:""" Gets the user identity related information for currently logged in user. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/whoami",params=params,headers=headers)
[docs]@query_params("error_trace","filter_path","human","pretty","source")defwho_am_i_protected(self,params:Any=None,headers:Any=None,)->Any:""" Gets the user identity related information for currently logged in user. User needs to have access to this endpoint when authorization at REST layer is enabled. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """returnself.transport.perform_request("GET","/_plugins/_security/whoamiprotected",params=params,headers=headers)
[docs]@query_params("cert_type","error_trace","filter_path","human","pretty","source","timeout",)defget_all_certificates(self,params:Any=None,headers:Any=None,)->Any:""" Retrieves the cluster security certificates. :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) to retrieve from all nodes. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. :arg timeout: The maximum duration, in seconds, to be spent to retrieve certificates from all nodes. """returnself.transport.perform_request("GET","/_plugins/_security/api/certificates",params=params,headers=headers,)
[docs]@query_params("cert_type","error_trace","filter_path","human","pretty","source","timeout",)defget_node_certificates(self,node_id:Any,params:Any=None,headers:Any=None,)->Any:""" Retrieves the given node's security certificates. :arg node_id: The full-id of the node to retrieve certificates. :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) to retrieve for a node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. :arg timeout: The maximum duration, in seconds, to be spent to retrieve a node's certificates. """ifnode_idinSKIP_IN_PATH:raiseValueError("Empty value passed for a required argument 'node_id'.")returnself.transport.perform_request("GET",_make_path("_plugins","_security","api","certificates",node_id),params=params,headers=headers,)