github.com/kjdelisle/consul@v1.4.5/command/acl/acl.go (about)

     1  package acl
     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 = "Interact with Consul's ACLs"
    27  const help = `
    28  Usage: consul acl <subcommand> [options] [args]
    29  
    30    This command has subcommands for interacting with Consul's ACLs.
    31    Here are some simple examples, and more detailed examples are available
    32    in the subcommands or the documentation.
    33  
    34    Bootstrap ACLs:
    35  
    36        $ consul acl bootstrap
    37  
    38    List all ACL Tokens:
    39  
    40        $ consul acl token list
    41  
    42    Create a new ACL Policy:
    43  
    44        $ consul acl policy create -name "new-policy" \
    45                                   -description "This is an example policy" \
    46                                   -datacenter "dc1" \
    47                                   -datacenter "dc2" \
    48                                   -rules @rules.hcl
    49  
    50    Set the default agent token:
    51  
    52        $ consul acl set-agent-token default 0bc6bc46-f25e-4262-b2d9-ffbe1d96be6f
    53  
    54    For more examples, ask for subcommand help or view the documentation.
    55  `