Update kv custom metadata docs (#12920)

* fix json code block in kv api docs

* add custom_metadata to GET, PUT, PATCH in kv api docs

* add custom_metadata to get, put, and patch in kv CLI docs
This commit is contained in:
Chris Capurso 2021-10-26 15:41:40 -04:00 committed by GitHub
parent a6b1cbad12
commit 7dcae18641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 5 deletions

View File

@ -30,7 +30,7 @@ key-value store.
- `max_versions` `(int: 0)` The number of versions to keep per key. This value
applies to all keys, but a key's metadata setting can overwrite this value.
Once a key has more than the configured allowed versions the oldest version
will be permanently deleted. When 0 is used or the value is unset, Vault
will be permanently deleted. When 0 is used or the value is unset, Vault
will keep 10 versions.
- `cas_required` `(bool: false)` If true all keys will require the cas
@ -93,9 +93,11 @@ $ curl \
## Read Secret Version
This endpoint retrieves the secret at the specified location. The metadata returned
here ( `created_time, destroy,` and `version`) is version specific. It should not be
confused with the response from the [metadata endpoint](/api/secret/kv/kv-v2#read-secret-metadata).
This endpoint retrieves the secret at the specified location. The metadata
fields `created_time`, `deletion_time`, `destroyed`, and `version` are version
specific. The `custom_metadata` field is part of the secret's key metadata and
is included in the response whether or not the calling token has `read` access to
the associated [metadata endpoint](/api/secret/kv/kv-v2#read-secret-metadata).
| Method | Path |
| :----- | :------------------------------------------- |
@ -126,6 +128,10 @@ $ curl \
},
"metadata": {
"created_time": "2018-03-22T02:24:06.945319214Z",
"custom_metadata": {
"owner": "jdoe",
"mission_critical": "false"
},
"deletion_time": "",
"destroyed": false,
"version": 2
@ -187,6 +193,10 @@ $ curl \
{
"data": {
"created_time": "2018-03-22T02:36:43.986212308Z",
"custom_metadata": {
"owner": "jdoe",
"mission_critical": "false"
},
"deletion_time": "",
"destroyed": false,
"version": 1
@ -253,11 +263,16 @@ $ curl \
{
"data": {
"created_time": "2021-09-10T15:26:08.684999Z",
"custom_metadata": {
"owner": "jdoe",
"mission_critical": "false"
},
"deletion_time": "",
"destroyed": false,
"version": 2
}
}
```
## Delete Latest Version of Secret

View File

@ -174,6 +174,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:20:22.985303Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 1
@ -187,6 +188,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:20:22.985303Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 1
@ -200,7 +202,7 @@ allows for writing keys with arbitrary values.
1. Write another version, the previous version will still be accessible. The
`-cas` flag can optionally be passed to perform a check-and-set operation. If
not set the write will be allowed. If set to `-cas=0` a write will only be allowed
if the key doesnt exist. If the index is non-zero the write will only be
if the key doesn't exist. If the index is non-zero the write will only be
allowed if the keys current version matches the version specified in the
cas parameter.
@ -209,6 +211,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:22:23.369372Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 2
@ -222,6 +225,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:22:23.369372Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 2
@ -250,6 +254,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:23:49.199802Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 3
@ -266,6 +271,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:23:49.199802Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 3
@ -277,6 +283,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:23:49.199802Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 3
@ -291,6 +298,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:23:49.199802Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 3
@ -310,6 +318,7 @@ allows for writing keys with arbitrary values.
Key Value
--- -----
created_time 2019-06-19T17:20:22.985303Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 1
@ -356,6 +365,7 @@ See the commands below for more information:
Key Value
--- -----
created_time 2019-06-19T17:23:21.834403Z
custom_metadata map[bar:123 foo:abc]
deletion_time n/a
destroyed false
version 2
@ -427,6 +437,7 @@ See the commands below for more information:
Key Value
--- -----
created_time 2019-06-19T17:31:16.662563Z
custom_metadata map[bar:123 foo:abc]
deletion_time 2019-06-19T20:56:35.662563Z
destroyed false
version 4
@ -443,6 +454,7 @@ See the commands below for more information:
cas_required false
created_time 2019-06-19T17:20:22.985303Z
current_version 4
custom_metadata map[bar:123 foo:abc]
delete_version_after 3h25m19s
max_versions 2
oldest_version 3