github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/command/acl/policy/policy.go (about)

     1  package policy
     2  
     3  import (
     4  	"github.com/hashicorp/consul/command/flags"
     5  	"github.com/mitchellh/cli"
     6  )
     7  
     8  func New() *cmd {
     9  	return &cmd{}
    10  }
    11  
    12  type cmd struct{}
    13  
    14  func (c *cmd) Run(args []string) int {
    15  	return cli.RunResultHelp
    16  }
    17  
    18  func (c *cmd) Synopsis() string {
    19  	return synopsis
    20  }
    21  
    22  func (c *cmd) Help() string {
    23  	return flags.Usage(help, nil)
    24  }
    25  
    26  const synopsis = "Manage Consul's ACL Policies"
    27  const help = `
    28  Usage: consul acl policy <subcommand> [options] [args]
    29  
    30    This command has subcommands for managing Consul's ACL Policies.
    31    Here are some simple examples, and more detailed examples are available
    32    in the subcommands or the documentation.
    33  
    34    Create a new ACL Policy:
    35  
    36        $ consul acl policy create -name "new-policy" \
    37                                   -description "This is an example policy" \
    38                                   -datacenter "dc1" \
    39                                   -datacenter "dc2" \
    40                                   -rules @rules.hcl
    41    List all policies:
    42  
    43        $ consul acl policy list
    44  
    45    Update a policy:
    46  
    47        $ consul acl policy update -name "other-policy" -datacenter "dc1"
    48  
    49    Read a policy:
    50  
    51      $ consul acl policy read -id 0479e93e-091c-4475-9b06-79a004765c24
    52  
    53    Delete a policy
    54  
    55      $ consul acl policy delete -name "my-policy"
    56  
    57    For more examples, ask for subcommand help or view the documentation.
    58  `