get-users.asciidoc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --
  2. :api: get-users
  3. :request: GetUsersRequest
  4. :response: GetUsersResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Get Users API
  9. [id="{upid}-{api}-request"]
  10. ==== Get Users Request
  11. Retrieving a user can be performed using the `security().getUsers()`
  12. method and by setting the username on +{request}+:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests-file}[{api}-request]
  16. --------------------------------------------------
  17. Retrieving multiple users can be performed using the `security().getUsers()`
  18. method and by setting multiple usernames on +{request}+:
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests-file}[{api}-list-request]
  22. --------------------------------------------------
  23. Retrieving all users can be performed using the `security().getUsers()`
  24. method without specifying any usernames on +{request}+:
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests-file}[{api}-all-request]
  28. --------------------------------------------------
  29. include::../execution.asciidoc[]
  30. [id="{upid}-{api}-response"]
  31. ==== Get Users Response
  32. The returned +{response}+ allows getting information about the retrieved users as follows.
  33. ["source","java",subs="attributes,callouts,macros"]
  34. --------------------------------------------------
  35. include-tagged::{doc-tests-file}[{api}-response]
  36. --------------------------------------------------