Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
X
xivo-solutions-doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xivo.solutions
xivo-solutions-doc
Commits
125b235c
Commit
125b235c
authored
Jul 20, 2016
by
Pascal Cadotte Michaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confgend: add driver implementation details
parent
6d1d3fd1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
0 deletions
+86
-0
source/system/system.rst
source/system/system.rst
+1
-0
source/system/xivo-confgend/developer.rst
source/system/xivo-confgend/developer.rst
+72
-0
source/system/xivo-confgend/xivo-confgend.rst
source/system/xivo-confgend/xivo-confgend.rst
+13
-0
No files found.
source/system/system.rst
View file @
125b235c
...
...
@@ -19,6 +19,7 @@ System
service_authentication/service_authentication
xivo-auth <xivo-auth/xivo-auth>
xivo-confd <xivo-confd/xivo-confd>
xivo-confgend <xivo-confgend/xivo-confgend>
xivo-dird <xivo-dird/xivo-dird>
xivo-dird-phoned <xivo-dird-phoned>
xivo-purge-db <purge_logs>
...
...
source/system/xivo-confgend/developer.rst
0 → 100644
View file @
125b235c
.. _xivo-confgend-developer:
===============================
XiVO confgend developer's guide
===============================
xivo-confgend uses drivers to implement the logic required to generate
configuration files. It uses `stevedore <http://docs.openstack.org/developer/stevedore/>`_
to do the driver instantiation and discovery.
Plugins in xivo-confgend use setuptools' entry points. That means that
installing a new plugin to xivo-confgend requires an entry point in the plugin's
*setup.py*.
Drivers
-------
Driver plugin are classes that are used to generate the content of a
configuration file.
The implementation of a plugin should have the following properties.
#. It's *__init__* method should take one argument
#. It should have a *generate* method which will return the content of the file
#. A setup.py adding an entry point
The *__init__* method argument is the content of the configuration of
xivo-confgend. This allows the driver implementor to add values to the
configuration in */etc/xivo-confgend/conf.d/*.yml* and these values will be
available in the driver.
The generate method has no argument, the configuration provided to the
*__init__* should sufficent for most cases. The call to generate is within a
*scoped_session* of xivo-dao, allowing the usage of xivo-dao without prior setup
in the driver.
The namespaces used for entry points in xivo-confgend have the following form:
confgend.<resource>.<filename>
as an example, a generator for sip.conf would have the following namespace:
confgend.asterisk.sip.conf
Here is a typical setup.py:
.. code-block:: python
:linenos:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from setuptools import find_packages
setup(
name='XiVO confgend driversample',
version='0.0.1',
description='An example driver',
packages=find_packages(),
entry_points={
'confgend.asterisk.sip.conf': [
'my_driver = src.driver:MyDriver',
],
}
)
source/system/xivo-confgend/xivo-confgend.rst
0 → 100644
View file @
125b235c
.. _xivo-confgend:
=============
XiVO confgend
=============
xivo-confgend is a configuration file generator. It is mainly used to generate
the Asterisk configuration files.
.. toctree::
:maxdepth: 1
developer
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment