2018-04-09 16:21:02 +00:00
|
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
|
layout: api
|
|
|
|
|
page_title: /sys/config/ui - HTTP API
|
|
|
|
|
description: The '/sys/config/ui' endpoint configures the UI.
|
2018-04-09 16:21:02 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# `/sys/config/ui`
|
|
|
|
|
|
|
|
|
|
The `/sys/config/ui` endpoint is used to configure UI settings.
|
|
|
|
|
|
|
|
|
|
- **`sudo` required** – All UI endpoints require `sudo` capability in
|
|
|
|
|
addition to any path-specific capabilities.
|
|
|
|
|
|
|
|
|
|
## Read UI Settings
|
|
|
|
|
|
|
|
|
|
This endpoint returns the given UI header configuration.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :----------------------------- |
|
|
|
|
|
| `GET` | `/sys/config/ui/headers/:name` |
|
2018-04-09 16:21:02 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `name` `(string: <required>)` – The name of the custom header.
|
|
|
|
|
|
2020-12-15 14:58:03 +00:00
|
|
|
|
- `multivalue` `(bool: <optional>)` - Returns multiple values if true.
|
|
|
|
|
|
2018-04-09 16:21:02 +00:00
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2018-04-09 16:21:02 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/config/ui/headers/X-Custom-Header
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"value": "custom-value"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-15 14:58:03 +00:00
|
|
|
|
### Sample Request (Multi value)
|
|
|
|
|
|
|
|
|
|
```shell-session
|
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/config/ui/headers/X-Custom-Header?multivalue=true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"values": ["custom-value-1", "custom-value-2"]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2018-04-09 16:21:02 +00:00
|
|
|
|
## Configure UI Headers
|
|
|
|
|
|
|
|
|
|
This endpoint allows configuring the values to be returned for the UI header.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :----------------------------- |
|
2022-02-25 14:52:24 +00:00
|
|
|
|
| `POST` | `/sys/config/ui/headers/:name` |
|
2018-04-09 16:21:02 +00:00
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
|
|
- `name` `(string: <required>)` – The name of the custom header.
|
|
|
|
|
|
|
|
|
|
- `values` `(list: <required>)` - The values to be returned from the header.
|
|
|
|
|
|
|
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"values": ["custom value 1", "custom value 2"]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2018-04-09 16:21:02 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
2022-02-25 14:52:24 +00:00
|
|
|
|
--request POST \
|
2018-04-09 16:21:02 +00:00
|
|
|
|
--data @payload.json \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/config/ui/headers/X-Custom-Header
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Delete a UI Header
|
|
|
|
|
|
|
|
|
|
This endpoint removes a UI header.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :------- | :----------------------------- |
|
|
|
|
|
| `DELETE` | `/sys/config/ui/headers/:name` |
|
2018-04-09 16:21:02 +00:00
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2018-04-09 16:21:02 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
--request DELETE \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/config/ui/headers/X-Custom-Header
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## List UI Headers
|
|
|
|
|
|
|
|
|
|
This endpoint returns a list of configured UI headers.
|
|
|
|
|
|
2020-01-18 00:18:09 +00:00
|
|
|
|
| Method | Path |
|
|
|
|
|
| :----- | :----------------------- |
|
|
|
|
|
| `LIST` | `/sys/config/ui/headers` |
|
2018-04-09 16:21:02 +00:00
|
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
|
```shell-session
|
2018-04-09 16:21:02 +00:00
|
|
|
|
$ curl \
|
|
|
|
|
--header "X-Vault-Token: ..." \
|
|
|
|
|
--request LIST \
|
|
|
|
|
http://127.0.0.1:8200/v1/sys/config/ui/headers
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2020-01-18 00:18:09 +00:00
|
|
|
|
"data": {
|
|
|
|
|
"keys": ["X-Custom...", "X-Header..."]
|
2018-04-09 16:21:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|