2017-03-15 06:40:33 +00:00
|
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
|
layout: api
|
|
|
|
|
page_title: /sys/raw - HTTP API
|
|
|
|
|
description: The `/sys/raw` endpoint is used to access the raw underlying store in Vault.
|
2017-03-15 06:40:33 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# `/sys/raw`
|
|
|
|
|
|
2017-10-24 14:33:57 +00:00
|
|
|
|
The `/sys/raw` endpoint is used to access the raw underlying store in Vault.
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
This endpoint is off by default. See the
|
2020-01-22 20:05:41 +00:00
|
|
|
|
[Vault configuration documentation](/docs/configuration) to
|
2017-09-15 04:21:35 +00:00
|
|
|
|
enable.
|
|
|
|
|
|
2017-03-15 06:40:33 +00:00
|
|
|
|
## Read Raw
|
|
|
|
|
|
|
|
|
|
This endpoint reads the value of the key at the given path. This is the raw path
|
|
|
|
|
in the storage backend and not the logical path that is exposed via the mount
|
|
|
|
|
system.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :--------------- |
|
|
|
|
|
| `GET` | `/sys/raw/:path` |
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `path` `(string: <required>)` – Specifies the raw path in the storage backend.
|
|
|
|
|
This is specified as part of the URL.
|
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2017-03-15 06:40:33 +00:00
|
|
|
|
$ curl \
|
2020-07-30 21:55:42 +00:00
|
|
|
|
--header "X-Vault-Token: ..." \
|
2018-03-23 15:41:51 +00:00
|
|
|
|
http://127.0.0.1:8200/v1/sys/raw/secret/foo
|
2017-03-15 06:40:33 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"value": "{'foo':'bar'}"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Create/Update Raw
|
|
|
|
|
|
|
|
|
|
This endpoint updates the value of the key at the given path. This is the raw
|
|
|
|
|
path in the storage backend and not the logical path that is exposed via the
|
|
|
|
|
mount system.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :--------------- |
|
|
|
|
|
| `PUT` | `/sys/raw/:path` |
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `path` `(string: <required>)` – Specifies the raw path in the storage backend.
|
|
|
|
|
This is specified as part of the URL.
|
|
|
|
|
|
|
|
|
|
- `value` `(string: <required>)` – Specifies the value of the key.
|
|
|
|
|
|
|
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"value": "{\"foo\": \"bar\"}"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 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 PUT \
|
|
|
|
|
--data @payload.json \
|
2018-03-23 15:41:51 +00:00
|
|
|
|
http://127.0.0.1:8200/v1/sys/raw/secret/foo
|
2017-03-15 06:40:33 +00:00
|
|
|
|
```
|
|
|
|
|
|
2017-09-15 04:21:35 +00:00
|
|
|
|
## List Raw
|
|
|
|
|
|
|
|
|
|
This endpoint returns a list keys for a given path prefix.
|
|
|
|
|
|
|
|
|
|
**This endpoint requires 'sudo' capability.**
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :--------------------------- |
|
|
|
|
|
| `LIST` | `/sys/raw/:prefix` |
|
|
|
|
|
| `GET` | `/sys/raw/:prefix?list=true` |
|
2017-09-15 04:21:35 +00:00
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2017-09-15 04:21:35 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
--request LIST \
|
2018-03-23 15:41:51 +00:00
|
|
|
|
http://127.0.0.1:8200/v1/sys/raw/logical
|
2017-09-15 04:21:35 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2020-01-18 00:18:09 +00:00
|
|
|
|
"data": {
|
|
|
|
|
"keys": ["abcd-1234...", "efgh-1234...", "ijkl-1234..."]
|
2017-09-15 04:21:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2017-03-15 06:40:33 +00:00
|
|
|
|
## Delete Raw
|
|
|
|
|
|
|
|
|
|
This endpoint deletes the key with given path. This is the raw path in the
|
|
|
|
|
storage backend and not the logical path that is exposed via the mount system.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :------- | :--------------- |
|
|
|
|
|
| `DELETE` | `/sys/raw/:path` |
|
2017-03-15 06:40:33 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `path` `(string: <required>)` – Specifies the raw path in the storage backend.
|
|
|
|
|
This is specified as part of the URL.
|
|
|
|
|
|
|
|
|
|
### 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 DELETE \
|
2018-03-23 15:41:51 +00:00
|
|
|
|
http://127.0.0.1:8200/v1/sys/raw/secret/foo
|
2017-03-15 06:40:33 +00:00
|
|
|
|
```
|