From 9b10ec5537630fb38f8ece6de146e1b884b58ddf Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 5 Sep 2012 11:29:42 -0400 Subject: improving plugin development docs --- src/lib/Bcfg2/Server/Plugin.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugin.py') diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py index c6476eb90..80537c200 100644 --- a/src/lib/Bcfg2/Server/Plugin.py +++ b/src/lib/Bcfg2/Server/Plugin.py @@ -168,9 +168,12 @@ class PluginDatabaseModel(object): class Generator(object): - """Generator plugins contribute to literal client configurations.""" + """Generator plugins contribute to literal client + configurations.""" + def HandlesEntry(self, entry, metadata): - """This is the slow path method for routing configuration binding requests.""" + """This is the slow path method for routing configuration + binding requests.""" return False def HandleEntry(self, entry, metadata): @@ -187,20 +190,21 @@ class Structure(object): class Metadata(object): """Signal metadata capabilities for this plugin""" - def add_client(self, client_name): - """Add client.""" - pass + def viz(self, hosts, bundles, key, only_client, colors): + """Create viz str for viz admin mode.""" + return '' - def remove_client(self, client_name): - """Remove client.""" + def set_version(self, client, version): pass - def viz(self, hosts, bundles, key, colors): - """Create viz str for viz admin mode.""" + def set_profile(self, client, profile, address): pass - def _handle_default_event(self, event): - pass + def resolve_client(self, address, cleanup_cache=False): + return address[1] + + def AuthenticateConnection(self, cert, user, password, address): + raise NotImplementedError def get_initial_metadata(self, client_name): raise NotImplementedError @@ -225,13 +229,13 @@ class Connector(object): class Probing(object): """Signal probe capability for this plugin.""" - def GetProbes(self, _): + def GetProbes(self, metadata): """Return a set of probes for execution on client.""" - return [] + raise NotImplementedError - def ReceiveData(self, _, dummy): + def ReceiveData(self, metadata, datalist): """Receive probe results pertaining to client.""" - pass + raise NotImplementedError class Statistics(Plugin): -- cgit v1.2.3-1-g7c22