Blog HCP Consul on Azure goes GA, plus more Consul news from HashiConf EU Read more
  • Overview
    • Consul on Kubernetes
    • Control access with Consul API Gateway
    • Discover Services with Consul
    • Enforce Zero Trust Networking with Consul
    • Load Balancing with Consul
    • Manage Traffic with Consul
    • Multi-Platform Service Mesh with Consul
    • Network Infrastructure Automation with Consul
    • Observability with Consul
  • Enterprise
  • Tutorials
  • Docs
  • API
  • CLI
  • Community
GitHub
Download
Try HCP Consul
    • v1.12.x (latest)
    • v1.11.x
    • v1.10.x
    • v1.9.x
    • v1.8.x
  • API Introduction
    • Consistency Modes
    • Blocking Queries
    • Filtering
    • Agent Caching

    • Overview
    • Tokens
    • Legacy Tokens
    • Policies
    • Roles
    • Auth Methods
    • Binding Rules
  • Admin Partitions
    • Overview
    • Checks
    • Services
    • Connect
  • Catalog
  • Cluster Peering
  • Config
    • Overview
    • Certificate Authority (CA)
    • Intentions
  • Coordinates
  • Discovery Chain
  • Events
  • Health
  • KV Store
    • Overview
    • Area
    • Autopilot
    • Keyring
    • License
    • Raft
    • Segment
  • Namespaces
  • Prepared Queries
  • Sessions
  • Snapshots
  • Status
  • Transactions

  • Libraries & SDKs
Type '/' to Search

»License - Operator HTTP API

Enterprise

This feature requires Consul Enterprise.

The licensing functionality described here is available only in Consul Enterprise version 1.1.0 and later.

»Getting the Consul License

This endpoint gets information about the current license.

MethodPathProduces
GET/operator/licenseapplication/json

The table below shows this endpoint's support for blocking queries, consistency modes, agent caching, and required ACLs.

Blocking QueriesConsistency ModesAgent CachingACL Required
NOallnonenone

The corresponding CLI command is consul license get.

»Query Parameters

  • dc (string: "") - Specifies the datacenter whose license should be retrieved. This will default to the datacenter of the agent serving the HTTP request.

»Sample Request

$ curl \
    http://127.0.0.1:8500/v1/operator/license
$ curl \
    http://127.0.0.1:8500/v1/operator/license

»Sample Response

{
  "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": []
}
{
  "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

Deprecated This endpoint was removed in Consul v1.10.0 along with the ability to manage the cluster's license via the API.

This endpoint updates the Consul license and returns some of the license contents as well as any warning messages regarding its validity.

MethodPathProduces
PUT/operator/licenseapplication/json

The table below shows this endpoint's support for blocking queries, consistency modes, agent caching, and required ACLs.

Blocking QueriesConsistency ModesAgent CachingACL Required
NOnonenoneoperator:write

The corresponding CLI command is consul license put.

»Query Parameters

  • dc (string: "") - Specifies the datacenter whose license should be updated. This will default to the datacenter of the agent serving the HTTP request.

»Sample Payload

The payload is the raw license blob.

»Sample Request

$ curl \
    --request PUT \
    --data @consul.license \
    http://127.0.0.1:8500/v1/operator/license
$ curl \
    --request PUT \
    --data @consul.license \
    http://127.0.0.1:8500/v1/operator/license

»Sample Response

{
  "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": []
}
{
  "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": []
}

»Resetting the Consul License

Deprecated This endpoint was removed in Consul v1.10.0 along with the ability to manage the cluster's license via the API.

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.

MethodPathProduces
DELETE/operator/licenseapplication/json

The table below shows this endpoint's support for blocking queries, consistency modes, agent caching, and required ACLs.

Blocking QueriesConsistency ModesAgent CachingACL Required
NOnonenoneoperator:write

The corresponding CLI command is consul license reset.

»Query Parameters

  • 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

$ curl \
    --request DELETE \
    http://127.0.0.1:8500/v1/operator/license
$ curl \
    --request DELETE \
    http://127.0.0.1:8500/v1/operator/license

»Sample Response

{
  "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": []
}
{
  "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": []
}
github logoEdit this page
IntroGuidesDocsCommunityPrivacySecurityBrandConsent Manager