2017-03-15 06:40:33 +00:00
|
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
|
layout: api
|
|
|
|
|
page_title: /sys/remount - HTTP API
|
|
|
|
|
description: >-
|
|
|
|
|
The '/sys/remount' endpoint is used remount a mounted backend to a new
|
|
|
|
|
endpoint.
|
2017-03-15 06:40:33 +00:00
|
|
|
|
---
|
|
|
|
|
|
2022-03-04 22:38:15 +00:00
|
|
|
|
# Remount ( API )
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
2022-03-04 22:38:15 +00:00
|
|
|
|
The Remount documentation details the endpoints required to trigger and monitor the status of a remount operation.
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
2017-09-21 21:14:40 +00:00
|
|
|
|
## Move Backend
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
2022-03-04 22:38:15 +00:00
|
|
|
|
The `/sys/remount` endpoint moves an already-mounted backend to a new mount point. This process works for both secret
|
|
|
|
|
engines and auth methods.
|
|
|
|
|
|
2022-06-23 00:28:10 +00:00
|
|
|
|
The remount operation returns a migration ID to the user. The user may utilize the migration ID to look up
|
2022-03-17 21:06:35 +00:00
|
|
|
|
the status of the mount migration. More details about the remount operation are described in
|
|
|
|
|
[Mount Migration](/docs/concepts/mount-migration).
|
2021-07-22 20:09:26 +00:00
|
|
|
|
|
|
|
|
|
~> Note: This endpoint requires a policy with both `sudo` and `update` capabilities to `sys/remount`
|
|
|
|
|
|
2022-03-04 22:38:15 +00:00
|
|
|
|
~> Note: A mount migration will revoke all leases for the secrets of a secrets backend or tokens of an auth backend,
|
|
|
|
|
depending on which type of backend is being moved.
|
|
|
|
|
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :------------- |
|
|
|
|
|
| `POST` | `/sys/remount` |
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `from` `(string: <required>)` – Specifies the previous mount point.
|
|
|
|
|
|
|
|
|
|
- `to` `(string: <required>)` – Specifies the new destination mount point.
|
|
|
|
|
|
2022-03-04 22:38:15 +00:00
|
|
|
|
### Sample Payload ( Cross Namespace )
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"from": "ns1/ns2/secret",
|
|
|
|
|
"to": "ns1/ns3/new-secret"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Payload ( Cross Namespace, Auth Mount )
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"from": "ns1/ns2/auth/approle",
|
|
|
|
|
"to": "ns1/ns3/auth/new-approle"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Payload ( Within Namespace )
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"from": "secret",
|
|
|
|
|
"to": "new-secret"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2017-03-15 06:40:33 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
--request POST \
|
|
|
|
|
--data @payload.json \
|
2018-03-23 15:41:51 +00:00
|
|
|
|
http://127.0.0.1:8200/v1/sys/remount
|
2017-03-15 06:40:33 +00:00
|
|
|
|
```
|
2022-03-04 22:38:15 +00:00
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"migration_id": "ef3ba21c-8be8-4e5f-8d00-cb46a532c665"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Monitor Migration Status
|
|
|
|
|
|
|
|
|
|
This endpoint is used to monitor the status of a mount migration operation, using the ID returned in the response
|
|
|
|
|
of the `sys/remount` call. The response contains the passed-in ID, the source and target mounts, and a status field
|
|
|
|
|
that displays `in-progress`, `success` or `failure`.
|
|
|
|
|
|
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :------------- |
|
|
|
|
|
| `GET` | `/sys/remount/status/:migration_id` |
|
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `migration_id` `(string: <required>)` – Specifies the id of the mount migration
|
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/remount/status/ef3ba21c-8be8-4e5f-8d00-cb46a532c665
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"migration_id": "ef3ba21c-8be8-4e5f-8d00-cb46a532c665",
|
|
|
|
|
"migration_info": {
|
|
|
|
|
"source_mount": "ns1/ns2/secret",
|
|
|
|
|
"target_mount": "ns1/ns3/new-secret",
|
|
|
|
|
"status": "in-progress",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|