2018-10-31 22:11:51 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: ACL Policies - HTTP API
|
2020-04-07 18:55:19 +00:00
|
|
|
description: The /acl/policy endpoints manage Consul's ACL policies.
|
2018-10-31 22:11:51 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# ACL Policy HTTP API
|
|
|
|
|
|
|
|
The `/acl/policy` endpoints [create](#create-a-policy), [read](#read-a-policy),
|
2019-05-01 21:11:23 +00:00
|
|
|
[update](#update-a-policy), [list](#list-policies) and
|
2020-02-03 08:41:54 +00:00
|
|
|
[delete](#delete-a-policy) ACL policies in Consul.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-08-17 16:20:02 +00:00
|
|
|
For more information on how to setup ACLs, please check
|
2023-01-25 16:52:43 +00:00
|
|
|
the [ACL tutorial](/consul/tutorials/security/access-control-setup-production).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
## Create a Policy
|
|
|
|
|
|
|
|
This endpoint creates a new ACL policy.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------- | ------------------ |
|
|
|
|
| `PUT` | `/acl/policy` | `application/json` |
|
2018-10-31 22:11:51 +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-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `none` | `none` | `acl:write` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy create`](/consul/commands/acl/policy/create).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you create.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
|
|
|
|
|
|
|
### JSON Request Body Schema
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Name` `(string: <required>)` - Specifies a name for the ACL policy. The name
|
2020-04-06 20:27:35 +00:00
|
|
|
can contain alphanumeric characters, dashes `-`, and underscores `_`.
|
2019-05-01 21:11:23 +00:00
|
|
|
This name must be unique.
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Description` `(string: "")` - Free form human readable description of the policy.
|
|
|
|
|
|
|
|
- `Rules` `(string: "")` - Specifies rules for the ACL policy. The format of the
|
2023-01-25 16:52:43 +00:00
|
|
|
`Rules` property is detailed in the [ACL Rules documentation](/consul/docs/security/acl/acl-rules).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Datacenters` `(array<string>)` - Specifies the datacenters the policy is valid within.
|
2020-04-06 20:27:35 +00:00
|
|
|
When no datacenters are provided the policy is valid in all datacenters including
|
|
|
|
those which do not yet exist but may in the future.
|
2020-02-03 08:41:54 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `Namespace` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you create.
|
|
|
|
This field takes precedence over the `ns` query parameter,
|
|
|
|
one of several [other methods to specify the namespace](#methods-to-specify-namespace).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2024-07-18 17:02:45 +00:00
|
|
|
@include 'http-api-body-options-partition.mdx'
|
|
|
|
|
2018-10-31 22:11:51 +00:00
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"Name": "node-read",
|
|
|
|
"Description": "Grants read access to all node information",
|
|
|
|
"Rules": "node_prefix \"\" { policy = \"read\"}",
|
|
|
|
"Datacenters": ["dc1"]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request PUT \
|
2018-10-31 22:11:51 +00:00
|
|
|
--data @payload.json \
|
|
|
|
http://127.0.0.1:8500/v1/acl/policy
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"ID": "e359bd81-baca-903e-7e64-1ccd9fdc78f5",
|
|
|
|
"Name": "node-read",
|
|
|
|
"Description": "Grants read access to all node information",
|
|
|
|
"Rules": "node_prefix \"\" { policy = \"read\"}",
|
|
|
|
"Datacenters": ["dc1"],
|
|
|
|
"Hash": "OtZUUKhInTLEqTPfNSSOYbRiSBKm3c4vI2p6MxZnGWc=",
|
|
|
|
"CreateIndex": 14,
|
|
|
|
"ModifyIndex": 14
|
2018-10-31 22:11:51 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Read a Policy
|
|
|
|
|
|
|
|
This endpoint reads an ACL policy with the given ID.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ----------------- | ------------------ |
|
|
|
|
| `GET` | `/acl/policy/:id` | `application/json` |
|
2018-10-31 22:11:51 +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-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `YES` | `all` | `none` | `acl:read` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy read`](/consul/commands/acl/policy/read).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Path Parameters
|
|
|
|
|
|
|
|
- `id` `(string: <required>)` - Specifies the UUID of the policy you lookup.
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2020-02-03 08:41:54 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you lookup.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request GET http://127.0.0.1:8500/v1/acl/policy/e359bd81-baca-903e-7e64-1ccd9fdc78f5
|
2018-10-31 22:11:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"ID": "e359bd81-baca-903e-7e64-1ccd9fdc78f5",
|
|
|
|
"Name": "node-read",
|
|
|
|
"Description": "Grants read access to all node information",
|
|
|
|
"Rules": "node_prefix \"\" { policy = \"read\"}",
|
|
|
|
"Datacenters": ["dc1"],
|
|
|
|
"Hash": "OtZUUKhInTLEqTPfNSSOYbRiSBKm3c4vI2p6MxZnGWc=",
|
|
|
|
"CreateIndex": 14,
|
|
|
|
"ModifyIndex": 14
|
2018-10-31 22:11:51 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-03-27 14:20:09 +00:00
|
|
|
## Read a Policy by Name
|
|
|
|
|
|
|
|
This endpoint reads an ACL policy with the given ID.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------------------ | ------------------ |
|
|
|
|
| `GET` | `/acl/policy/name/:name` | `application/json` |
|
2020-03-27 14:20:09 +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).
|
2020-03-27 14:20:09 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `YES` | `all` | `none` | `acl:read` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy read -name=<string>`](/consul/commands/acl/policy/read#name).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Path Parameters
|
2020-03-27 14:20:09 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `name` `(string: <required>)` - Specifies the name of the ACL policy to read.
|
2020-03-27 14:20:09 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you lookup.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
2020-03-27 14:20:09 +00:00
|
|
|
|
2024-07-18 17:02:45 +00:00
|
|
|
@include 'http-api-query-parms-partition.mdx'
|
|
|
|
|
2020-03-27 14:20:09 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request GET http://127.0.0.1:8500/v1/acl/policy/name/node-read
|
2020-03-27 14:20:09 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"ID": "e359bd81-baca-903e-7e64-1ccd9fdc78f5",
|
|
|
|
"Name": "node-read",
|
|
|
|
"Description": "Grants read access to all node information",
|
|
|
|
"Rules": "node_prefix \"\" { policy = \"read\"}",
|
|
|
|
"Datacenters": ["dc1"],
|
|
|
|
"Hash": "OtZUUKhInTLEqTPfNSSOYbRiSBKm3c4vI2p6MxZnGWc=",
|
|
|
|
"CreateIndex": 14,
|
|
|
|
"ModifyIndex": 14
|
2020-03-27 14:20:09 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-10-31 22:11:51 +00:00
|
|
|
## Update a Policy
|
|
|
|
|
|
|
|
This endpoint updates an existing ACL policy.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ----------------- | ------------------ |
|
|
|
|
| `PUT` | `/acl/policy/:id` | `application/json` |
|
2018-10-31 22:11:51 +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-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `none` | `none` | `acl:write` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy update`](/consul/commands/acl/policy/update).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Path Parameters
|
|
|
|
|
|
|
|
- `id` `(string: <required>)` - Specifies the UUID of the policy you update.
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you update.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
|
|
|
|
|
|
|
### JSON Request Body Schema
|
|
|
|
|
|
|
|
- `ID` `(string: <optional>)` - If specified, this field must be an exact match
|
|
|
|
with the `id` path parameter.
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Name` `(string: <required>)` - Specifies a name for the ACL policy. The name
|
2020-04-06 20:27:35 +00:00
|
|
|
can only contain alphanumeric characters as well as `-` and `_` and must be
|
|
|
|
unique.
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Description` `(string: "")` - Free form human readable description of this policy.
|
|
|
|
|
|
|
|
- `Rules` `(string: "")` - Specifies rules for this ACL policy. The format of the
|
2023-01-25 16:52:43 +00:00
|
|
|
`Rules` property is detailed in the [ACL Rules documentation](/consul/docs/security/acl/acl-rules).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
- `Datacenters` `(array<string>)` - Specifies the datacenters this policy is valid within.
|
2020-04-06 20:27:35 +00:00
|
|
|
When no datacenters are provided the policy is valid in all datacenters including
|
|
|
|
those which do not yet exist but may in the future.
|
2020-02-03 08:41:54 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `Namespace` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you update.
|
|
|
|
This field takes precedence over the `ns` query parameter,
|
|
|
|
one of several [other methods to specify the namespace](#methods-to-specify-namespace).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2024-07-18 17:02:45 +00:00
|
|
|
@include 'http-api-body-options-partition.mdx'
|
|
|
|
|
2018-10-31 22:11:51 +00:00
|
|
|
### Sample Payload
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ID": "c01a1f82-44be-41b0-a686-685fb6e0f485",
|
|
|
|
"Name": "register-app-service",
|
|
|
|
"Description": "Grants write permissions necessary to register the 'app' service",
|
2020-04-06 20:27:35 +00:00
|
|
|
"Rules": "service \"app\" { policy = \"write\"}"
|
2018-10-31 22:11:51 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request PUT \
|
2018-10-31 22:11:51 +00:00
|
|
|
--data @payload.json \
|
|
|
|
http://127.0.0.1:8500/v1/acl/policy/c01a1f82-44be-41b0-a686-685fb6e0f485
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-04-06 20:27:35 +00:00
|
|
|
"ID": "c01a1f82-44be-41b0-a686-685fb6e0f485",
|
|
|
|
"Name": "register-app-service",
|
|
|
|
"Description": "Grants write permissions necessary to register the 'app' service",
|
|
|
|
"Rules": "service \"app\" { policy = \"write\"}",
|
|
|
|
"Hash": "OtZUUKhInTLEqTPfNSSOYbRiSBKm3c4vI2p6MxZnGWc=",
|
|
|
|
"CreateIndex": 14,
|
|
|
|
"ModifyIndex": 28
|
2018-10-31 22:11:51 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Delete a Policy
|
|
|
|
|
|
|
|
This endpoint deletes an ACL policy.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| -------- | ----------------- | ------------------ |
|
|
|
|
| `DELETE` | `/acl/policy/:id` | `application/json` |
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
Even though the return type is application/json, the value is either true or
|
|
|
|
false indicating whether the delete succeeded.
|
|
|
|
|
|
|
|
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-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `NO` | `none` | `none` | `acl:write` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy delete`](/consul/commands/acl/policy/delete).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Path Parameters
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `id` `(string: <required>)` - Specifies the UUID of the policy you delete.
|
2020-02-03 08:41:54 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
|
|
|
|
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Specifies the namespace of the policy you delete.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2024-07-18 17:02:45 +00:00
|
|
|
@include 'http-api-query-parms-partition.mdx'
|
|
|
|
|
2018-10-31 22:11:51 +00:00
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request DELETE \
|
2018-10-31 22:11:51 +00:00
|
|
|
http://127.0.0.1:8500/v1/acl/policy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
2020-04-06 20:27:35 +00:00
|
|
|
|
2018-10-31 22:11:51 +00:00
|
|
|
```json
|
|
|
|
true
|
|
|
|
```
|
|
|
|
|
|
|
|
## List Policies
|
|
|
|
|
|
|
|
This endpoint lists all the ACL policies.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | --------------- | ------------------ |
|
|
|
|
| `GET` | `/acl/policies` | `application/json` |
|
2018-10-31 22:11:51 +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-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | ------------ |
|
|
|
|
| `YES` | `all` | `none` | `acl:read` |
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The corresponding CLI command is [`consul acl policy list`](/consul/commands/acl/policy/list).
|
2022-01-10 19:21:32 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2019-12-06 16:14:56 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
- `ns` `(string: "")` <EnterpriseAlert inline /> - Return only the auth methods in the specified namespace.
|
|
|
|
The namespace may be specified as '\*' to return results for all namespaces.
|
|
|
|
You can also [specify the namespace through other methods](#methods-to-specify-namespace).
|
2019-12-06 16:14:56 +00:00
|
|
|
|
2024-07-18 17:02:45 +00:00
|
|
|
@include 'http-api-query-parms-partition.mdx'
|
|
|
|
|
|
|
|
### Sample Request
|
2018-10-31 22:11:51 +00:00
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2022-01-12 23:05:01 +00:00
|
|
|
$ curl --request GET http://127.0.0.1:8500/v1/acl/policies
|
2018-10-31 22:11:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
-> **Note** - The policies rules are not included in the listing and must be
|
2020-04-06 20:27:35 +00:00
|
|
|
retrieved by the [policy reading endpoint](#read-a-policy)
|
2018-10-31 22:11:51 +00:00
|
|
|
|
|
|
|
```json
|
|
|
|
[
|
2020-04-06 20:27:35 +00:00
|
|
|
{
|
|
|
|
"CreateIndex": 4,
|
|
|
|
"Datacenters": null,
|
|
|
|
"Description": "Builtin Policy that grants unlimited access",
|
|
|
|
"Hash": "swIQt6up+s0cV4kePfJ2aRdKCLaQyykF4Hl1Nfdeumk=",
|
|
|
|
"ID": "00000000-0000-0000-0000-000000000001",
|
|
|
|
"ModifyIndex": 4,
|
|
|
|
"Name": "global-management"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"CreateIndex": 14,
|
|
|
|
"Datacenters": ["dc1"],
|
|
|
|
"Description": "Grants read access to all node information",
|
|
|
|
"Hash": "OtZUUKhInTLEqTPfNSSOYbRiSBKm3c4vI2p6MxZnGWc=",
|
|
|
|
"ID": "e359bd81-baca-903e-7e64-1ccd9fdc78f5",
|
|
|
|
"ModifyIndex": 14,
|
|
|
|
"Name": "node-read"
|
|
|
|
}
|
2018-10-31 22:11:51 +00:00
|
|
|
]
|
|
|
|
```
|
2022-05-10 15:51:11 +00:00
|
|
|
|
2023-10-23 11:41:24 +00:00
|
|
|
## Methods to specify namespace <EnterpriseAlert inline />
|
2022-05-10 15:51:11 +00:00
|
|
|
|
|
|
|
ACL policy endpoints
|
|
|
|
support several methods for specifying the namespace of the ACL policy resources
|
|
|
|
with the following order of precedence:
|
|
|
|
1. `Namespace` field of the JSON request body -
|
|
|
|
only applies to [create](#create-a-policy) and [update](#update-a-policy) endpoints
|
|
|
|
1. `ns` query parameter
|
|
|
|
1. `X-Consul-Namespace` request header
|
|
|
|
1. Namespace is inherited from the namespace of the request's ACL token (if any)
|
|
|
|
1. The `default` namespace
|