mirror of
https://github.com/status-im/consul.git
synced 2025-01-16 08:45:37 +00:00
a704ebe639
Also update the Docs and fixup the HTTP API to return proper errors when someone attempts to use Namespaces with an OSS agent. Add Namespace HTTP API docs Make all API endpoints disallow unknown fields
67 lines
1.3 KiB
Plaintext
67 lines
1.3 KiB
Plaintext
---
|
|
layout: "docs"
|
|
page_title: "Commands: Namespace Read"
|
|
sidebar_current: "docs-commands-namespace-read"
|
|
---
|
|
|
|
<%= enterprise_alert :consul %>
|
|
|
|
# Consul Namespace Read
|
|
|
|
Command: `consul namespace read`
|
|
|
|
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.
|
|
|
|
## Usage
|
|
|
|
Usage: `consul namespace read <name>`
|
|
|
|
#### API Options
|
|
|
|
<%= partial "docs/commands/http_api_options_client" %>
|
|
<%= partial "docs/commands/http_api_options_server" %>
|
|
|
|
#### Command Options
|
|
|
|
* `-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
|
|
|
|
## Examples
|
|
|
|
Read a Namespace:
|
|
|
|
```sh
|
|
$ consul namespace read "team-1"
|
|
Name: team-1
|
|
Description:
|
|
```
|
|
|
|
Showing Raft Metadata:
|
|
|
|
```sh
|
|
$ consul namespace read -meta "team-1"
|
|
Name: team-1
|
|
Description:
|
|
Create Index: 339
|
|
Modify Index: 344
|
|
```
|
|
|
|
JSON Format:
|
|
|
|
```sh
|
|
$ consul namespace read -format=json foo
|
|
{
|
|
"Name": "foo",
|
|
"Description": "Example Namespace",
|
|
"Meta": {
|
|
"team-id": "574407f3-8b26-4c84-8e51-028bb8cbdd37"
|
|
},
|
|
"CreateIndex": 352,
|
|
"ModifyIndex": 352
|
|
}
|
|
```
|