Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ This endpoint queries the static role definition.

- `name` `(string: <required>)` – Specifies the name of the static role to read.
This is specified as part of the URL.
- `read_snapshot_id` `(string: <optional>)` - Query parameter specifying the ID of a snapshot previously loaded into Vault that contains the role at the provided path.

### Sample request

Expand All @@ -652,6 +653,14 @@ $ curl \
http://127.0.0.1:8200/v1/database/static-roles/my-static-role
```

To read the role from a loaded snapshot with ID 2403d301-94f2-46a1-a39d-02be83e2831a:

```shell-session
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/database/static-roles/my-static-role?read_s
```

### Sample response with rotation period

```json
Expand Down Expand Up @@ -696,6 +705,10 @@ returned, not any values.
| :----- | :----------------------- |
| `LIST` | `/database/static-roles` |

### Parameters

- `read_snapshot_id` `(string: <optional>)` - Query parameter specifying the ID of a snapshot previously loaded into Vault that contains the roles at the provided path.

### Sample request

```shell-session
Expand All @@ -704,7 +717,13 @@ $ curl \
--request LIST \
http://127.0.0.1:8200/v1/database/static-roles
```
To list the roles from a loaded snapshot with ID 2403d301-94f2-46a1-a39d-02be83e2831a:

$ curl \
--header "X-Vault-Token: ..." \
--request LIST \
https://127.0.0.1:8200/v1/database/static-roles?read_snapshot_id=2403d301-94f2-46a1-a39d-02be83e2831a
```
### Sample response

```json
Expand All @@ -716,6 +735,33 @@ $ curl \
}
```

## Recover static role

[Recover](/vault/docs/concepts/integrated-storage/snapshot-recover) a role at the specified location from the given loaded snapshot.

~> The static role can only be recovered if the role doesn't already exist in the live cluster. A static role cannot be updated via a recover operation.

| Method | Path |
|:-------|:-------------------------------|
| `POST` | `/database/static-roles/:name` |

### Query parameters

- `name` `(string: <required>)` – Specifies the name of the static role to read.
This is specified as part of the URL.
- `recover_snapshot_id` `(string: <required>)` - The ID of a snapshot previously loaded into Vault that contains the role at the provided path.
- `recover_source_path` `(string: <optional>)` - The source path in the snapshot to recover from. If not provided, defaults to the request path.

### Sample request

```shell-session
$ curl \
--header "X-Vault-Token: ..." \
--request POST \
--get --data-urlencode "recover_source_path=database/static-roles/my-old-role" \
https://127.0.0.1:8200/v1/database/static-roles/my-role?recover_snapshot_id=2403d301-94f2-46a1-a39d-02be83e2831a
```

## Delete static role

This endpoint deletes the static role definition. The user, having been defined externally,
Expand Down Expand Up @@ -751,6 +797,7 @@ This endpoint returns the current credentials based on the named static role.

- `name` `(string: <required>)` – Specifies the name of the static role to get
credentials for. This is specified as part of the URL.
- `read_snapshot_id` `(string: <optional>)` - Query parameter specifying the ID of a snapshot previously loaded into Vault that contains credentials at the provided path.

### Sample request

Expand All @@ -760,6 +807,14 @@ $ curl \
http://127.0.0.1:8200/v1/database/static-creds/my-static-role
```

To read the credentials from a loaded snapshot with ID 2403d301-94f2-46a1-a39d-02be83e2831a:

```shell-session
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/database/static-creds/my-static-role?read_snapshot_id=2403d301-94f2-46a1-a39d-02be83e2831a
```

### Sample response with rotation period

```json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Plugin | Path | Supported snapshot operations | Vault version
--------- | --------------- | ----------------------------- | --------------
cubbyhole | `/:secret_name` | `recover`, `read`, `list` | 1.20.0
kv (v1) | `/:secret_name` | `recover`, `read`, `list` | 1.20.0
| Plugin | Path | Supported snapshot operations | Vault version |
|-----------|----------------------------|-------------------------------|---------------|
| cubbyhole | `/:secret_name` | `recover`, `read`, `list` | 1.20.0 |
| kv (v1) | `/:secret_name` | `recover`, `read`, `list` | 1.20.0 |
| databases | `/static-roles/:role_name` | `recover`, `read`, `list` | 1.20.4 |
| databases | `/static-creds/:role_name` | `read` | 1.20.4 |
Loading