2019-02-04 22:21:57 -05:00
|
|
|
--
|
|
|
|
:api: create-api-key
|
|
|
|
:request: CreateApiKeyRequest
|
|
|
|
:response: CreateApiKeyResponse
|
|
|
|
--
|
2019-09-11 16:19:13 -04:00
|
|
|
[role="xpack"]
|
2019-02-04 22:21:57 -05:00
|
|
|
[id="{upid}-{api}"]
|
|
|
|
=== Create API Key API
|
|
|
|
|
|
|
|
API Key can be created using this API.
|
|
|
|
|
|
|
|
[id="{upid}-{api}-request"]
|
|
|
|
==== Create API Key Request
|
|
|
|
|
2019-10-12 07:22:16 -04:00
|
|
|
A +{request}+ contains an optional name for the API key,
|
|
|
|
an optional list of role descriptors to define permissions and
|
2019-02-04 22:21:57 -05:00
|
|
|
optional expiration for the generated API key.
|
|
|
|
If expiration is not provided then by default the API
|
|
|
|
keys do not expire.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
include::../execution.asciidoc[]
|
|
|
|
|
|
|
|
[id="{upid}-{api}-response"]
|
|
|
|
==== Create API Key Response
|
|
|
|
|
|
|
|
The returned +{response}+ contains an id,
|
|
|
|
API key, name for the API key and optional
|
|
|
|
expiration.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> the API key that can be used to authenticate to Elasticsearch.
|
2019-10-12 07:22:16 -04:00
|
|
|
<2> expiration if the API keys expire
|