elasticsearch/docs/java-rest/high-level/security/create-service-account-token.asciidoc
Yang Wang 2350369782
Service Accounts - HLRC (#72431)
This PR adds corresponding components in High Level Rest Client for the new
APIs related to the service accounts feature.
2021-06-17 21:27:20 +10:00

42 lines
1.4 KiB
Text

--
:api: create-service-account-token
:request: CreateServiceAccountTokenRequest
:response: CreateServiceAccountTokenResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Create Service Account Token API
Index-based service account token can be created using this API.
[id="{upid}-{api}-request"]
==== Create Service Account Token Request
A +{request}+ contains the namespace and service-name of a
service account and an optional name for the service account token.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
A token name will be auto generated if the +{request}+ does not specify it:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request-auto-name]
--------------------------------------------------
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Create Service Account Token Response
The returned +{response}+ contains the name and value of the service account token.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> Name of the service account token
<2> Value of the service account token to be used as the bearer authentication header