doc: Add policy reference

Partially Implements: blueprint neutron-policy-in-code

Change-Id: Iad80250e52e2347b0f6844ebaeb5a51cd314daf0
This commit is contained in:
Akihiro Motoki 2019-01-17 23:59:49 +09:00
parent 19aed83ff1
commit a3a5470538
6 changed files with 63 additions and 17 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ covhtml/
dist/
doc/build
doc/source/_static/config_samples/*.sample
doc/source/_static/*.policy.yaml.sample
etc/*.sample
*.DS_Store
*.pyc

View File

@ -25,6 +25,8 @@ extensions = [
'openstackdocstheme',
'oslo_config.sphinxext',
'oslo_config.sphinxconfiggen',
'oslo_policy.sphinxext',
'oslo_policy.sphinxpolicygen',
]
# openstackdocstheme options
@ -101,3 +103,8 @@ config_generator_config_file = [
_get_config_generator_config_definition(conf)
for conf in _config_generator_config_files
]
# -- Options for oslo_policy.sphinxpolicygen ---------------------------------
policy_generator_config_file = '../../etc/oslo-policy-generator/policy.conf'
sample_policy_basename = '_static/neutron-dynamic-routing'

View File

@ -1,24 +1,20 @@
=====================
Configuration Options
=====================
===================
Configuration Guide
===================
Configuration
-------------
This section provides a list of all possible options for each
configuration file.
Configuration Reference
-----------------------
neutron-dynamic-routing uses the following configuration files for its
various services.
.. toctree::
:glob:
:maxdepth: 1
*
Sample Configuration Files
--------------------------
bgp_dragent
The following are sample configuration files for neutron-dynamic-routing.
These are generated from code and reflect the current state of code
@ -29,3 +25,15 @@ in the neutron-dynamic-routing repository.
:maxdepth: 1
samples/*
Policy
------
neutron-dynamic-routing, like most OpenStack projects, uses a policy language
to restrict permissions on REST API actions.
.. toctree::
:maxdepth: 1
Policy Reference <policy>
Sample Policy File <policy-sample>

View File

@ -0,0 +1,17 @@
==========================================
Sample neutron-dynamic-routing Policy File
==========================================
The following is a sample neutron-dynamic-routing policy file for adaptation
and use.
The sample policy can also be viewed in :download:`file form
</_static/neutron-dynamic-routing.policy.yaml.sample>`.
.. important::
The sample policy file is auto-generated from neutron-dynamic-routing when
this documentation is built. You must ensure your version of
neutron-dynamic-routing matches the version of this documentation.
.. literalinclude:: /_static/neutron-dynamic-routing.policy.yaml.sample

View File

@ -0,0 +1,10 @@
================================
neutron-dynamic-routing policies
================================
The following is an overview of all available policies in
neutron-dynamic-routing. For a sample configuration file,
refer to :doc:`/configuration/policy-sample`.
.. show-policy::
:config-file: etc/oslo-policy-generator/policy.conf

View File

@ -1,9 +1,12 @@
To generate the sample neutron-dynamic-routing configuration files, run the
following command from the top level of the neutron-dynamic-routing directory:
To generate the sample neutron-dynamic-routing configuration files and the
sample policy file, run the following commands respectively from the top level
of the neutron-dynamic-routing directory:
tox -e genconfig
tox -e genconfig
tox -e genpolicy
If a 'tox' environment is unavailable, then you can run the following script
instead to generate the configuration files:
If a 'tox' environment is unavailable, then you can run the following commands
instead to generate the configuration files and the policy file:
./tools/generate_config_file_samples.sh
./tools/generate_config_file_samples.sh
oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf