2023-03-15 16:00:52 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2018-08-10 16:17:17 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ cli.Command = (*NamespaceCommand)(nil)
|
|
|
|
|
|
|
|
type NamespaceCommand struct {
|
|
|
|
*BaseCommand
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *NamespaceCommand) Synopsis() string {
|
|
|
|
return "Interact with namespaces"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *NamespaceCommand) Help() string {
|
|
|
|
helpText := `
|
|
|
|
Usage: vault namespace <subcommand> [options] [args]
|
|
|
|
|
|
|
|
This command groups subcommands for interacting with Vault namespaces.
|
2018-08-22 18:37:40 +00:00
|
|
|
These subcommands operate in the context of the namespace that the
|
|
|
|
currently logged in token belongs to.
|
|
|
|
|
2018-08-10 16:17:17 +00:00
|
|
|
List enabled child namespaces:
|
|
|
|
|
|
|
|
$ vault namespace list
|
|
|
|
|
|
|
|
Look up an existing namespace:
|
|
|
|
|
|
|
|
$ vault namespace lookup
|
|
|
|
|
|
|
|
Create a new namespace:
|
|
|
|
|
|
|
|
$ vault namespace create
|
|
|
|
|
2022-08-09 15:38:03 +00:00
|
|
|
Patch an existing namespace:
|
|
|
|
|
|
|
|
$ vault namespace patch
|
|
|
|
|
2018-08-10 16:17:17 +00:00
|
|
|
Delete an existing namespace:
|
|
|
|
|
|
|
|
$ vault namespace delete
|
|
|
|
|
2021-10-26 16:52:29 +00:00
|
|
|
Lock the API for an existing namespace:
|
|
|
|
|
|
|
|
$ vault namespace lock
|
|
|
|
|
|
|
|
Unlock the API for an existing namespace:
|
|
|
|
|
|
|
|
$ vault namespace unlock
|
|
|
|
|
2018-08-10 16:17:17 +00:00
|
|
|
Please see the individual subcommand help for detailed usage information.
|
|
|
|
`
|
|
|
|
|
|
|
|
return strings.TrimSpace(helpText)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *NamespaceCommand) Run(args []string) int {
|
|
|
|
return cli.RunResultHelp
|
|
|
|
}
|