Get service account credentials
- GET /_security/service/{namespace}/{service}/credential
To use this API, you must have at least the read_security cluster privilege (or a greater privilege such as manage_service_account or manage_security).
The response includes service account tokens that were created with the create service account tokens API as well as file-backed tokens from all nodes of the cluster.
NOTE: For tokens backed by the service_tokens file, the API collects them from all nodes of the cluster.
Tokens with the same name from different nodes are assumed to be the same token and are only counted once towards the total number of service tokens.
- Cluster privileges:
read_security
Response
-
service_accountstringrequired -
countnumberrequired -
tokensmap string to Metadatarequired -
nodes_credentialsNodesCredentialsrequired -
Service account credentials collected from all nodes of the cluster.
-
_nodesNodeStatisticsrequired -
General status showing how nodes respond to the above collection request
-
failuresErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
totalnumberrequired -
Total number of nodes selected by the request.
-
successfulnumberrequired -
Number of nodes that responded successfully to the request.
-
failednumberrequired -
Number of nodes that rejected the request or failed to respond. If this value is not 0, a reason for the rejection or failure is included in the response.
-
file_tokensmap string to NodesCredentialsFileTokenrequired -
File-backed tokens collected from all nodes
-
<string>NodesCredentialsFileToken -
nodesstringrequired