open-vault/website/source/docs/http/sys-policy.html.md

1.2 KiB

layout page_title sidebar_current description
http HTTP API: /sys/policy docs-http-auth-policy The `/sys/policy` endpoint is used to manage ACL policies in Vault.

/sys/policy

GET

Description
Lists all the available policies.
<dt>Method</dt>
<dd>GET</dd>

<dt>Parameters</dt>
<dd>
	None
</dd>

<dt>Returns</dt>
<dd>
{
	"policies": ["root", "deploy"]
}
</dd>

PUT

Description
Add or update a policy. Once a policy is updated, it takes effect immediately to all associated users.
<dt>Method</dt>
<dd>PUT</dd>

<dt>URL</dt>
<dd>`/sys/policy/<name>`</dd>

<dt>Parameters</dt>
<dd>
	<ul>
		<li>
			<span class="param">rules</span>
			<span class="param-flags">required</span>
			The policy document.
		</li>
	</ul>
</dd>

<dt>Returns</dt>
<dd>`204` respons code.
</dd>

DELETE

Description
Delete the policy with the given name. This will immediately affect all associated users.
<dt>Method</dt>
<dd>DELETE</dd>

<dt>URL</dt>
<dd>`/sys/policy/<name>`</dd>

<dt>Parameters</dt>
<dd>None
</dd>

<dt>Returns</dt>
<dd>`204` respons code.
</dd>