2019-05-01 21:11:23 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: ACL Role Update'
|
2019-05-01 21:11:23 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul ACL Role Update
|
|
|
|
|
|
|
|
Command: `consul acl role update`
|
|
|
|
|
2022-01-11 13:26:58 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/acl/role/:id](/api-docs/acl/roles#update-a-role)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
The `acl role update` command is used to update a role. The default operations is to merge the
|
|
|
|
current role with those values provided to the command invocation. Therefore to
|
|
|
|
update just one field, only the `-id` or `-name` options and the option to
|
|
|
|
modify must be provided. Note that renaming roles requires both the `-id` and
|
|
|
|
`-name` as the new name cannot yet be used to lookup the role.
|
|
|
|
|
2022-01-10 21:44:56 +00:00
|
|
|
The table below shows this command's [required ACLs](/api#authentication). Configuration of
|
2022-03-30 21:16:26 +00:00
|
|
|
[blocking queries](/api-docs/features/blocking) and [agent caching](/api-docs/features/caching)
|
2022-01-10 21:44:56 +00:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ------------ |
|
|
|
|
| `acl:write` |
|
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul acl role update [options] [args]`
|
|
|
|
|
|
|
|
#### Command Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-description=<string>` - A description of the role.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-id=<string>` - The ID of the role to update. It may be specified as a
|
2019-05-01 21:11:23 +00:00
|
|
|
unique ID prefix but will error if the prefix matches multiple role IDs
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-meta` - Indicates that role metadata such as the content hash and raft
|
2019-05-01 21:11:23 +00:00
|
|
|
indices should be shown for each entry
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-name=<string>` - The role name.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-09-15 02:02:43 +00:00
|
|
|
- `-node-identity=<value>` - Name of a node identity to use for this role. May
|
|
|
|
be specified multiple times. Format is `NODENAME:DATACENTER`. Added in Consul
|
|
|
|
1.8.1.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-no-merge` - Do not merge the current role information with what is provided
|
2019-05-01 21:11:23 +00:00
|
|
|
to the command. Instead overwrite all fields with the exception of the role
|
|
|
|
ID which is immutable.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-policy-id=<value>` - ID of a policy to use for this role. May be specified
|
2019-05-01 21:11:23 +00:00
|
|
|
multiple times
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-policy-name=<value>` - Name of a policy to use for this role. May be
|
2019-05-01 21:11:23 +00:00
|
|
|
specified multiple times
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-service-identity=<value>` - Name of a service identity to use for this
|
2019-05-01 21:11:23 +00:00
|
|
|
role. May be specified multiple times. Format is the `SERVICENAME` or
|
|
|
|
`SERVICENAME:DATACENTER1,DATACENTER2,...`
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-format={pretty|json}` - Command output format. The default value is `pretty`.
|
2020-03-26 16:03:22 +00:00
|
|
|
|
2019-12-06 16:14:56 +00:00
|
|
|
#### Enterprise Options
|
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
@include 'http_api_partition_options.mdx'
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_namespace_options.mdx'
|
2019-12-06 16:14:56 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
#### API Options
|
|
|
|
|
|
|
|
@include 'http_api_options_client.mdx'
|
|
|
|
|
|
|
|
@include 'http_api_options_server.mdx'
|
2021-12-15 01:55:21 +00:00
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Update a role:
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2019-05-01 21:11:23 +00:00
|
|
|
$ consul acl role update -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 \
|
|
|
|
-description 'web crawler updated role' -service-identity 'crawler'
|
|
|
|
Role updated successfully
|
|
|
|
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
|
|
|
Name: crawler
|
|
|
|
Description: web crawler updated role
|
|
|
|
Policies:
|
|
|
|
2f8f99c7-edd9-2f09-7e4b-a1f519eb4fc2 - crawler-kv
|
|
|
|
Service Identities:
|
|
|
|
crawler (Datacenters: all)
|
|
|
|
```
|
|
|
|
|
|
|
|
Rename a role by prefix:
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2019-05-01 21:11:23 +00:00
|
|
|
$ consul acl role update -id 57147 -name web-crawler
|
|
|
|
Role updated successfully
|
|
|
|
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
|
|
|
Name: web-crawler
|
|
|
|
Description: web crawler updated role
|
|
|
|
Policies:
|
|
|
|
2f8f99c7-edd9-2f09-7e4b-a1f519eb4fc2 - crawler-kv
|
|
|
|
Service Identities:
|
|
|
|
crawler (Datacenters: all)
|
|
|
|
```
|