github.com/clly/consul@v1.4.5/website/source/api/operator/license.html.md (about)

     1  ---
     2  layout: api
     3  page_title: License - Operator - HTTP API
     4  sidebar_current: api-operator-license
     5  description: |-
     6    The /operator/license endpoints allow for setting and retrieving the Consul
     7    Enterprise License.
     8  ---
     9  
    10  # License - Operator HTTP API
    11  
    12  ~> **Enterprise Only!** This API endpoint and functionality only exists in
    13  Consul Enterprise. This is not present in the open source version of Consul.
    14  
    15  The licensing functionality described here is available only in
    16  [Consul Enterprise](https://www.hashicorp.com/products/consul/) version 1.1.0 and later.
    17  
    18  ## Getting the Consul License
    19  
    20  This endpoint gets information about the current license.
    21  
    22  | Method | Path                         | Produces                   |
    23  | ------ | ---------------------------- | -------------------------- |
    24  | `GET` | `/operator/license`           | `application/json`         |
    25  
    26  The table below shows this endpoint's support for
    27  [blocking queries](/api/index.html#blocking-queries),
    28  [consistency modes](/api/index.html#consistency-modes),
    29  [agent caching](/api/index.html#agent-caching), and
    30  [required ACLs](/api/index.html#acls).
    31  
    32  | Blocking Queries | Consistency Modes | Agent Caching | ACL Required     |
    33  | ---------------- | ----------------- | ------------- | ---------------- |
    34  | `NO`             | `all`             | `none`        | `none`           |
    35  
    36  ### Parameters
    37  
    38  - `dc` `(string: "")` - Specifies the datacenter whose license should be retrieved.
    39    This will default to the datacenter of the agent serving the HTTP request.
    40    This is specified as a URL query parameter.
    41  
    42  ### Sample Request
    43  
    44  ```text
    45  $ curl \
    46      http://127.0.0.1:8500/v1/operator/license
    47  ```
    48  
    49  ### Sample Response
    50  
    51  ```json
    52  {
    53      "Valid": true,
    54      "License": {
    55          "license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c",
    56          "customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b",
    57          "installation_id": "*",
    58          "issue_time": "2018-05-21T20:03:35.911567355Z",
    59          "start_time": "2018-05-21T04:00:00Z",
    60          "expiration_time": "2019-05-22T03:59:59.999Z",
    61          "product": "consul",
    62          "flags": {
    63              "package": "premium"
    64          },
    65          "features": [
    66              "Automated Backups",
    67              "Automated Upgrades",
    68              "Enhanced Read Scalability",
    69              "Network Segments",
    70              "Redundancy Zone",
    71              "Advanced Network Federation"
    72          ],
    73          "temporary": false
    74      },
    75      "Warnings": []
    76  }
    77  ```
    78  
    79  ## Updating the Consul License
    80  
    81  This endpoint updates the Consul license and returns some of the
    82  license contents as well as any warning messages regarding its validity.
    83  
    84  | Method | Path                         | Produces                   |
    85  | ------ | ---------------------------- | -------------------------- |
    86  | `PUT` | `/operator/license`           | `application/json`         |
    87  
    88  The table below shows this endpoint's support for
    89  [blocking queries](/api/index.html#blocking-queries),
    90  [consistency modes](/api/index.html#consistency-modes),
    91  [agent caching](/api/index.html#agent-caching), and
    92  [required ACLs](/api/index.html#acls).
    93  
    94  | Blocking Queries | Consistency Modes | Agent Caching | ACL Required     |
    95  | ---------------- | ----------------- | ------------- | ---------------- |
    96  | `NO`             | `none`            | `none`        | `operator:write` |
    97  
    98  ### Parameters
    99  
   100  - `dc` `(string: "")` - Specifies the datacenter whose license should be updated.
   101    This will default to the datacenter of the agent serving the HTTP request.
   102    This is specified as a URL query parameter.
   103  
   104  ### Sample Payload
   105  
   106  The payload is the raw license blob.
   107  
   108  ### Sample Request
   109  
   110  ```text
   111  $ curl \
   112      --request PUT \
   113      --data @consul.license \
   114      http://127.0.0.1:8500/v1/operator/license
   115  ```
   116  
   117  ### Sample Response
   118  
   119  ```json
   120  {
   121      "Valid": true,
   122      "License": {
   123          "license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c",
   124          "customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b",
   125          "installation_id": "*",
   126          "issue_time": "2018-05-21T20:03:35.911567355Z",
   127          "start_time": "2018-05-21T04:00:00Z",
   128          "expiration_time": "2019-05-22T03:59:59.999Z",
   129          "product": "consul",
   130          "flags": {
   131              "package": "premium"
   132          },
   133          "features": [
   134              "Automated Backups",
   135              "Automated Upgrades",
   136              "Enhanced Read Scalability",
   137              "Network Segments",
   138              "Redundancy Zone",
   139              "Advanced Network Federation"
   140          ],
   141          "temporary": false
   142      },
   143      "Warnings": []
   144  }
   145  ```