get-api-key.asciidoc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. . All API keys if the user is authorized to do so
  19. ===== Retrieve a specific API key by its id
  20. ["source","java",subs="attributes,callouts,macros"]
  21. --------------------------------------------------
  22. include-tagged::{doc-tests-file}[get-api-key-id-request]
  23. --------------------------------------------------
  24. ===== Retrieve a specific API key by its name
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests-file}[get-api-key-name-request]
  28. --------------------------------------------------
  29. ===== Retrieve all API keys for given realm
  30. ["source","java",subs="attributes,callouts,macros"]
  31. --------------------------------------------------
  32. include-tagged::{doc-tests-file}[get-realm-api-keys-request]
  33. --------------------------------------------------
  34. ===== Retrieve all API keys for a given user
  35. ["source","java",subs="attributes,callouts,macros"]
  36. --------------------------------------------------
  37. include-tagged::{doc-tests-file}[get-user-api-keys-request]
  38. --------------------------------------------------
  39. ===== Retrieve all API keys for given user in a realm
  40. ["source","java",subs="attributes,callouts,macros"]
  41. --------------------------------------------------
  42. include-tagged::{doc-tests-file}[get-user-realm-api-keys-request]
  43. --------------------------------------------------
  44. ===== Retrieve all API keys for the current authenticated user
  45. ["source","java",subs="attributes,callouts,macros"]
  46. --------------------------------------------------
  47. include-tagged::{doc-tests-file}[get-api-keys-owned-by-authenticated-user-request]
  48. --------------------------------------------------
  49. ===== Retrieve all API keys if the user is authorized to do so
  50. ["source","java",subs="attributes,callouts,macros"]
  51. --------------------------------------------------
  52. include-tagged::{doc-tests-file}[get-all-api-keys-request]
  53. --------------------------------------------------
  54. include::../execution.asciidoc[]
  55. [id="{upid}-{api}-response"]
  56. ==== Get API Key information API Response
  57. The returned +{response}+ contains the information regarding the API keys that were
  58. requested.
  59. `api_keys`:: Available using `getApiKeyInfos`, contains list of API keys that were retrieved for this request.
  60. ["source","java",subs="attributes,callouts,macros"]
  61. --------------------------------------------------
  62. include-tagged::{doc-tests-file}[{api}-response]
  63. --------------------------------------------------