get-api-key.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. --
  2. :api: get-api-key
  3. :request: GetApiKeyRequest
  4. :response: GetApiKeyResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Get API Key information API
  9. API Key(s) information can be retrieved using this API.
  10. [id="{upid}-{api}-request"]
  11. ==== Get API Key Request
  12. The +{request}+ supports retrieving API key information for
  13. . A specific API key
  14. . All API keys for a specific realm
  15. . All API keys for a specific user
  16. . All API keys for a specific user in a specific realm
  17. . A specific key or all API keys owned by the current authenticated user
  18. ===== Retrieve a specific API key by its id
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests-file}[get-api-key-id-request]
  22. --------------------------------------------------
  23. ===== Retrieve a specific API key by its name
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests-file}[get-api-key-name-request]
  27. --------------------------------------------------
  28. ===== Retrieve all API keys for given realm
  29. ["source","java",subs="attributes,callouts,macros"]
  30. --------------------------------------------------
  31. include-tagged::{doc-tests-file}[get-realm-api-keys-request]
  32. --------------------------------------------------
  33. ===== Retrieve all API keys for a given user
  34. ["source","java",subs="attributes,callouts,macros"]
  35. --------------------------------------------------
  36. include-tagged::{doc-tests-file}[get-user-api-keys-request]
  37. --------------------------------------------------
  38. ===== Retrieve all API keys for given user in a realm
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[get-user-realm-api-keys-request]
  42. --------------------------------------------------
  43. ===== Retrieve all API keys for the current authenticated user
  44. ["source","java",subs="attributes,callouts,macros"]
  45. --------------------------------------------------
  46. include-tagged::{doc-tests-file}[get-api-keys-owned-by-authenticated-user-request]
  47. --------------------------------------------------
  48. include::../execution.asciidoc[]
  49. [id="{upid}-{api}-response"]
  50. ==== Get API Key information API Response
  51. The returned +{response}+ contains the information regarding the API keys that were
  52. requested.
  53. `api_keys`:: Available using `getApiKeyInfos`, contains list of API keys that were retrieved for this request.
  54. ["source","java",subs="attributes,callouts,macros"]
  55. --------------------------------------------------
  56. include-tagged::{doc-tests-file}[{api}-response]
  57. --------------------------------------------------