2019-04-15 20:43:19 +00:00
|
|
|
package role
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/command/flags"
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func New() *cmd {
|
|
|
|
return &cmd{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type cmd struct{}
|
|
|
|
|
|
|
|
func (c *cmd) Run(args []string) int {
|
|
|
|
return cli.RunResultHelp
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cmd) Synopsis() string {
|
|
|
|
return synopsis
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cmd) Help() string {
|
|
|
|
return flags.Usage(help, nil)
|
|
|
|
}
|
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
const synopsis = "Manage Consul's ACL roles"
|
2019-04-15 20:43:19 +00:00
|
|
|
const help = `
|
|
|
|
Usage: consul acl role <subcommand> [options] [args]
|
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
This command has subcommands for managing Consul's ACL roles.
|
2019-04-15 20:43:19 +00:00
|
|
|
Here are some simple examples, and more detailed examples are available
|
|
|
|
in the subcommands or the documentation.
|
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
Create a new ACL role:
|
2019-04-15 20:43:19 +00:00
|
|
|
|
|
|
|
$ consul acl role create -name "new-role" \
|
|
|
|
-description "This is an example role" \
|
|
|
|
-policy-id 06acc965
|
|
|
|
List all roles:
|
|
|
|
|
|
|
|
$ consul acl role list
|
|
|
|
|
|
|
|
Update a role:
|
|
|
|
|
|
|
|
$ consul acl role update -name "other-role" -datacenter "dc1"
|
|
|
|
|
|
|
|
Read a role:
|
|
|
|
|
|
|
|
$ consul acl role read -id 0479e93e-091c-4475-9b06-79a004765c24
|
|
|
|
|
|
|
|
Delete a role
|
|
|
|
|
|
|
|
$ consul acl role delete -name "my-role"
|
|
|
|
|
|
|
|
For more examples, ask for subcommand help or view the documentation.
|
|
|
|
`
|