2018-05-22 16:07:13 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: License - Operator - HTTP API
|
|
|
|
sidebar_current: api-operator-license
|
|
|
|
description: |-
|
|
|
|
The /operator/license endpoints allow for setting and retrieving the Consul
|
|
|
|
Enterprise License.
|
|
|
|
---
|
|
|
|
|
|
|
|
# License - Operator HTTP API
|
|
|
|
|
2018-08-28 16:07:15 +00:00
|
|
|
~> **Enterprise Only!** This API endpoint and functionality only exists in
|
2018-05-22 16:07:13 +00:00
|
|
|
Consul Enterprise. This is not present in the open source version of Consul.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ---------------------------- | -------------------------- |
|
|
|
|
| `GET` | `/operator/license` | `application/json` |
|
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api/index.html#blocking-queries),
|
2018-09-06 10:34:28 +00:00
|
|
|
[consistency modes](/api/index.html#consistency-modes),
|
|
|
|
[agent caching](/api/index.html#agent-caching), and
|
2018-05-22 16:07:13 +00:00
|
|
|
[required ACLs](/api/index.html#acls).
|
|
|
|
|
2018-09-06 10:34:28 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ---------------- |
|
|
|
|
| `NO` | `all` | `none` | `none` |
|
2018-05-22 16:07:13 +00:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
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
|
|
|
This is specified as a URL query parameter.
|
2018-08-28 16:07:15 +00:00
|
|
|
|
2018-05-22 16:07:13 +00:00
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ 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
|
|
|
|
{
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
"features": [
|
|
|
|
"Automated Backups",
|
|
|
|
"Automated Upgrades",
|
|
|
|
"Enhanced Read Scalability",
|
|
|
|
"Network Segments",
|
|
|
|
"Redundancy Zone",
|
|
|
|
"Advanced Network Federation"
|
|
|
|
],
|
|
|
|
"temporary": false
|
|
|
|
},
|
|
|
|
"Warnings": []
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Updating the Consul License
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ---------------------------- | -------------------------- |
|
|
|
|
| `PUT` | `/operator/license` | `application/json` |
|
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api/index.html#blocking-queries),
|
2018-09-06 10:34:28 +00:00
|
|
|
[consistency modes](/api/index.html#consistency-modes),
|
|
|
|
[agent caching](/api/index.html#agent-caching), and
|
2018-05-22 16:07:13 +00:00
|
|
|
[required ACLs](/api/index.html#acls).
|
|
|
|
|
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
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
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
|
|
|
This is specified as a URL query parameter.
|
2018-08-28 16:07:15 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
```text
|
|
|
|
$ 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
|
|
|
|
{
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
"features": [
|
|
|
|
"Automated Backups",
|
|
|
|
"Automated Upgrades",
|
|
|
|
"Enhanced Read Scalability",
|
|
|
|
"Network Segments",
|
|
|
|
"Redundancy Zone",
|
|
|
|
"Advanced Network Federation"
|
|
|
|
],
|
|
|
|
"temporary": false
|
|
|
|
},
|
|
|
|
"Warnings": []
|
|
|
|
}
|
|
|
|
```
|