elasticsearch/docs/java-rest/high-level/security/get-service-account-credentials.asciidoc
Yang Wang e4f7132055
Return file-backed service tokens from all nodes (#75200)
The Get service account credentials API now returns file-backed tokens from all
nodes instead of only the local node. For each file-backed service token, we
list names of the nodes where this token is found. The response for node-local
credentials (currently only file-backed tokens) is place inside the
"nodes_credentials.file_tokens" field. There is also a nodes_credentials._nodes
field containing information about the overall request execution (it works the
same way as the _nodes field of Nodes info API, etc.) Detailed response sample
can be found in #74530

This PR also removes the beta label from the API's documentation page.

Resolves: #74530
2021-08-03 13:43:46 +10:00

42 lines
1.6 KiB
Text

--
:api: get-service-account-credentials
:request: GetServiceAccountCredentialsRequest
:response: GetServiceAccountCredentialsResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Get Service Account Credentials API
[id="{upid}-{api}-request"]
==== Get Service Account Credentials Request
Retrieving all credentials for a service account can be performed by setting the namespace
and service-name on +{request}+:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Get Service Account Credentials Response
The returned +{response}+ contains service tokens for the requested service account.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> Principal of the service account
<2> List of index-based service token information
<3> Name of the first service token
<4> Source of the first service token. The value is either `file` or `index`.
<5> For `file` service tokens, names of the nodes where the information is collected.
<6> List of file-based service token information
<7> Response header containing the information about the execution of collecting `file` service tokens.
<8> Number of nodes that successful complete the request of retrieving file-backed service tokens
<9> Number of nodes that fail to complete the request of retrieving file-backed service tokens