open-vault/website/content/api-docs/system/lease-count-quotas.mdx

105 lines
2.7 KiB
Plaintext
Raw Normal View History

2020-07-07 15:42:01 +00:00
---
layout: api
page_title: /sys/quotas/lease-count - HTTP API
description: The `/sys/quotas/lease-count` endpoint is used to create, edit and delete lease count quotas.
---
# `/sys/quotas/lease-count`
~> **Enterprise Only**  These endpoints require Vault Enterprise Platform.
The `/sys/quotas/lease-count` endpoint is used to create, edit and delete lease count quotas.
## Create or Update a Lease Count Quota
This endpoint is used to create a lease count quota with an identifier, `name`.
A lease count quota must include a `max_leases` value with an optional `path`
that can either be a namespace or mount.
| Method | Path |
| :----- | :------------------------------ |
| `POST` | `/sys/quotas/lease-count/:name` |
### Parameters
- `name` `(string: "")` - The name of the quota.
- `path` `(string: "")` - Path of the mount or namespace to apply the quota.
A blank path configures a global lease count quota. For example `namespace1/`
adds a quota to a full namespace, `namespace1/auth/userpass` adds a quota to
`userpass` in `namespace1`. Updating this field on an existing quota can have
"moving" effects. For example, updating `auth/userpass` to
`namespace1/auth/userpass` moves this quota from being a global mount quota to a
namespace specific mount quota.
2020-07-07 15:42:01 +00:00
- `max_leases` `(int: 0)` - Maximum number of leases allowed by the quota rule.
### Sample Payload
```json
{
"path": "",
"max_leases": 1000
2020-07-07 15:42:01 +00:00
}
```
### Sample Request
```shell-session
$ curl \
--request POST \
--header "X-Vault-Token: ..." \
--data @payload.json \
http://127.0.0.1:8200/v1/sys/quotas/lease-count/global-lease-count-quota
```
## Delete a Lease Count Quota
A lease count quota can be deleted by `name`.
| Method | Path |
| :------- | :------------------------------ |
| `DELETE` | `/sys/quotas/lease-count/:name` |
### Sample Request
```shell-session
$ curl \
--request DELETE \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/quotas/lease-count/global-lease-count-quota
```
## Get a Lease Count Quota
A lease count quota can be retrieved by `name`.
| Method | Path |
| :----- | :------------------------------ |
| `GET` | `/sys/quotas/lease-count/:name` |
### Sample Request
```shell-session
$ curl \
--request GET \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/quotas/lease-count/global-lease-count-quota
```
### Sample Response
```json
{
"request_id": "21514bc6-2c19-42b9-a8a7-cab27aff5815",
"lease_id": "",
"lease_duration": 0,
"renewable": false,
"data": {
"max_leases": 1000,
"name": "global-lease-count-quota",
"path": "",
"type": "lease-count"
},
"warnings": null
}
```