Add custom metadata to namespace API and CLI docs (#16633)
* add custom_metadata to ns api docs * update ns CLI docs to add custom-metadata flag
This commit is contained in:
parent
9365250dfc
commit
707fcad006
|
@ -43,6 +43,19 @@ This endpoint creates a namespace at the given path.
|
|||
|
||||
- `path` `(string: <required>)` – Specifies the path where the namespace
|
||||
will be created.
|
||||
- `custom_metadata` `(map<string|string>: nil)` - A map of arbitrary string to string valued user-provided metadata meant
|
||||
to describe the namespace.
|
||||
|
||||
### Sample Payload
|
||||
|
||||
```json
|
||||
{
|
||||
"custom_metadata": {
|
||||
"foo": "abc",
|
||||
"bar": "123"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Sample Request
|
||||
|
||||
|
@ -50,6 +63,43 @@ This endpoint creates a namespace at the given path.
|
|||
$ curl \
|
||||
--header "X-Vault-Token: ..." \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
http://127.0.0.1:8200/v1/sys/namespaces/ns1
|
||||
```
|
||||
|
||||
## Patch Namespace
|
||||
|
||||
This endpoint patches an existing namespace at the specified path.
|
||||
|
||||
| Method | Path |
|
||||
| :------- | :---------------------- |
|
||||
| `PATCH` | `/sys/namespaces/:path` |
|
||||
|
||||
### Parameters
|
||||
|
||||
- `path` `(string: <required>)` – Specifies the path of the existing namespace.
|
||||
- `custom_metadata` `(map<string|string>: nil)` - A map of arbitrary string to string valued user-provided metadata meant
|
||||
to describe the namespace.
|
||||
|
||||
### Sample Payload
|
||||
|
||||
```json
|
||||
{
|
||||
"custom_metadata": {
|
||||
"foo": "abc",
|
||||
"bar": "123"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Sample Request
|
||||
|
||||
```shell-session
|
||||
$ curl \
|
||||
--header "X-Vault-Token: ..." \
|
||||
--header "Content-Type: application/merge-patch+json"
|
||||
--request PATCH \
|
||||
--data @payload.json \
|
||||
http://127.0.0.1:8200/v1/sys/namespaces/ns1
|
||||
```
|
||||
|
||||
|
@ -91,7 +141,11 @@ $ curl \
|
|||
```json
|
||||
{
|
||||
"id": "gsudj",
|
||||
"path": "ns1/"
|
||||
"path": "ns1/",
|
||||
"custom_metadata": {
|
||||
"foo": "abc",
|
||||
"bar": "123"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -16,12 +16,24 @@ List all namespaces:
|
|||
$ vault namespace list
|
||||
```
|
||||
|
||||
Create a namespace at the path `ns1/`:
|
||||
Create a namespace at the path `ns1/` with no custom metadata:
|
||||
|
||||
```shell-session
|
||||
$ vault namespace create ns1/
|
||||
```
|
||||
|
||||
Create a namespace at the path `ns1/` with multiple custom metadata keys:
|
||||
|
||||
```shell-session
|
||||
$ vault namespace create -custom-metadata=foo=abc -custom-metadata=bar=123 ns1/
|
||||
```
|
||||
|
||||
Patch an existing namespace at the path `ns1/` to add custom metadata key `bar` and remove key `foo`
|
||||
|
||||
```shell-session
|
||||
$ vault namespace patch -custom-metadata=bar=123 -remove-custom-metadata=foo ns1/
|
||||
```
|
||||
|
||||
Delete the namespace at path `ns1/`:
|
||||
|
||||
```shell-session
|
||||
|
|
Loading…
Reference in New Issue