2019-05-01 21:11:23 +00:00
|
|
|
---
|
2020-04-07 18:55:19 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: ACL Token Read'
|
2020-04-13 18:40:26 +00:00
|
|
|
sidebar_title: read
|
2019-05-01 21:11:23 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul ACL Token Read
|
|
|
|
|
|
|
|
Command: `consul acl token read`
|
|
|
|
|
|
|
|
The `acl token read` command reads and displays a token details.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul acl token read [options] [args]`
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2020-04-07 23:56:08 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_server.mdx'
|
2019-05-01 21:11:23 +00:00
|
|
|
|
|
|
|
#### Command Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-id=<string>` - The ID of the policy to read. It may be specified as a unique ID
|
|
|
|
prefix but will error if the prefix matches multiple policy IDs.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-meta` - Indicates that policy metadata such as the content hash and raft
|
2019-05-01 21:11:23 +00:00
|
|
|
indices should be shown for each entry.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-self` - Indicates that the current HTTP token should be read by secret ID
|
|
|
|
instead of expecting a -id option.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-format={pretty|json}` - Command output format. The default value is `pretty`.
|
2020-03-26 16:03:22 +00:00
|
|
|
|
2019-12-06 16:14:56 +00:00
|
|
|
#### Enterprise Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_namespace_options.mdx'
|
2019-12-06 16:14:56 +00:00
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Get token details:
|
|
|
|
|
2020-04-07 23:56:08 +00:00
|
|
|
```shell
|
2019-05-01 21:11:23 +00:00
|
|
|
$ consul acl token read -id 986
|
|
|
|
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
|
|
|
|
SecretID: ec15675e-2999-d789-832e-8c4794daa8d7
|
|
|
|
Description: Read Nodes and Services
|
|
|
|
Local: false
|
|
|
|
Create Time: 2018-10-22 15:33:39.01789 -0400 EDT
|
|
|
|
Policies:
|
|
|
|
06acc965-df4b-5a99-58cb-3250930c6324 - node-services-read
|
|
|
|
```
|
|
|
|
|
|
|
|
Get token details using the token secret ID:
|
|
|
|
|
2020-04-07 23:56:08 +00:00
|
|
|
```shell
|
2019-05-01 21:11:23 +00:00
|
|
|
$consul acl token read -self
|
|
|
|
AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01
|
|
|
|
SecretID: 86cddfb9-2760-d947-358d-a2811156bf31
|
|
|
|
Description: Bootstrap Token (Global Management)
|
|
|
|
Local: false
|
|
|
|
Create Time: 2018-10-22 11:27:04.479026 -0400 EDT
|
|
|
|
Policies:
|
|
|
|
00000000-0000-0000-0000-000000000001 - global-management
|
|
|
|
```
|
|
|
|
|
|
|
|
Get token details (Builtin Tokens)
|
|
|
|
|
2020-04-07 23:56:08 +00:00
|
|
|
```shell
|
2019-05-01 21:11:23 +00:00
|
|
|
$ consul acl token read -id anonymous
|
|
|
|
AccessorID: 00000000-0000-0000-0000-000000000002
|
|
|
|
SecretID: anonymous
|
|
|
|
Description: Anonymous Token
|
|
|
|
Local: false
|
|
|
|
Create Time: 0001-01-01 00:00:00 +0000 UTC
|
|
|
|
Policies:
|
|
|
|
```
|