mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Add lease subcommand
This commit is contained in:
40
command/lease.go
Normal file
40
command/lease.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/mitchellh/cli"
|
||||
)
|
||||
|
||||
var _ cli.Command = (*LeaseCommand)(nil)
|
||||
|
||||
type LeaseCommand struct {
|
||||
*BaseCommand
|
||||
}
|
||||
|
||||
func (c *LeaseCommand) Synopsis() string {
|
||||
return "Interact with leases"
|
||||
}
|
||||
|
||||
func (c *LeaseCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: vault lease <subcommand> [options] [args]
|
||||
|
||||
This command groups subcommands for interacting with leases. Users can revoke
|
||||
or renew leases.
|
||||
|
||||
Renew a lease:
|
||||
|
||||
$ vault lease renew database/creds/readonly/2f6a614c...
|
||||
|
||||
Revoke a lease:
|
||||
|
||||
$ vault lease revoke database/creds/readonly/2f6a614c...
|
||||
`
|
||||
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
|
||||
func (c *LeaseCommand) Run(args []string) int {
|
||||
return cli.RunResultHelp
|
||||
}
|
||||
Reference in New Issue
Block a user