mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
[HLRC] Add support for get roles API (#35787)
This commits adds support for the Get Roles API to the HLRC Relates: #29827
This commit is contained in:
parent
dfd93deabe
commit
8daa854f90
12 changed files with 676 additions and 53 deletions
48
docs/java-rest/high-level/security/get-roles.asciidoc
Normal file
48
docs/java-rest/high-level/security/get-roles.asciidoc
Normal file
|
@ -0,0 +1,48 @@
|
|||
|
||||
--
|
||||
:api: get-roles
|
||||
:request: GetRolesRequest
|
||||
:respnse: GetRolesResponse
|
||||
--
|
||||
|
||||
[id="{upid}-{api}"]
|
||||
=== Get Roles API
|
||||
|
||||
[id="{upid}-{api}-request"]
|
||||
==== Get Roles Request
|
||||
|
||||
Retrieving a role can be performed using the `security().getRoles()`
|
||||
method and by setting the role name on +{request}+:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-request]
|
||||
--------------------------------------------------
|
||||
|
||||
Retrieving multiple roles can be performed using the `security().getRoles()`
|
||||
method and by setting multiple role names on +{request}+:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-list-request]
|
||||
--------------------------------------------------
|
||||
|
||||
Retrieving all roles can be performed using the `security().getRoles()`
|
||||
method without specifying any role names on +{request}+:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-all-request]
|
||||
--------------------------------------------------
|
||||
|
||||
include::../execution.asciidoc[]
|
||||
|
||||
[id="{upid}-{api}-response"]
|
||||
==== Get Roles Response
|
||||
|
||||
The returned +{response}+ allows getting information about the retrieved roles as follows.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-response]
|
||||
--------------------------------------------------
|
|
@ -366,6 +366,7 @@ The Java High Level REST Client supports the following Security APIs:
|
|||
* <<java-rest-high-security-enable-user>>
|
||||
* <<java-rest-high-security-disable-user>>
|
||||
* <<java-rest-high-security-change-password>>
|
||||
* <<{upid}-get-roles>>
|
||||
* <<java-rest-high-security-delete-role>>
|
||||
* <<{upid}-clear-roles-cache>>
|
||||
* <<{upid}-clear-realm-cache>>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue