summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2020-04-28 10:47:18 +0100
committerStephen Finucane <sfinucan@redhat.com>2020-04-28 10:47:18 +0100
commit0625035e9fb2e2844e33ce6e3dc8c097f3e3d667 (patch)
tree9dd8ccb16d9c870a4e7701ee05ce639d3ade825e /doc
parent8495a6a3fa614563a431f7b33bba2237fad889c4 (diff)
downloadoslo-policy-0625035e9fb2e2844e33ce6e3dc8c097f3e3d667.tar.gz
docs: Add description of 'oslopolicy-policy-generator'
Change-Id: I6c98efa7463fc71176f9635f6ffebb5c7050bd49 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/source/cli/index.rst41
1 files changed, 39 insertions, 2 deletions
diff --git a/doc/source/cli/index.rst b/doc/source/cli/index.rst
index 87f9fcf..c7023de 100644
--- a/doc/source/cli/index.rst
+++ b/doc/source/cli/index.rst
@@ -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: