Delete roles API
Delete roles API
New API reference
For the most up-to-date API details, refer to Security APIs.
Removes roles in the native realm.
Request
DELETE /_security/role/<name>
Prerequisites
- To use this API, you must have at least the
manage_security
cluster privilege.
Description
The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The delete roles API cannot remove roles that are defined in roles files.
Path parameters
name
(string) The name of the role.
Examples
The following example deletes a my_admin_role
role:
resp = client.security.delete_role(
name="my_admin_role",
)
print(resp)
const response = await client.security.deleteRole({
name: "my_admin_role",
});
console.log(response);
DELETE /_security/role/my_admin_role
If the role is successfully deleted, the request returns {"found": true}
. Otherwise, found
is set to false.
{
"found" : true
}
当前内容版权归 elasticsearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 elasticsearch .