-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
532 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
layout: "docs" | ||
page_title: "Commands: Namespace" | ||
sidebar_current: "docs-commands-namespace" | ||
description: > | ||
The namespace command provides management of Consul Enterprise namespaces. | ||
--- | ||
|
||
<%= enterprise_alert :consul %> | ||
|
||
# Consul Namespace | ||
|
||
Command: `consul namespace` | ||
|
||
|
||
The `namespace` command provides management of Consul Enterprise namespaces. This was added in Consul Enterprise 1.7.0. | ||
|
||
If ACLs are enabled then a token with operator privileges may be required in order to use this command. Write | ||
requests are forwarded to the leader in the primary datacenter. Therefore these commands can be run against | ||
any agent in any datacenter. | ||
|
||
## Usage | ||
|
||
Usage: `consul namespace <subcommand>` | ||
|
||
For the exact documentation for your Consul version, run `consul namespace -h` to view the complete list of subcommands. | ||
|
||
```text | ||
Usage: consul namespace <subcommand> [options] [args] | ||
|
||
This command has subcommands for interacting with Consul Enterprise | ||
Namespaces. Here are some simple examples. More detailed | ||
examples are available in the subcommands or the documentation. | ||
|
||
... | ||
|
||
Subcommands: | ||
delete Delete a Namespace | ||
list List all Namespaces | ||
read Read a Namespace | ||
write Create or update a Namespace | ||
``` | ||
|
||
For more information, examples, and usage about a subcommand, click on the name | ||
of the subcommand in the sidebar. | ||
|
||
## Namespace Definition | ||
|
||
## Basic Examples | ||
|
||
Create or update a Namespace: | ||
|
||
```sh | ||
$ consul namespace write ns1.hcl | ||
``` | ||
|
||
Read a Namespace: | ||
|
||
```sh | ||
$ consul namespace read ns1 | ||
``` | ||
|
||
List all Namespaces: | ||
|
||
```sh | ||
$ consul namespace list | ||
``` | ||
|
||
Delete a Namespace: | ||
|
||
```sh | ||
$ consul namespace delete ns1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
layout: "docs" | ||
page_title: "Commands: Namespace Delete" | ||
sidebar_current: "docs-commands-namespace-delete" | ||
--- | ||
|
||
<%= enterprise_alert :consul %> | ||
|
||
# Consul Namespace Delete | ||
|
||
Command: `consul namespace delete` | ||
|
||
This `namespace delete` command deletes a namespace. This was added in Consul Enterprise 1.7.0. If | ||
ACLs are enabled then this command will require a token with `operator:write` privileges. | ||
|
||
## Usage | ||
|
||
Usage: `consul namespace delete <name>` | ||
|
||
#### API Options | ||
|
||
<%= partial "docs/commands/http_api_options_client" %> | ||
<%= partial "docs/commands/http_api_options_server" %> | ||
|
||
## Examples | ||
|
||
Delete a Namespace: | ||
|
||
```sh | ||
$ consul namespace delete "team-1" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
layout: "docs" | ||
page_title: "Commands: Namespace List" | ||
sidebar_current: "docs-commands-namespace-list" | ||
--- | ||
|
||
<%= enterprise_alert :consul %> | ||
|
||
# Consul Namespace List | ||
|
||
Command: `consul namespace list` | ||
|
||
This `namespace list` command lists all namespace configurations. 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 namespaces. The results will be filtered based on the ACL token and therefore it is possible to | ||
see a partial list. | ||
|
||
## Usage | ||
|
||
Usage: `consul namespace list` | ||
|
||
#### 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 | ||
|
||
List Namespaces: | ||
|
||
```sh | ||
$ consul namespace list | ||
default: | ||
Description: | ||
Builtin Default Namespace | ||
foo: | ||
Description: | ||
Example Namespace | ||
team-1: | ||
Description: | ||
|
||
``` | ||
|
||
Showing Raft Metadata: | ||
|
||
```sh | ||
$ consul namespace list -meta | ||
default: | ||
Description: | ||
Builtin Default Namespace | ||
Create Index: 4 | ||
Modify Index: 4 | ||
foo: | ||
Description: | ||
Example Namespace | ||
Create Index: 352 | ||
Modify Index: 352 | ||
team-1: | ||
Description: | ||
Create Index: 339 | ||
Modify Index: 344 | ||
|
||
``` | ||
|
||
JSON Format: | ||
|
||
```sh | ||
$ consul namespace list -format=json | ||
[ | ||
{ | ||
"Name": "default", | ||
"Description": "Builtin Default Namespace", | ||
"CreateIndex": 4, | ||
"ModifyIndex": 4 | ||
}, | ||
{ | ||
"Name": "foo", | ||
"Description": "Example Namespace", | ||
"Meta": { | ||
"team-id": "574407f3-8b26-4c84-8e51-028bb8cbdd37" | ||
}, | ||
"CreateIndex": 352, | ||
"ModifyIndex": 352 | ||
}, | ||
{ | ||
"Name": "team-1", | ||
"CreateIndex": 339, | ||
"ModifyIndex": 344 | ||
} | ||
] | ||
``` |
Oops, something went wrong.