blob: 89b1af28a6846075fa220825120d0bbff24c8634 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
.. -*- mode: rst -*-
.. _unsorted-development_writing_plugins:
===============
Writing Plugins
===============
Server Plugin Types
===================
Generator
---------
Generator plugins contribute to literal client configurations
Structure
---------
Structure Plugins contribute to abstract client configurations
Metadata
--------
Signal metadata capabilities
Connector
---------
Connector Plugins augment client metadata instances
Probing
-------
Signal probe capability
Statistics
----------
Signal statistics handling capability
Decision
--------
Signal decision handling capability
Version
-------
Interact with various version control systems
Writing Server Plugins
======================
Metadata
--------
If you would like to define your own Metadata plugin (to extend/change functionality of the existing Metadata plugin), here are the steps to do so. We will call our new plugin `MyMetadata`.
#. Add MyMetadata.py
.. code-block:: python
__revision__ = '$Revision$'
import Bcfg2.Server.Plugins.Metadata
class MyMetadata(Bcfg2.Server.Plugins.Metadata.Metadata):
'''This class contains data for bcfg2 server metadata'''
__version__ = '$Id$'
__author__ = 'bcfg-dev@mcs.anl.gov'
def __init__(self, core, datastore, watch_clients=True):
Bcfg2.Server.Plugins.Metadata.Metadata.__init__(self, core, datastore, watch_clients)
#. Add MyMetadata to `src/lib/Server/Plugins/__init__.py`
#. Replace Metadata with MyMetadata in the plugins line of bcfg2.conf
|