layout | page_title | description |
---|---|---|
commands |
Commands: Namespace Read |
The `consul namespace read` command outputs information about a single namespace in Consul Enterprise.
|
Command: consul namespace read
Corresponding HTTP API Endpoint: [GET] /v1/namespace/:name
This namespace read
command reads a namespaces configuration. This was added in Consul Enterprise 1.7.0. If
ACLs are enabled then this command will require a token with operator:read
privileges or any read
privileges
within the target namespace.
The table below shows this command's required ACLs. Configuration of blocking queries and agent caching are not supported from commands, but may be from the corresponding HTTP endpoint.
ACL Required |
---|
operator:read or namespace:*:read 1 |
1 Access can be granted to list the Namespace if the token used when making the request has been granted any access in the namespace (read, list or write).
Usage: consul namespace read <name>
-
-format=<string>
- How to output the results. The choices are: pretty or json -
-meta
- Indicates that namespace metadata such as the raft indices should be shown for the namespace
@include 'cli-http-api-partition-options.mdx'
@include 'http_api_options_client.mdx'
@include 'http_api_options_server.mdx'
Read a Namespace:
$ consul namespace read "team-1"
Name: team-1
Description:
Showing Raft Metadata:
$ consul namespace read -meta "team-1"
Name: team-1
Description:
Create Index: 339
Modify Index: 344
JSON Format:
$ consul namespace read -format=json foo
{
"Name": "foo",
"Description": "Example Namespace",
"Meta": {
"team-id": "574407f3-8b26-4c84-8e51-028bb8cbdd37"
},
"CreateIndex": 352,
"ModifyIndex": 352
}