Add sample policy file to documentation

Change-Id: I20315881394c7a05fe6cd84bc29a8182b78788f0
Partial-Implements: blueprint policy-and-docs-in-code
This commit is contained in:
chenying 2017-10-12 15:15:25 +08:00
parent 18b59514dc
commit 0db9e5b225
4 changed files with 42 additions and 0 deletions

View File

@ -26,6 +26,8 @@ extensions = [
'reno.sphinxext',
'oslo_config.sphinxext',
'oslo_config.sphinxconfiggen',
'oslo_policy.sphinxext',
'oslo_policy.sphinxpolicygen',
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -48,6 +50,9 @@ config_generator_config_file = [
'_static/karbor'),
]
policy_generator_config_file = '../../etc/karbor-policy-generator.conf'
sample_policy_basename = '_static/karbor'
# The suffix of source filenames.
source_suffix = '.rst'

View File

@ -0,0 +1,14 @@
.. _karbor-policy-generator.conf:
====================
Policy configuration
====================
Configuration
~~~~~~~~~~~~~
The following is an overview of all available policies in Karbor. For a sample
configuration file.
.. show-policy::
:config-file: ../../etc/karbor-policy-generator.conf

View File

@ -54,6 +54,14 @@ Release Notes
releasenotes
Sample Files
============
.. toctree::
:maxdepth: 1
sample_policy
Indices and tables
==================

View File

@ -0,0 +1,15 @@
====================
Karbor Sample Policy
====================
The following is a sample Karbor policy file that has been auto-generated
from default policy values in code. If you're using the default policies, then
the maintenance of this file is not necessary, and it should not be copied into
a deployment. Doing so will result in duplicate policy definitions. It is here
to help explain which policy operations protect specific Karbor APIs, but it
is not suggested to copy and paste into a deployment unless you're planning on
providing a different policy for an operation that is not the default.
The sample policy file can also be viewed in `file form <_static/karbor.policy.yaml.sample>`_.
.. literalinclude:: _static/karbor.policy.yaml.sample