create-service-account-token.asciidoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --
  2. :api: create-service-account-token
  3. :request: CreateServiceAccountTokenRequest
  4. :response: CreateServiceAccountTokenResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Create Service Account Token API
  9. Index-based service account token can be created using this API.
  10. [id="{upid}-{api}-request"]
  11. ==== Create Service Account Token Request
  12. A +{request}+ contains the namespace and service-name of a
  13. service account and an optional name for the service account token.
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests-file}[{api}-request]
  17. --------------------------------------------------
  18. A token name will be auto generated if the +{request}+ does not specify it:
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests-file}[{api}-request-auto-name]
  22. --------------------------------------------------
  23. include::../execution.asciidoc[]
  24. [id="{upid}-{api}-response"]
  25. ==== Create Service Account Token Response
  26. The returned +{response}+ contains the name and value of the service account token.
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests-file}[{api}-response]
  30. --------------------------------------------------
  31. <1> Name of the service account token
  32. <2> Value of the service account token to be used as the bearer authentication header