mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-25 12:41:10 +01:00
Change 'rules' parameter for Policies requests (#3947)
With Vault Version: 0.9.1, the following is returned when using "rules" for policies operation: ```The following warnings were returned from the Vault server: * 'rules' is deprecated, please use 'policy' instead```
This commit is contained in:
parent
1bad693a01
commit
e47c7e866a
@ -472,7 +472,7 @@ Policies may be created (uploaded) via the CLI or via the API. To create a new
|
|||||||
policy in Vault:
|
policy in Vault:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ vault write sys/policy/my-policy rules=@my-policy.hcl
|
$ vault write sys/policy/my-policy policy=@my-policy.hcl
|
||||||
```
|
```
|
||||||
|
|
||||||
-> The `@` tells Vault to read from a file on disk. In the example above, Vault
|
-> The `@` tells Vault to read from a file on disk. In the example above, Vault
|
||||||
@ -485,7 +485,7 @@ or via the API:
|
|||||||
$ curl \
|
$ curl \
|
||||||
--request POST \
|
--request POST \
|
||||||
--header "X-Vault-Token: ..." \
|
--header "X-Vault-Token: ..." \
|
||||||
--data '{"rules":"path \"...\" {...} "}' \
|
--data '{"policy":"path \"...\" {...} "}' \
|
||||||
https://vault.hashicorp.rocks/v1/sys/policy/my-policy
|
https://vault.hashicorp.rocks/v1/sys/policy/my-policy
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ API. To update an existing policy in Vault, follow the same steps as creating a
|
|||||||
policy, but use an existing policy name:
|
policy, but use an existing policy name:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ vault write sys/policy/my-existing-policy rules=@updated-policy.json
|
$ vault write sys/policy/my-existing-policy policy=@updated-policy.json
|
||||||
```
|
```
|
||||||
|
|
||||||
or via the API:
|
or via the API:
|
||||||
@ -509,7 +509,7 @@ or via the API:
|
|||||||
$ curl \
|
$ curl \
|
||||||
--request POST \
|
--request POST \
|
||||||
--header "X-Vault-Token: ..." \
|
--header "X-Vault-Token: ..." \
|
||||||
--data '{"rules":"path \"...\" {...} "}' \
|
--data '{"policy":"path \"...\" {...} "}' \
|
||||||
https://vault.hashicorp.rocks/v1/sys/policy/my-existing-policy
|
https://vault.hashicorp.rocks/v1/sys/policy/my-existing-policy
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user