Browse Source

doc: Add policy reference

Partially Implements: blueprint neutron-policy-in-code

Change-Id: Iaf95ea426294a72022e7d0dc58f40fd9f425894b
Akihiro Motoki 1 month ago
parent
commit
2fdf39545b

+ 1
- 0
.gitignore View File

@@ -48,6 +48,7 @@ output/*/index.html
48 48
 # Documentation
49 49
 doc/build
50 50
 doc/source/_static/config-samples/*.sample
51
+doc/source/_static/*.policy.yaml.sample
51 52
 etc/**/*.sample
52 53
 
53 54
 # pbr generates these

+ 7
- 0
doc/source/conf.py View File

@@ -27,6 +27,8 @@ extensions = [
27 27
     'openstackdocstheme',
28 28
     'oslo_config.sphinxext',
29 29
     'oslo_config.sphinxconfiggen',
30
+    'oslo_policy.sphinxext',
31
+    'oslo_policy.sphinxpolicygen',
30 32
 ]
31 33
 
32 34
 # openstackdocstheme options
@@ -109,3 +111,8 @@ config_generator_config_file = [
109 111
     _get_config_generator_config_definition(conf_file)
110 112
     for conf_file in _config_generator_config_files
111 113
 ]
114
+
115
+# -- Options for oslo_policy.sphinxpolicygen ---------------------------------
116
+
117
+policy_generator_config_file = '../../etc/oslo-policy-generator/policy.conf'
118
+sample_policy_basename = '_static/networking-bgpvpn'

+ 21
- 16
doc/source/configuration/index.rst View File

@@ -1,31 +1,36 @@
1
-=====================
2
-Configuration Options
3
-=====================
1
+===================
2
+Configuration Guide
3
+===================
4
+
5
+Configuration
6
+-------------
4 7
 
5 8
 This section provides a list of all possible options for each
6 9
 configuration file.
7
-These are generated from code and reflect the current state of code
8
-in the networking-bgpvpn repository.
10
+networking-bgpvpn uses the following configuration file.
11
+
12
+.. toctree::
13
+   :maxdepth: 1
9 14
 
10
-Configuration Reference
11
------------------------
15
+   networking-bgpvpn
12 16
 
13
-networking-bgpvpn uses the following configuration files for its
14
-various services.
17
+The following is a sample configuration file for networking-bgpvpn.
18
+It is generated from code and reflect the current state of code
19
+in the networking-bgpvpn repository.
15 20
 
16 21
 .. toctree::
17
-   :glob:
18 22
    :maxdepth: 1
19 23
 
20
-   *
24
+   samples/networking-bgpvpn
21 25
 
22
-Sample Configuration Files
23
---------------------------
26
+Policy
27
+------
24 28
 
25
-The following are sample configuration files for all networking-bgpvpn.
29
+networking-bgpvpn, like most OpenStack projects, uses a policy language to
30
+restrict permissions on REST API actions.
26 31
 
27 32
 .. toctree::
28
-   :glob:
29 33
    :maxdepth: 1
30 34
 
31
-   samples/*
35
+   Policy Reference <policy>
36
+   Sample Policy File <policy-sample>

+ 16
- 0
doc/source/configuration/policy-sample.rst View File

@@ -0,0 +1,16 @@
1
+====================================
2
+Sample networking-bgpvpn Policy File
3
+====================================
4
+
5
+The following is a sample networking-bgpvpn policy file for adaptation and use.
6
+
7
+The sample policy can also be viewed in :download:`file form
8
+</_static/networking-bgpvpn.policy.yaml.sample>`.
9
+
10
+.. important::
11
+
12
+   The sample policy file is auto-generated from networking-bgpvpn when this
13
+   documentation is built. You must ensure your version of networking-bgpvpn
14
+   matches the version of this documentation.
15
+
16
+.. literalinclude:: /_static/networking-bgpvpn.policy.yaml.sample

+ 9
- 0
doc/source/configuration/policy.rst View File

@@ -0,0 +1,9 @@
1
+==========================
2
+networking-bgpvpn policies
3
+==========================
4
+
5
+The following is an overview of all available policies in networking-bgpvpn.
6
+For a sample configuration file, refer to :doc:`/configuration/policy-sample`.
7
+
8
+.. show-policy::
9
+      :config-file: etc/oslo-policy-generator/policy.conf

+ 13
- 0
etc/README.txt View File

@@ -0,0 +1,13 @@
1
+To generate the sample networking-bgpvpn configuration files and
2
+the sample policy file, run the following commands respectively
3
+from the top level of the networking-bgpvpn directory:
4
+
5
+  tox -e genconfig
6
+  tox -e genpolicy
7
+
8
+If a 'tox' environment is unavailable, then you can run
9
+the following commands respectively
10
+instead to generate the configuration files:
11
+
12
+  oslo-config-generator --config-file etc/oslo-config-generator/networking-bgpvpn.conf
13
+  oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf

Loading…
Cancel
Save