Browse Source
1. Added new config options for vnf packages. 2. This will generate a new sample config each time build sphinx is run. This is then used on a new docs page where you can either view the file in its entirety, or download the file. Partial-Implements: blueprint tosca-csar-mgmt-driver Co-Author: Bhagyashri Shewale <bhagyashri.shewale@nttdata.com> Co-Author: Neha Alhat <neha.alhat@nttdata.com> Change-Id: I900af00af7f939e6069411104caa714f396dc509changes/99/675599/13
14 changed files with 275 additions and 1833 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
============= |
||||
api-paste.ini |
||||
============= |
||||
|
||||
The Tacker service stores its API configuration settings in the |
||||
``api-paste.ini`` file. |
||||
|
||||
.. literalinclude:: /../../etc/tacker/api-paste.ini |
@ -0,0 +1,9 @@
|
||||
===================== |
||||
Configuration Options |
||||
===================== |
||||
|
||||
The following is an overview of all available configuration options in Tacker. |
||||
For a sample configuration file, refer to :doc:`/configuration/sample_config`. |
||||
|
||||
.. show-options:: |
||||
:config-file: etc/config-generator.conf |
@ -0,0 +1,18 @@
|
||||
========================= |
||||
Sample Configuration File |
||||
========================= |
||||
|
||||
The following is a sample tacker configuration for adaptation and use. For a |
||||
detailed overview of all available configuration options, refer to |
||||
:doc:`/configuration/config`. |
||||
|
||||
The sample configuration can also be viewed in :download:`file form |
||||
</_static/tacker.conf.sample>`. |
||||
|
||||
.. important:: |
||||
|
||||
The sample configuration file is auto-generated from tacker when this |
||||
documentation is built. You must ensure your version of tacker matches the |
||||
version of this documentation. |
||||
|
||||
.. literalinclude:: /_static/tacker.conf.sample |
@ -0,0 +1,25 @@
|
||||
# Copyright (C) 2019 NTT DATA |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
from oslo_config import cfg |
||||
|
||||
from tacker.conf import conductor |
||||
from tacker.conf import vnf_package |
||||
|
||||
|
||||
CONF = cfg.CONF |
||||
|
||||
vnf_package.register_opts(CONF) |
||||
conductor.register_opts(CONF) |
@ -0,0 +1,34 @@
|
||||
# Copyright (C) 2019 NTT DATA |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
from oslo_config import cfg |
||||
|
||||
|
||||
CONF = cfg.CONF |
||||
|
||||
interval_opts = [ |
||||
cfg.IntOpt('vnf_package_delete_interval', |
||||
default=1800, |
||||
help=_('Seconds between running periodic tasks ' |
||||
'to cleanup residues of deleted vnf packages')), |
||||
] |
||||
|
||||
|
||||
def register_opts(conf): |
||||
conf.register_opts(interval_opts) |
||||
|
||||
|
||||
def list_opts(): |
||||
return {'DEFAULT': interval_opts} |
@ -0,0 +1,83 @@
|
||||
# Copyright 2015 OpenStack Foundation |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
# TODO(nirajsingh): Most of the config options are scattered all through |
||||
# out the code. In future, move all these config options in new modules |
||||
# under conf/ folder. |
||||
|
||||
""" |
||||
This is the single point of entry to generate the sample configuration |
||||
file for tacker. It collects all the necessary info from the other modules |
||||
in this package. It is assumed that: |
||||
|
||||
* every other module in this package has a 'list_opts' function which |
||||
return a dict where |
||||
* the keys are strings which are the group names |
||||
* the value of each key is a list of config options for that group |
||||
* the tacker.conf package doesn't have further packages with config options |
||||
* this module is only used in the context of sample file generation |
||||
""" |
||||
|
||||
import collections |
||||
import os |
||||
from oslo_utils import importutils |
||||
import pkgutil |
||||
|
||||
LIST_OPTS_FUNC_NAME = "list_opts" |
||||
|
||||
|
||||
def _tupleize(dct): |
||||
"""Take the dict of options and convert to the 2-tuple format.""" |
||||
return [(key, val) for key, val in dct.items()] |
||||
|
||||
|
||||
def list_opts(): |
||||
opts = collections.defaultdict(list) |
||||
module_names = _list_module_names() |
||||
imported_modules = _import_modules(module_names) |
||||
_append_config_options(imported_modules, opts) |
||||
return _tupleize(opts) |
||||
|
||||
|
||||
def _list_module_names(): |
||||
module_names = [] |
||||
package_path = os.path.dirname(os.path.abspath(__file__)) |
||||
for _, modname, ispkg in pkgutil.iter_modules(path=[package_path]): |
||||
if modname == "opts" or ispkg: |
||||
continue |
||||
else: |
||||
module_names.append(modname) |
||||
return module_names |
||||
|
||||
|
||||
def _import_modules(module_names): |
||||
imported_modules = [] |
||||
for modname in module_names: |
||||
mod = importutils.import_module("tacker.conf." + modname) |
||||
if not hasattr(mod, LIST_OPTS_FUNC_NAME): |
||||
msg = "The module 'tacker.conf.%s' should have a '%s' "\ |
||||
"function which returns the config options." % \ |
||||
(modname, LIST_OPTS_FUNC_NAME) |
||||
raise Exception(msg) |
||||
else: |
||||
imported_modules.append(mod) |
||||
return imported_modules |
||||
|
||||
|
||||
def _append_config_options(imported_modules, config_options): |
||||
for mod in imported_modules: |
||||
configs = mod.list_opts() |
||||
for key, val in configs.items(): |
||||
config_options[key].extend(val) |
@ -0,0 +1,74 @@
|
||||
# Copyright (C) 2019 NTT DATA |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
from oslo_config import cfg |
||||
|
||||
|
||||
CONF = cfg.CONF |
||||
|
||||
OPTS = [ |
||||
cfg.StrOpt('vnf_package_csar_path', |
||||
default='/var/lib/tacker/vnfpackages/', |
||||
help="Path to store extracted CSAR file"), |
||||
|
||||
cfg.FloatOpt('csar_file_size_cap', default=1024, min=0.000001, |
||||
max=9223372036, |
||||
help=_(""" |
||||
Maximum size of CSAR file a user can upload in GB. |
||||
|
||||
An CSAR file upload greater than the size mentioned here would result |
||||
in an CSAR upload failure. This configuration option defaults to |
||||
1024 GB (1 TiB). |
||||
|
||||
NOTES: |
||||
* This value should only be increased after careful |
||||
consideration and must be set less than or equal to |
||||
8 EiB (~9223372036). |
||||
* This value must be set with careful consideration of the |
||||
backend storage capacity. Setting this to a very low value |
||||
may result in a large number of image failures. And, setting |
||||
this to a very large value may result in faster consumption |
||||
of storage. Hence, this must be set according to the nature of |
||||
images created and storage capacity available. |
||||
|
||||
Possible values: |
||||
* Any positive number less than or equal to 9223372036854775808 |
||||
""")), |
||||
cfg.StrOpt('hashing_algorithm', |
||||
default='sha512', |
||||
help=_(""" |
||||
Secure hashing algorithm used for computing the 'hash' property. |
||||
|
||||
Possible values: |
||||
* sha256, sha512 |
||||
|
||||
Related options: |
||||
* None |
||||
"""))] |
||||
|
||||
vnf_package_group = cfg.OptGroup('vnf_package', |
||||
title='vnf_package options', |
||||
help=""" |
||||
Options under this group are used to store vnf packages in glance store. |
||||
""") |
||||
|
||||
|
||||
def register_opts(conf): |
||||
conf.register_group(vnf_package_group) |
||||
conf.register_opts(OPTS, group=vnf_package_group) |
||||
|
||||
|
||||
def list_opts(): |
||||
return {vnf_package_group: OPTS} |
Loading…
Reference in new issue