2018-05-22 16:07:13 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: License - Operator - HTTP API
|
|
|
|
description: |-
|
2021-06-03 13:40:12 +00:00
|
|
|
The /operator/license endpoint allows for retrieving the Consul
|
2018-05-22 16:07:13 +00:00
|
|
|
Enterprise License.
|
|
|
|
---
|
|
|
|
|
|
|
|
# License - Operator HTTP API
|
|
|
|
|
2020-04-23 22:13:18 +00:00
|
|
|
<EnterpriseAlert />
|
2018-05-22 16:07:13 +00:00
|
|
|
|
|
|
|
The licensing functionality described here is available only in
|
|
|
|
[Consul Enterprise](https://www.hashicorp.com/products/consul/) version 1.1.0 and later.
|
|
|
|
|
|
|
|
## Getting the Consul License
|
|
|
|
|
|
|
|
This endpoint gets information about the current license.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------------- | ------------------ |
|
|
|
|
| `GET` | `/operator/license` | `application/json` |
|
2018-05-22 16:07:13 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2023-01-25 16:52:43 +00:00
|
|
|
[blocking queries](/consul/api-docs/features/blocking),
|
|
|
|
[consistency modes](/consul/api-docs/features/consistency),
|
|
|
|
[agent caching](/consul/api-docs/features/caching), and
|
|
|
|
[required ACLs](/consul/api-docs/api-structure#authentication).
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `all` | `none` | `none` |
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul license get`](/consul/commands/license#get).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2018-08-28 16:07:15 +00:00
|
|
|
- `dc` `(string: "")` - Specifies the datacenter whose license should be retrieved.
|
|
|
|
This will default to the datacenter of the agent serving the HTTP request.
|
|
|
|
|
2018-05-22 16:07:13 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-22 16:07:13 +00:00
|
|
|
$ curl \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/operator/license
|
2018-05-22 16:07:13 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"Valid": true,
|
|
|
|
"License": {
|
|
|
|
"license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c",
|
|
|
|
"customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b",
|
|
|
|
"installation_id": "*",
|
|
|
|
"issue_time": "2018-05-21T20:03:35.911567355Z",
|
|
|
|
"start_time": "2018-05-21T04:00:00Z",
|
|
|
|
"expiration_time": "2019-05-22T03:59:59.999Z",
|
|
|
|
"product": "consul",
|
|
|
|
"flags": {
|
|
|
|
"package": "premium"
|
2018-05-22 16:07:13 +00:00
|
|
|
},
|
2020-04-06 20:27:35 +00:00
|
|
|
"features": [
|
|
|
|
"Automated Backups",
|
|
|
|
"Automated Upgrades",
|
|
|
|
"Enhanced Read Scalability",
|
|
|
|
"Network Segments",
|
|
|
|
"Redundancy Zone",
|
|
|
|
"Advanced Network Federation"
|
|
|
|
],
|
|
|
|
"temporary": false
|
|
|
|
},
|
|
|
|
"Warnings": []
|
2018-05-22 16:07:13 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Updating the Consul License
|
|
|
|
|
2021-06-03 13:40:12 +00:00
|
|
|
-> **Deprecated** This endpoint was removed in Consul v1.10.0 along with
|
|
|
|
the ability to manage the cluster's license via the API.
|
|
|
|
|
2018-08-28 16:07:15 +00:00
|
|
|
This endpoint updates the Consul license and returns some of the
|
2018-05-22 16:07:13 +00:00
|
|
|
license contents as well as any warning messages regarding its validity.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------------- | ------------------ |
|
|
|
|
| `PUT` | `/operator/license` | `application/json` |
|
2018-05-22 16:07:13 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2023-01-25 16:52:43 +00:00
|
|
|
[blocking queries](/consul/api-docs/features/blocking),
|
|
|
|
[consistency modes](/consul/api-docs/features/consistency),
|
|
|
|
[agent caching](/consul/api-docs/features/caching), and
|
|
|
|
[required ACLs](/consul/api-docs/api-structure#authentication).
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2018-09-06 10:34:28 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ---------------- |
|
|
|
|
| `NO` | `none` | `none` | `operator:write` |
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul license put`](/consul/commands/license#put).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2018-08-28 16:07:15 +00:00
|
|
|
- `dc` `(string: "")` - Specifies the datacenter whose license should be updated.
|
|
|
|
This will default to the datacenter of the agent serving the HTTP request.
|
|
|
|
|
2018-05-22 16:07:13 +00:00
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
The payload is the raw license blob.
|
|
|
|
|
2018-08-28 16:07:15 +00:00
|
|
|
### Sample Request
|
2018-05-22 16:07:13 +00:00
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2018-05-22 16:07:13 +00:00
|
|
|
$ curl \
|
|
|
|
--request PUT \
|
|
|
|
--data @consul.license \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/operator/license
|
2018-05-22 16:07:13 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"Valid": true,
|
|
|
|
"License": {
|
|
|
|
"license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c",
|
|
|
|
"customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b",
|
|
|
|
"installation_id": "*",
|
|
|
|
"issue_time": "2018-05-21T20:03:35.911567355Z",
|
|
|
|
"start_time": "2018-05-21T04:00:00Z",
|
|
|
|
"expiration_time": "2019-05-22T03:59:59.999Z",
|
|
|
|
"product": "consul",
|
|
|
|
"flags": {
|
|
|
|
"package": "premium"
|
2018-05-22 16:07:13 +00:00
|
|
|
},
|
2020-04-06 20:27:35 +00:00
|
|
|
"features": [
|
|
|
|
"Automated Backups",
|
|
|
|
"Automated Upgrades",
|
|
|
|
"Enhanced Read Scalability",
|
|
|
|
"Network Segments",
|
|
|
|
"Redundancy Zone",
|
|
|
|
"Advanced Network Federation"
|
|
|
|
],
|
|
|
|
"temporary": false
|
|
|
|
},
|
|
|
|
"Warnings": []
|
2018-05-22 16:07:13 +00:00
|
|
|
}
|
|
|
|
```
|
2019-06-24 12:36:59 +00:00
|
|
|
|
|
|
|
## Resetting the Consul License
|
|
|
|
|
2021-06-03 13:40:12 +00:00
|
|
|
-> **Deprecated** This endpoint was removed in Consul v1.10.0 along with
|
|
|
|
the ability to manage the cluster's license via the API.
|
|
|
|
|
2019-06-24 12:36:59 +00:00
|
|
|
This endpoint resets the Consul license to the license included in the Enterprise binary. If the included license is not valid, the replace will fail.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| -------- | ------------------- | ------------------ |
|
|
|
|
| `DELETE` | `/operator/license` | `application/json` |
|
2019-06-24 12:36:59 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2023-01-25 16:52:43 +00:00
|
|
|
[blocking queries](/consul/api-docs/features/blocking),
|
|
|
|
[consistency modes](/consul/api-docs/features/consistency),
|
|
|
|
[agent caching](/consul/api-docs/features/caching), and
|
|
|
|
[required ACLs](/consul/api-docs/api-structure#authentication).
|
2019-06-24 12:36:59 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ---------------- |
|
|
|
|
| `NO` | `none` | `none` | `operator:write` |
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul license reset`](/consul/commands/license#reset).
|
2019-06-24 12:36:59 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2019-06-24 12:36:59 +00:00
|
|
|
|
|
|
|
- `dc` `(string: "")` - Specifies the datacenter whose license should be updated.
|
|
|
|
This will default to the datacenter of the agent serving the HTTP request.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2019-06-24 12:36:59 +00:00
|
|
|
$ curl \
|
|
|
|
--request DELETE \
|
|
|
|
http://127.0.0.1:8500/v1/operator/license
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"Valid": true,
|
|
|
|
"License": {
|
|
|
|
"license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c",
|
|
|
|
"customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b",
|
|
|
|
"installation_id": "*",
|
|
|
|
"issue_time": "2018-05-21T20:03:35.911567355Z",
|
|
|
|
"start_time": "2018-05-21T04:00:00Z",
|
|
|
|
"expiration_time": "2019-05-22T03:59:59.999Z",
|
|
|
|
"product": "consul",
|
|
|
|
"flags": {
|
|
|
|
"package": "premium"
|
2019-06-24 12:36:59 +00:00
|
|
|
},
|
2020-04-06 20:27:35 +00:00
|
|
|
"features": [
|
|
|
|
"Automated Backups",
|
|
|
|
"Automated Upgrades",
|
|
|
|
"Enhanced Read Scalability",
|
|
|
|
"Network Segments",
|
|
|
|
"Redundancy Zone",
|
|
|
|
"Advanced Network Federation"
|
|
|
|
],
|
|
|
|
"temporary": false
|
|
|
|
},
|
|
|
|
"Warnings": []
|
2019-06-24 12:36:59 +00:00
|
|
|
}
|
|
|
|
```
|