docs: Add description of 'oslopolicy-policy-generator'

Change-Id: I6c98efa7463fc71176f9635f6ffebb5c7050bd49
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2020-04-28 10:47:18 +01:00
parent 8495a6a3fa
commit 0625035e9f
1 changed files with 39 additions and 2 deletions

View File

@ -51,6 +51,44 @@ with the plain member token
--access sample_data/auth_v3_token_member.json \
--rule compute_extension:flavorextraspecs:index
oslopolicy-policy-generator
===========================
The ``oslopolicy-policy-generator`` command can be used to generate a policy
file that shows the effective policy in use. This is generated by merging the
registered defaults and policies loaded from a configuration file.
Examples
--------
The generate the effective policy file for a namespace called ``keystone``:
.. code-block:: bash
oslopolicy-policy-generator --namespace keystone
To generate the effective policy file in JSON:
.. code-block:: bash
oslopolicy-policy-generator --namespace keystone --format json
To generate the effective policy file and output directly to a file:
.. code-block:: bash
oslopolicy-policy-generator \
--namespace keystone \
--format yaml \
--output-file keystone-policy.yaml
To show the additional options and arguments supported by
``oslopolicy-policy-generator``:
.. code-block:: bash
oslopolicy-policy-generator --help
oslopolicy-sample-generator
===========================
@ -67,12 +105,11 @@ To generate sample policies for a namespace called ``keystone``:
oslopolicy-sample-generator --namespace keystone
To generate sample policies in JSON use:
.. code-block:: bash
oslopolicy-sample-generator --namespace nova --format json
oslopolicy-sample-generator --namespace keystone --format json
To generate a sample policy file and output directly to a file: