create-api-key.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --
  2. :api: create-api-key
  3. :request: CreateApiKeyRequest
  4. :response: CreateApiKeyResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Create API Key API
  9. API Key can be created using this API.
  10. [id="{upid}-{api}-request"]
  11. ==== Create API Key Request
  12. A +{request}+ contains an optional name for the API key,
  13. an optional list of role descriptors to define permissions and
  14. optional expiration for the generated API key.
  15. If expiration is not provided then by default the API
  16. keys do not expire.
  17. ["source","java",subs="attributes,callouts,macros"]
  18. --------------------------------------------------
  19. include-tagged::{doc-tests-file}[{api}-request]
  20. --------------------------------------------------
  21. include::../execution.asciidoc[]
  22. [id="{upid}-{api}-response"]
  23. ==== Create API Key Response
  24. The returned +{response}+ contains an id,
  25. API key, name for the API key and optional
  26. expiration.
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests-file}[{api}-response]
  30. --------------------------------------------------
  31. <1> the API key that can be used to authenticate to Elasticsearch.
  32. <2> expiration if the API keys expire