mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 01:44:36 -04:00
This PR adds corresponding components in High Level Rest Client for the new APIs related to the service accounts feature.
42 lines
1.4 KiB
Text
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
|