create-api-key.asciidoc 1.1 KB

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