Admin Partition - HTTP API
This feature requires Consul Enterprise(opens in new tab).
The functionality described here is available only in Consul Enterprise version 1.11.0 and later.
Create a Partition
This endpoint creates a new partition and has the following characteristics:
Characteristic | Value |
---|---|
HTTP method | PUT |
URL path | /v1/partition |
Response type | application/json |
Required ACLs | operator:write |
Corresponding CLI command | consul partition create |
Consistency modes | N/A |
Blocking queries | N/A |
Agent caching | N/A |
JSON Request Body Schema
Name
(string: <required>)
- The partition name. This field must be a valid DNS hostname label.Description
(string: "")
- Free form partition description.
Sample Payload
Sample Request
Sample Response
Read a Partition
This endpoint reads a partition with the given name and has the following characteristics:
Characteristic | Value |
---|---|
HTTP method | GET |
URL path | /v1/partition/:name |
Response type | application/json |
Required ACLs | operator:read ; however, a non-anonymous token can always read its own partition |
Corresponding CLI command | consul partition read |
Consistency modes | default , consistent |
Blocking queries | No |
Agent caching | No |
Path Parameters
name
(string: <required>)
- Specifies the partition to read.
Sample Request
Sample Response
Update a Partition
This endpoint updates a partition description and has the following characteristics:
Characteristic | Value |
---|---|
HTTP method | PUT |
URL path | /v1/partition/:name |
Response type | application/json |
Required ACLs | operator:write |
Corresponding CLI command | consul partition write |
Consistency modes | N/A |
Blocking queries | N/A |
Agent caching | N/A |
Path Parameters
name
(string: <required>)
- Specifies the partition to update. This parameter must be a valid DNS hostname label.
JSON Request Body Schema
Name
(string: <optional>)
- If specified, this field must be an exact match with thename
path parameter.Description
(string: "")
- Free form partition description.
Sample Payload
Sample Request
Sample Response
Delete a Partition
This endpoint marks a partition for deletion. Once marked Consul will
deleted all the associated partitioned data in the background. Only once
all associated data has been deleted will the partition actually disappear.
Until then, further reads can be performed on the partition and a DeletedAt
field will now be populated with the timestamp of when the partition was
marked for deletion.
This endpoint has the following characteristics:
Characteristic | Value |
---|---|
HTTP method | DELETE |
URL path | /v1/partition/:name |
Response type | none; success or failure is indicated by the HTTP response status code |
Required ACLs | operator:write |
Corresponding CLI command | consul partition delete |
Consistency modes | N/A |
Blocking queries | N/A |
Agent caching | N/A |
Path Parameters
name
(string: <required>)
- Specifies the partition to delete.
Sample Request
Sample Read Output After Deletion Prior to Removal
List all Partitions
This endpoint lists all the partitions and has the following characteristics:
Characteristic | Value |
---|---|
HTTP method | GET |
URL path | /v1/partitions |
Response type | application/json |
Required ACLs | operator:read |
Corresponding CLI command | consul partition list |
Consistency modes | default , consistent |
Blocking queries | No |
Agent caching | No |
Sample Request
Sample Response