open-vault/website/content/docs/commands/lease.mdx
Clint 5353279e75
Add command to look up a lease by ID (#11129)
* snapshot

* basic test

* update command and add documentation

* update help text

* typo

* add changelog for lease lookup command

* run go mod vendor

* remove tabs from help output
2021-03-18 11:11:09 -05:00

64 lines
1.6 KiB
Plaintext

---
layout: docs
page_title: lease - Command
sidebar_title: <code>lease</code>
description: |-
The "lease" command groups subcommands for interacting with leases attached to
secrets.
---
# lease
The `lease` command groups subcommands for interacting with leases attached to
secrets. For leases attached to tokens, use the [`vault token`](/docs/commands/token) subcommand.
## Examples
Lookup a lease:
```shell-session
$ vault lease lookup database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
Key Value
--- -----
expire_time 2021-03-17T11:55:50.755313-05:00
id database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
issue_time 2021-03-17T11:45:50.755312-05:00
last_renewal <nil>
renewable true
ttl 9m52s
```
Renew a lease:
```shell-session
$ vault lease renew database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
Key Value
--- -----
lease_id database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
lease_duration 5m
lease_renewable true
```
Revoke a lease:
```shell-session
$ vault lease revoke database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
Success! Revoked lease: database/creds/readonly/27e1b9a1-27b8-83d9-9fe0-d99d786bdc83
```
## Usage
```text
Usage: vault lease <subcommand> [options] [args]
# ...
Subcommands:
lookup Lookup lease information by lease id
renew Renews the lease of a secret
revoke Revokes leases and secrets
```
For more information, examples, and usage about a subcommand, click on the name
of the subcommand in the sidebar.