<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Server Core Development — Bcfg2 1.3.0 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="top" title="Bcfg2 1.3.0 documentation" href="../index.html" /> <link rel="up" title="Bcfg2 Development" href="index.html" /> <link rel="next" title="Documentation" href="documentation.html" /> <link rel="prev" title="Python Compatibility" href="compat.html" /> <link rel="stylesheet" href="../_static/bcfg2.css" type=""/> </head> <body> <div style="text-align: left; padding: 10px 10px 15px 15px"> <a href="../index.html"><img src="../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="documentation.html" title="Documentation" accesskey="N">next</a> |</li> <li class="right" > <a href="compat.html" title="Python Compatibility" accesskey="P">previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" accesskey="U">Bcfg2 Development</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="server-core-development"> <span id="development-core"></span><h1>Server Core Development<a class="headerlink" href="#server-core-development" title="Permalink to this headline">¶</a></h1> <p class="versionadded"> <span class="versionmodified">New in version 1.3.0.</span></p> <p>Bcfg2 1.3 added a pluggable server core system so that the server core itself can be easily swapped out to use different technologies. It currently ships with two backends: a builtin core written from scratch using the various server tools in the Python standard library; and an experimental <a class="reference external" href="http://www.cherrypy.org/">CherryPy</a> based core. This page documents the server core interface so that other cores can be written to take advantage of other technologies, e.g., <a class="reference external" href="http://www.tornadoweb.org/">Tornado</a> or <a class="reference external" href="http://twistedmatrix.com/trac/">Twisted</a>.</p> <p>A core implementation needs to:</p> <ul class="simple"> <li>Override <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._daemonize" title="Bcfg2.Server.Core.BaseCore._daemonize"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Core.BaseCore._daemonize()</span></tt></a> to handle daemonization, writing the PID file, and dropping privileges.</li> <li>Override <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._run" title="Bcfg2.Server.Core.BaseCore._run"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Core.BaseCore._run()</span></tt></a> to handle server startup.</li> <li>Override <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._block" title="Bcfg2.Server.Core.BaseCore._block"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Core.BaseCore._block()</span></tt></a> to run the blocking server loop.</li> <li>Call <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.shutdown" title="Bcfg2.Server.Core.BaseCore.shutdown"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Core.BaseCore.shutdown()</span></tt></a> on orderly shutdown.</li> </ul> <p>Nearly all XML-RPC handling is delegated entirely to the core implementation. It needs to:</p> <ul class="simple"> <li>Call <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.authenticate" title="Bcfg2.Server.Core.BaseCore.authenticate"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Core.BaseCore.authenticate()</span></tt></a> to authenticate clients.</li> <li>Handle <tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt> exceptions raised by the exposed XML-RPC methods as appropriate.</li> <li>Dispatch XML-RPC method invocations to the appropriate method, including Plugin RMI. The client address pair (a tuple of remote IP address and remote hostname) must be prepended to the argument list passed to built-in methods (i.e., not to plugin RMI).</li> </ul> <p>Additionally, running and configuring the server is delegated to the core. It needs to honor the configuration options that influence how and where the server runs, including the server location (host and port), listening interfaces, and SSL certificate and key.</p> <div class="section" id="module-Bcfg2.Server.Core"> <span id="base-core"></span><h2>Base Core<a class="headerlink" href="#module-Bcfg2.Server.Core" title="Permalink to this headline">¶</a></h2> <p>Bcfg2.Server.Core provides the base core object that server core implementations inherit from.</p> <dl class="class"> <dt id="Bcfg2.Server.Core.BaseCore"> <em class="property">class </em><tt class="descclassname">Bcfg2.Server.Core.</tt><tt class="descname">BaseCore</tt><big>(</big><em>setup</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p> <p>The server core is the container for all Bcfg2 server logic and modules. All core implementations must inherit from <tt class="docutils literal"><span class="pre">BaseCore</span></tt>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>setup</strong> (<em>Bcfg2.Options.OptionParser</em>) – A Bcfg2 options dict</td> </tr> </tbody> </table> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore._daemonize"> <tt class="descname">_daemonize</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore._daemonize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore._daemonize" title="Permalink to this definition">¶</a></dt> <dd><p>Daemonize the server and write the pidfile. This must be overridden by a core implementation.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore._run"> <tt class="descname">_run</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore._run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore._run" title="Permalink to this definition">¶</a></dt> <dd><p>Start up the server; this method should return immediately. This must be overridden by a core implementation.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore._block"> <tt class="descname">_block</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore._block"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore._block" title="Permalink to this definition">¶</a></dt> <dd><p>Enter the infinite loop. This method should not return until the server is killed. This must be overridden by a core implementation.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore._file_monitor_thread"> <tt class="descname">_file_monitor_thread</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore._file_monitor_thread"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore._file_monitor_thread" title="Permalink to this definition">¶</a></dt> <dd><p>The thread that runs the <a class="reference internal" href="fam.html#Bcfg2.Server.FileMonitor.FileMonitor" title="Bcfg2.Server.FileMonitor.FileMonitor"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.FileMonitor.FileMonitor</span></tt></a>. This also queries <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Version" title="Bcfg2.Server.Plugin.interfaces.Version"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Version</span></tt></a> plugins for the current revision of the Bcfg2 repo.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.AssertProfile"> <tt class="descname">AssertProfile</tt><big>(</big><em>address</em>, <em>profile</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.AssertProfile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.AssertProfile" title="Permalink to this definition">¶</a></dt> <dd><p>Set profile for a client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - True on success</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.Bind"> <tt class="descname">Bind</tt><big>(</big><em>entry</em>, <em>metadata</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.Bind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.Bind" title="Permalink to this definition">¶</a></dt> <dd><p>Bind a single entry using the appropriate generator.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>entry</strong> (<em>lxml.etree._Element</em>) – The entry to bind. Modified in-place.</li> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to bind structure for</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.BindStructure"> <tt class="descname">BindStructure</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.BindStructure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.BindStructure" title="Permalink to this definition">¶</a></dt> <dd><p>Bind all elements in a single structure (i.e., bundle).</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>structure</strong> – The structure to bind. Modified in-place.</li> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to bind structure for</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.BindStructures"> <tt class="descname">BindStructures</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.BindStructures"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.BindStructures" title="Permalink to this definition">¶</a></dt> <dd><p>Given a list of structures (i.e. bundles), bind all the entries in them and add the structures to the config.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>structures</strong> (<em>list of lxml.etree._Element objects</em>) – The list of structures for this client</li> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to bind structures for</li> <li><strong>config</strong> (<em>lxml.etree._Element</em>) – The configuration document to add fully-bound structures to. Modified in-place.</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.BuildConfiguration"> <tt class="descname">BuildConfiguration</tt><big>(</big><em>client</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.BuildConfiguration"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.BuildConfiguration" title="Permalink to this definition">¶</a></dt> <dd><p>Build the complete configuration for a client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>client</strong> (<em>string</em>) – The hostname of the client to build the configuration for</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><tt class="xref py py-class docutils literal"><span class="pre">lxml.etree._Element</span></tt> - A complete Bcfg2 configuration document</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.DeclareVersion"> <tt class="descname">DeclareVersion</tt><big>(</big><em>address</em>, <em>version</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.DeclareVersion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.DeclareVersion" title="Permalink to this definition">¶</a></dt> <dd><p>Declare the client version.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</li> <li><strong>version</strong> (<em>string</em>) – The client’s declared version</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">bool - True on success</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.GetConfig"> <tt class="descname">GetConfig</tt><big>(</big><em>address</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.GetConfig"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.GetConfig" title="Permalink to this definition">¶</a></dt> <dd><p>Build config for a client by calling <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.BuildConfiguration" title="Bcfg2.Server.Core.BaseCore.BuildConfiguration"><tt class="xref py py-func docutils literal"><span class="pre">BuildConfiguration()</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">lxml.etree._Element - The full configuration document for the client</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.GetDecisionList"> <tt class="descname">GetDecisionList</tt><big>(</big><em>address</em>, <em>mode</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.GetDecisionList"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.GetDecisionList" title="Permalink to this definition">¶</a></dt> <dd><p>Get the decision list for the client with <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.GetDecisions" title="Bcfg2.Server.Core.BaseCore.GetDecisions"><tt class="xref py py-func docutils literal"><span class="pre">GetDecisions()</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of decision tuples</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.GetDecisions"> <tt class="descname">GetDecisions</tt><big>(</big><em>metadata</em>, <em>mode</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.GetDecisions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.GetDecisions" title="Permalink to this definition">¶</a></dt> <dd><p>Get the decision list for a client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to get the decision list for</li> <li><strong>mode</strong> (<em>string</em>) – The decision mode (“whitelist” or “blacklist”)</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">list of Decision tuples <tt class="docutils literal"><span class="pre">(<entry</span> <span class="pre">tag>,</span> <span class="pre"><entry</span> <span class="pre">name>)</span></tt></p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.GetProbes"> <tt class="descname">GetProbes</tt><big>(</big><em>address</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.GetProbes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.GetProbes" title="Permalink to this definition">¶</a></dt> <dd><p>Fetch probes for the client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">lxml.etree._Element - XML tree describing probes for this client</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.GetStructures"> <tt class="descname">GetStructures</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.GetStructures"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.GetStructures" title="Permalink to this definition">¶</a></dt> <dd><p>Get all structures (i.e., bundles) for the given client</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to get structures for</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of <tt class="xref py py-class docutils literal"><span class="pre">lxml.etree._Element</span></tt> objects</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.HandleEvent"> <tt class="descname">HandleEvent</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.HandleEvent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.HandleEvent" title="Permalink to this definition">¶</a></dt> <dd><p>Handle a change in the Bcfg2 config file.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>event</strong> (<a class="reference internal" href="fam.html#Bcfg2.Server.FileMonitor.Event" title="Bcfg2.Server.FileMonitor.Event"><em>Bcfg2.Server.FileMonitor.Event</em></a>) – The event to handle</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.RecvProbeData"> <tt class="descname">RecvProbeData</tt><big>(</big><em>address</em>, <em>probedata</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.RecvProbeData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.RecvProbeData" title="Permalink to this definition">¶</a></dt> <dd><p>Receive probe data from clients.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - True on success</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.RecvStats"> <tt class="descname">RecvStats</tt><big>(</big><em>address</em>, <em>stats</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.RecvStats"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.RecvStats" title="Permalink to this definition">¶</a></dt> <dd><p>Act on statistics upload with <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.process_statistics" title="Bcfg2.Server.Core.BaseCore.process_statistics"><tt class="xref py py-func docutils literal"><span class="pre">process_statistics()</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - True on success</td> </tr> <tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.authenticate"> <tt class="descname">authenticate</tt><big>(</big><em>cert</em>, <em>user</em>, <em>password</em>, <em>address</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.authenticate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.authenticate" title="Permalink to this definition">¶</a></dt> <dd><p>Authenticate a client connection with <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Metadata.AuthenticateConnection" title="Bcfg2.Server.Plugin.interfaces.Metadata.AuthenticateConnection"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Metadata.AuthenticateConnection()</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>cert</strong> (<em>dict</em>) – an x509 certificate</li> <li><strong>user</strong> (<em>string</em>) – The username of the user trying to authenticate</li> <li><strong>password</strong> (<em>string</em>) – The password supplied by the client</li> <li><strong>address</strong> (<em>tuple</em>) – An address pair of <tt class="docutils literal"><span class="pre">(<ip</span> <span class="pre">address>,</span> <span class="pre"><hostname>)</span></tt></li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">bool - True if the authenticate succeeds, False otherwise</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.build_metadata"> <tt class="descname">build_metadata</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.build_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.build_metadata" title="Permalink to this definition">¶</a></dt> <dd><p>Build initial client metadata for a client</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>client_name</strong> (<em>string</em>) – The name of the client to build metadata for</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugins.Metadata.ClientMetadata</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.ca"> <tt class="descname">ca</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.ca" title="Permalink to this definition">¶</a></dt> <dd><p>The CA that signed the server cert</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.cfile"> <tt class="descname">cfile</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.cfile" title="Permalink to this definition">¶</a></dt> <dd><p>Path to bcfg2.conf</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.client_run_hook"> <tt class="descname">client_run_hook</tt><big>(</big><em>hook</em>, <em>metadata</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.client_run_hook"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.client_run_hook" title="Permalink to this definition">¶</a></dt> <dd><p>Invoke hooks from <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.ClientRunHooks" title="Bcfg2.Server.Plugin.interfaces.ClientRunHooks"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.ClientRunHooks</span></tt></a> plugins for a given stage.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>hook</strong> (<em>string</em>) – The name of the stage to run hooks for. A stage can be any abstract function defined in the <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.ClientRunHooks" title="Bcfg2.Server.Plugin.interfaces.ClientRunHooks"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.ClientRunHooks</span></tt></a> interface.</li> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to run the hook for. This will be passed as the sole argument to each hook.</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.connectors"> <tt class="descname">connectors</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.connectors" title="Permalink to this definition">¶</a></dt> <dd><p>The list of plugins that implement the <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Connector" title="Bcfg2.Server.Plugin.interfaces.Connector"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Connector</span></tt></a> interface</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.critical_error"> <tt class="descname">critical_error</tt><big>(</big><em>message</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.critical_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.critical_error" title="Permalink to this definition">¶</a></dt> <dd><p>Log an error with its traceback and return an XML-RPC fault to the client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>message</strong> (<em>string</em>) – The message to log and return to the client</td> </tr> <tr class="field-even field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">xmlrpclib.Fault</span></tt></td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.database_available"> <tt class="descname">database_available</tt><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.database_available"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.database_available" title="Permalink to this definition">¶</a></dt> <dd><p>True if the database is configured and available, False otherwise.</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.datastore"> <tt class="descname">datastore</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.datastore" title="Permalink to this definition">¶</a></dt> <dd><p>The Bcfg2 repository directory</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.db_write_lock"> <tt class="descname">db_write_lock</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.db_write_lock" title="Permalink to this definition">¶</a></dt> <dd><p>RLock to be held on writes to the backend db</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.fam"> <tt class="descname">fam</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.fam" title="Permalink to this definition">¶</a></dt> <dd><p>The <a class="reference internal" href="fam.html#Bcfg2.Server.FileMonitor.FileMonitor" title="Bcfg2.Server.FileMonitor.FileMonitor"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.FileMonitor.FileMonitor</span></tt></a> object used by the core to monitor for Bcfg2 data changes.</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.fam_thread"> <tt class="descname">fam_thread</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.fam_thread" title="Permalink to this definition">¶</a></dt> <dd><p>The FAM <tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt>, <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._file_monitor_thread" title="Bcfg2.Server.Core.BaseCore._file_monitor_thread"><tt class="xref py py-func docutils literal"><span class="pre">_file_monitor_thread()</span></tt></a></p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.generators"> <tt class="descname">generators</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.generators" title="Permalink to this definition">¶</a></dt> <dd><p>The list of <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Generator" title="Bcfg2.Server.Plugin.interfaces.Generator"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Generator</span></tt></a> plugins</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.get_statistics"> <tt class="descname">get_statistics</tt><big>(</big><em>_</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.get_statistics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.get_statistics" title="Permalink to this definition">¶</a></dt> <dd><p>Get current statistics about component execution from <a class="reference internal" href="plugins.html#Bcfg2.Statistics.stats" title="Bcfg2.Statistics.stats"><tt class="xref py py-attr docutils literal"><span class="pre">Bcfg2.Statistics.stats</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">dict - The statistics data as returned by <a class="reference internal" href="plugins.html#Bcfg2.Statistics.Statistics.display" title="Bcfg2.Statistics.Statistics.display"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Statistics.Statistics.display()</span></tt></a></td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.init_plugin"> <tt class="descname">init_plugin</tt><big>(</big><em>plugin</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.init_plugin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.init_plugin" title="Permalink to this definition">¶</a></dt> <dd><p>Import and instantiate a single plugin. The plugin is stored to <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.plugins" title="Bcfg2.Server.Core.BaseCore.plugins"><tt class="xref py py-attr docutils literal"><span class="pre">plugins</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>plugin</strong> (<em>string</em>) – The name of the plugin. This is just the name of the plugin, in the appropriate case. I.e., <tt class="docutils literal"><span class="pre">Cfg</span></tt>, not <tt class="docutils literal"><span class="pre">Bcfg2.Server.Plugins.Cfg</span></tt>.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.listMethods"> <tt class="descname">listMethods</tt><big>(</big><em>address</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.listMethods"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.listMethods" title="Permalink to this definition">¶</a></dt> <dd><p>List all exposed methods, including plugin RMI.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of exposed method names</td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.lock"> <tt class="descname">lock</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.lock" title="Permalink to this definition">¶</a></dt> <dd><p>A <tt class="xref py py-func docutils literal"><span class="pre">threading.Lock()</span></tt> for use by <a class="reference internal" href="fam.html#Bcfg2.Server.FileMonitor.FileMonitor.handle_event_set" title="Bcfg2.Server.FileMonitor.FileMonitor.handle_event_set"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.FileMonitor.FileMonitor.handle_event_set()</span></tt></a></p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.logger"> <tt class="descname">logger</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.logger" title="Permalink to this definition">¶</a></dt> <dd><p>A <tt class="xref py py-class docutils literal"><span class="pre">logging.Logger</span></tt> object for use by the core</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.metadata"> <tt class="descname">metadata</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.metadata" title="Permalink to this definition">¶</a></dt> <dd><p>The Metadata plugin</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.metadata_cache"> <tt class="descname">metadata_cache</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.metadata_cache" title="Permalink to this definition">¶</a></dt> <dd><p>A <tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Cache.Cache</span></tt> object for caching client metadata</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.metadata_cache_mode"> <tt class="descname">metadata_cache_mode</tt><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.metadata_cache_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.metadata_cache_mode" title="Permalink to this definition">¶</a></dt> <dd><p>Get the client <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.metadata_cache" title="Bcfg2.Server.Core.BaseCore.metadata_cache"><tt class="xref py py-attr docutils literal"><span class="pre">metadata_cache</span></tt></a> mode. Options are off, initial, cautious, aggressive, on (synonym for cautious). See <a class="reference internal" href="../server/caching.html#server-caching"><em>Server-side Caching</em></a> for more details.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.methodHelp"> <tt class="descname">methodHelp</tt><big>(</big><em>address</em>, <em>method_name</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.methodHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.methodHelp" title="Permalink to this definition">¶</a></dt> <dd><p>Get help from the docstring of an exposed method</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</li> <li><strong>method_name</strong> (<em>string</em>) – The name of the method to get help on</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">string - The help message from the method’s docstring</p> </td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.plugin_blacklist"> <tt class="descname">plugin_blacklist</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.plugin_blacklist" title="Permalink to this definition">¶</a></dt> <dd><p>Blacklist of plugins that conflict with enabled plugins. If two plugins are loaded that conflict with each other, the first one loaded wins.</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.plugins"> <tt class="descname">plugins</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.plugins" title="Permalink to this definition">¶</a></dt> <dd><p>Dict of plugins that are enabled. Keys are the plugin names (just the plugin name, in the correct case; e.g., “Cfg”, not “Bcfg2.Server.Plugins.Cfg”), and values are plugin objects.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.plugins_by_type"> <tt class="descname">plugins_by_type</tt><big>(</big><em>base_cls</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.plugins_by_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.plugins_by_type" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of loaded plugins that match the passed type.</p> <p>The returned list is sorted in ascending order by the plugins’ <tt class="docutils literal"><span class="pre">sort_order</span></tt> value. The <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.base.Plugin.sort_order" title="Bcfg2.Server.Plugin.base.Plugin.sort_order"><tt class="xref py py-attr docutils literal"><span class="pre">Bcfg2.Server.Plugin.base.Plugin.sort_order</span></tt></a> defaults to 500, but can be overridden by individual plugins. Plugins with the same numerical sort_order value are sorted in alphabetical order by their name.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>base_cls</strong> (<em>type</em>) – The base plugin interface class to match (see <a class="reference internal" href="plugins.html#module-Bcfg2.Server.Plugin.interfaces" title="Bcfg2.Server.Plugin.interfaces"><tt class="xref py py-mod docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces</span></tt></a>)</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.base.Plugin" title="Bcfg2.Server.Plugin.base.Plugin"><tt class="xref py py-attr docutils literal"><span class="pre">Bcfg2.Server.Plugin.base.Plugin</span></tt></a> objects</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.process_statistics"> <tt class="descname">process_statistics</tt><big>(</big><em>client_name</em>, <em>statistics</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.process_statistics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.process_statistics" title="Permalink to this definition">¶</a></dt> <dd><p>Process uploaded statistics for client.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>client_name</strong> (<em>string</em>) – The name of the client to process statistics for</li> <li><strong>statistics</strong> (<em>lxml.etree._Element</em>) – The statistics document to process</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.pull_sources"> <tt class="descname">pull_sources</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.pull_sources" title="Permalink to this definition">¶</a></dt> <dd><p>The list of plugins that implement the <tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.PullSource</span></tt> interface</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.resolve_client"> <tt class="descname">resolve_client</tt><big>(</big><em>address</em>, <em>cleanup_cache=False</em>, <em>metadata=True</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.resolve_client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.resolve_client" title="Permalink to this definition">¶</a></dt> <dd><p>Given a client address, get the client hostname and optionally metadata.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>address</strong> (<em>tuple of (<ip address>, <hostname>)</em>) – The address pair of the client to get the canonical hostname for.</li> <li><strong>cleanup_cache</strong> (<em>bool</em>) – Tell the <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Metadata" title="Bcfg2.Server.Plugin.interfaces.Metadata"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Metadata</span></tt></a> plugin in <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.metadata" title="Bcfg2.Server.Core.BaseCore.metadata"><tt class="xref py py-attr docutils literal"><span class="pre">metadata</span></tt></a> to clean up any client or session cache it might keep</li> <li><strong>metadata</strong> (<em>bool</em>) – Build a <tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugins.Metadata.ClientMetadata</span></tt> object for this client as well. This is offered for convenience.</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">tuple - If <tt class="docutils literal"><span class="pre">metadata</span></tt> is False, returns <tt class="docutils literal"><span class="pre">(<canonical</span> <span class="pre">hostname>,</span> <span class="pre">None)</span></tt>; if <tt class="docutils literal"><span class="pre">metadata</span></tt> is True, returns <tt class="docutils literal"><span class="pre">(<canonical</span> <span class="pre">hostname>,</span> <span class="pre"><client</span> <span class="pre">metadata</span> <span class="pre">object>)</span></tt></p> </td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.revision"> <tt class="descname">revision</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.revision" title="Permalink to this definition">¶</a></dt> <dd><p>Revision of the Bcfg2 specification. This will be sent to the client in the configuration, and can be set by a <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Version" title="Bcfg2.Server.Plugin.interfaces.Version"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Version</span></tt></a> plugin.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.run"> <tt class="descname">run</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.run" title="Permalink to this definition">¶</a></dt> <dd><p>Run the server core. This calls <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._daemonize" title="Bcfg2.Server.Core.BaseCore._daemonize"><tt class="xref py py-func docutils literal"><span class="pre">_daemonize()</span></tt></a>, <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._run" title="Bcfg2.Server.Core.BaseCore._run"><tt class="xref py py-func docutils literal"><span class="pre">_run()</span></tt></a>, starts the <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.fam_thread" title="Bcfg2.Server.Core.BaseCore.fam_thread"><tt class="xref py py-attr docutils literal"><span class="pre">fam_thread</span></tt></a>, and calls <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore._block" title="Bcfg2.Server.Core.BaseCore._block"><tt class="xref py py-func docutils literal"><span class="pre">_block()</span></tt></a>, but note that it is the responsibility of the server core implementation to call <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.shutdown" title="Bcfg2.Server.Core.BaseCore.shutdown"><tt class="xref py py-func docutils literal"><span class="pre">shutdown()</span></tt></a> under normal operation. This also handles creation of the directory containing the pidfile, if necessary.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.set_debug"> <tt class="descname">set_debug</tt><big>(</big><em>address</em>, <em>debug</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.set_debug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.set_debug" title="Permalink to this definition">¶</a></dt> <dd><p>Explicitly set debug status of the FAM and all plugins</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>debug</strong> (<em>bool or string</em>) – The new debug status. This can either be a boolean, or a string describing the state (e.g., “true” or “false”; case-insensitive)</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - The new debug state</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.set_fam_debug"> <tt class="descname">set_fam_debug</tt><big>(</big><em>_</em>, <em>debug</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.set_fam_debug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.set_fam_debug" title="Permalink to this definition">¶</a></dt> <dd><p>Explicitly set debug status of the FAM</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>debug</strong> (<em>bool or string</em>) – The new debug status of the FAM. This can either be a boolean, or a string describing the state (e.g., “true” or “false”; case-insensitive)</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - The new debug state of the FAM</td> </tr> </tbody> </table> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.setup"> <tt class="descname">setup</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.setup" title="Permalink to this definition">¶</a></dt> <dd><p>The Bcfg2 options dict</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.shutdown"> <tt class="descname">shutdown</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.shutdown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.shutdown" title="Permalink to this definition">¶</a></dt> <dd><p>Perform plugin and FAM shutdown tasks.</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.statistics"> <tt class="descname">statistics</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.statistics" title="Permalink to this definition">¶</a></dt> <dd><p>The list of plugins that handle <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Statistics" title="Bcfg2.Server.Plugin.interfaces.Statistics"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Statistics</span></tt></a></p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.structures"> <tt class="descname">structures</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.structures" title="Permalink to this definition">¶</a></dt> <dd><p>The list of plugins that handle <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.Structure" title="Bcfg2.Server.Plugin.interfaces.Structure"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.Structure</span></tt></a> generation</p> </dd></dl> <dl class="attribute"> <dt id="Bcfg2.Server.Core.BaseCore.terminate"> <tt class="descname">terminate</tt><em class="property"> = None</em><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.terminate" title="Permalink to this definition">¶</a></dt> <dd><p>Threading event to signal worker threads (e.g., <a class="reference internal" href="#Bcfg2.Server.Core.BaseCore.fam_thread" title="Bcfg2.Server.Core.BaseCore.fam_thread"><tt class="xref py py-attr docutils literal"><span class="pre">fam_thread</span></tt></a>) to shutdown</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.toggle_debug"> <tt class="descname">toggle_debug</tt><big>(</big><em>address</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.toggle_debug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.toggle_debug" title="Permalink to this definition">¶</a></dt> <dd><p>Toggle debug status of the FAM and all plugins</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>address</strong> (<em>tuple</em>) – Client (address, hostname) pair</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">bool - The new debug state of the FAM</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.toggle_fam_debug"> <tt class="descname">toggle_fam_debug</tt><big>(</big><em>_</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.toggle_fam_debug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.toggle_fam_debug" title="Permalink to this definition">¶</a></dt> <dd><p>Toggle debug status of the FAM</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">bool - The new debug state of the FAM</td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.validate_goals"> <tt class="descname">validate_goals</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.validate_goals"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.validate_goals" title="Permalink to this definition">¶</a></dt> <dd><p>Checks that the config matches the goals enforced by <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.GoalValidator" title="Bcfg2.Server.Plugin.interfaces.GoalValidator"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.GoalValidator</span></tt></a> plugins by calling <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.GoalValidator.validate_goals" title="Bcfg2.Server.Plugin.interfaces.GoalValidator.validate_goals"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.GoalValidator.validate_goals()</span></tt></a>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to validate goals for</li> <li><strong>data</strong> (<em>list of lxml.etree._Element objects</em>) – The list of structures (i.e., bundles) for this client</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="method"> <dt id="Bcfg2.Server.Core.BaseCore.validate_structures"> <tt class="descname">validate_structures</tt><big>(</big><em>obj</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#BaseCore.validate_structures"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.BaseCore.validate_structures" title="Permalink to this definition">¶</a></dt> <dd><p>Checks the data structures by calling the <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.StructureValidator.validate_structures" title="Bcfg2.Server.Plugin.interfaces.StructureValidator.validate_structures"><tt class="xref py py-func docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.StructureValidator.validate_structures()</span></tt></a> method of <a class="reference internal" href="plugins.html#Bcfg2.Server.Plugin.interfaces.StructureValidator" title="Bcfg2.Server.Plugin.interfaces.StructureValidator"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.Plugin.interfaces.StructureValidator</span></tt></a> plugins.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>metadata</strong> (<em>Bcfg2.Server.Plugins.Metadata.ClientMetadata</em>) – Client metadata to validate structures for</li> <li><strong>data</strong> (<em>list of lxml.etree._Element objects</em>) – The list of structures (i.e., bundles) for this client</li> </ul> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> <dl class="exception"> <dt id="Bcfg2.Server.Core.CoreInitError"> <em class="property">exception </em><tt class="descclassname">Bcfg2.Server.Core.</tt><tt class="descname">CoreInitError</tt><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#CoreInitError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.CoreInitError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p> <p>Raised when the server core cannot be initialized.</p> </dd></dl> <dl class="exception"> <dt id="Bcfg2.Server.Core.NoExposedMethod"> <em class="property">exception </em><tt class="descclassname">Bcfg2.Server.Core.</tt><tt class="descname">NoExposedMethod</tt><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#NoExposedMethod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.NoExposedMethod" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p> <p>Raised when an XML-RPC method is called, but there is no method exposed with the given name.</p> </dd></dl> <dl class="function"> <dt id="Bcfg2.Server.Core.exposed"> <tt class="descclassname">Bcfg2.Server.Core.</tt><tt class="descname">exposed</tt><big>(</big><em>func</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#exposed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.exposed" title="Permalink to this definition">¶</a></dt> <dd><p>Decorator that sets the <tt class="docutils literal"><span class="pre">exposed</span></tt> attribute of a function to <tt class="docutils literal"><span class="pre">True</span></tt> expose it via XML-RPC. This currently works for both the builtin and CherryPy cores, although if other cores are added this may need to be made a core-specific function.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>func</strong> (<em>callable</em>) – The function to decorate</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">callable - the decorated function</td> </tr> </tbody> </table> </dd></dl> <dl class="function"> <dt id="Bcfg2.Server.Core.sort_xml"> <tt class="descclassname">Bcfg2.Server.Core.</tt><tt class="descname">sort_xml</tt><big>(</big><em>node</em>, <em>key=None</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/Server/Core.html#sort_xml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.Server.Core.sort_xml" title="Permalink to this definition">¶</a></dt> <dd><p>Recursively sort an XML document in a deterministic fashion. This shouldn’t be used to perform a <em>useful</em> sort, merely to put XML in a deterministic, replicable order. The document is sorted in-place.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>node</strong> (<em>lxml.etree._Element or lxml.etree.ElementTree</em>) – The root node of the XML tree to sort</li> <li><strong>key</strong> (<em>callable</em>) – The key to sort by</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">None</p> </td> </tr> </tbody> </table> </dd></dl> </div> <div class="section" id="core-implementations"> <h2>Core Implementations<a class="headerlink" href="#core-implementations" title="Permalink to this headline">¶</a></h2> <div class="section" id="builtin-core"> <h3>Builtin Core<a class="headerlink" href="#builtin-core" title="Permalink to this headline">¶</a></h3> <p>The builtin server core consists of the core implementation (<tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.Server.BuiltinCore.Core</span></tt>) and the XML-RPC server implementation (<a class="reference internal" href="#module-Bcfg2.SSLServer" title="Bcfg2.SSLServer"><tt class="xref py py-mod docutils literal"><span class="pre">Bcfg2.SSLServer</span></tt></a>).</p> <div class="section" id="core"> <h4>Core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h4> </div> <div class="section" id="module-Bcfg2.SSLServer"> <span id="xml-rpc-server"></span><h4>XML-RPC Server<a class="headerlink" href="#module-Bcfg2.SSLServer" title="Permalink to this headline">¶</a></h4> <p>Bcfg2 SSL server used by the builtin server core (<tt class="xref py py-mod docutils literal"><span class="pre">Bcfg2.Server.BuiltinCore</span></tt>). This needs to be documented better.</p> <dl class="class"> <dt id="Bcfg2.SSLServer.SSLServer"> <em class="property">class </em><tt class="descclassname">Bcfg2.SSLServer.</tt><tt class="descname">SSLServer</tt><big>(</big><em>listen_all</em>, <em>server_address</em>, <em>RequestHandlerClass</em>, <em>keyfile=None</em>, <em>certfile=None</em>, <em>reqCert=False</em>, <em>ca=None</em>, <em>timeout=None</em>, <em>protocol='xmlrpc/ssl'</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#SSLServer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.SSLServer" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">SocketServer.TCPServer</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p> <p>TCP server supporting SSL encryption.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>listen_all</strong> (<em>bool</em>) – Listen on all interfaces</li> <li><strong>server_address</strong> – Address to bind to the server</li> <li><strong>RequestHandlerClass</strong> – Request handler used by TCP server</li> <li><strong>keyfile</strong> (<em>string</em>) – Full path to SSL encryption key file</li> <li><strong>certfile</strong> (<em>string</em>) – Full path to SSL certificate file</li> <li><strong>reqCert</strong> (<em>bool</em>) – Require client to present certificate</li> <li><strong>ca</strong> (<em>string</em>) – Full path to SSL CA that signed the key and cert</li> <li><strong>timeout</strong> – Timeout for non-blocking request handling</li> <li><strong>protocol</strong> (<em>string</em>) – The protocol to serve. Supported values are <tt class="docutils literal"><span class="pre">xmlrpc/ssl</span></tt> and <tt class="docutils literal"><span class="pre">xmlrpc/tlsv1</span></tt>.</li> </ul> </td> </tr> </tbody> </table> </dd></dl> <dl class="class"> <dt id="Bcfg2.SSLServer.XMLRPCDispatcher"> <em class="property">class </em><tt class="descclassname">Bcfg2.SSLServer.</tt><tt class="descname">XMLRPCDispatcher</tt><big>(</big><em>allow_none</em>, <em>encoding</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCDispatcher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCDispatcher" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">SimpleXMLRPCServer.SimpleXMLRPCDispatcher</span></tt></p> <p>An XML-RPC dispatcher.</p> </dd></dl> <dl class="class"> <dt id="Bcfg2.SSLServer.XMLRPCRequestHandler"> <em class="property">class </em><tt class="descclassname">Bcfg2.SSLServer.</tt><tt class="descname">XMLRPCRequestHandler</tt><big>(</big><em>request</em>, <em>client_address</em>, <em>server</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCRequestHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCRequestHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">SimpleXMLRPCServer.SimpleXMLRPCRequestHandler</span></tt></p> <p>XML-RPC request handler.</p> <p>Adds support for HTTP authentication.</p> <dl class="method"> <dt id="Bcfg2.SSLServer.XMLRPCRequestHandler.parse_request"> <tt class="descname">parse_request</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCRequestHandler.parse_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCRequestHandler.parse_request" title="Permalink to this definition">¶</a></dt> <dd><p>Extends parse_request.</p> <p>Optionally check HTTP authentication when parsing.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="Bcfg2.SSLServer.XMLRPCServer"> <em class="property">class </em><tt class="descclassname">Bcfg2.SSLServer.</tt><tt class="descname">XMLRPCServer</tt><big>(</big><em>listen_all</em>, <em>server_address</em>, <em>RequestHandlerClass=None</em>, <em>keyfile=None</em>, <em>certfile=None</em>, <em>ca=None</em>, <em>protocol='xmlrpc/ssl'</em>, <em>timeout=10</em>, <em>logRequests=False</em>, <em>register=True</em>, <em>allow_none=True</em>, <em>encoding=None</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCServer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCServer" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">SocketServer.ThreadingMixIn</span></tt>, <a class="reference internal" href="#Bcfg2.SSLServer.SSLServer" title="Bcfg2.SSLServer.SSLServer"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.SSLServer.SSLServer</span></tt></a>, <a class="reference internal" href="#Bcfg2.SSLServer.XMLRPCDispatcher" title="Bcfg2.SSLServer.XMLRPCDispatcher"><tt class="xref py py-class docutils literal"><span class="pre">Bcfg2.SSLServer.XMLRPCDispatcher</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p> <p>Component XMLRPCServer.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> <li><strong>listen_all</strong> (<em>bool</em>) – Listen on all interfaces</li> <li><strong>server_address</strong> – Address to bind to the server</li> <li><strong>RequestHandlerClass</strong> – request handler used by TCP server</li> <li><strong>keyfile</strong> (<em>string</em>) – Full path to SSL encryption key file</li> <li><strong>certfile</strong> (<em>string</em>) – Full path to SSL certificate file</li> <li><strong>ca</strong> (<em>string</em>) – Full path to SSL CA that signed the key and cert</li> <li><strong>logRequests</strong> (<em>bool</em>) – Log all requests</li> <li><strong>register</strong> (<em>bool</em>) – Presence should be reported to service-location</li> <li><strong>allow_none</strong> – Allow None values in XML-RPC</li> <li><strong>encoding</strong> – Encoding to use for XML-RPC</li> </ul> </td> </tr> </tbody> </table> <dl class="method"> <dt id="Bcfg2.SSLServer.XMLRPCServer.ping"> <tt class="descname">ping</tt><big>(</big><em>*args</em><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCServer.ping"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCServer.ping" title="Permalink to this definition">¶</a></dt> <dd><p>Echo response.</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.SSLServer.XMLRPCServer.serve_forever"> <tt class="descname">serve_forever</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCServer.serve_forever"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCServer.serve_forever" title="Permalink to this definition">¶</a></dt> <dd><p>Serve single requests until (self.serve == False).</p> </dd></dl> <dl class="method"> <dt id="Bcfg2.SSLServer.XMLRPCServer.shutdown"> <tt class="descname">shutdown</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/Bcfg2/SSLServer.html#XMLRPCServer.shutdown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Bcfg2.SSLServer.XMLRPCServer.shutdown" title="Permalink to this definition">¶</a></dt> <dd><p>Signal that automatic service should stop.</p> </dd></dl> </dd></dl> </div> </div> <div class="section" id="cherrypy-core"> <h3>CherryPy Core<a class="headerlink" href="#cherrypy-core" title="Permalink to this headline">¶</a></h3> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Server Core Development</a><ul> <li><a class="reference internal" href="#module-Bcfg2.Server.Core">Base Core</a></li> <li><a class="reference internal" href="#core-implementations">Core Implementations</a><ul> <li><a class="reference internal" href="#builtin-core">Builtin Core</a><ul> <li><a class="reference internal" href="#core">Core</a></li> <li><a class="reference internal" href="#module-Bcfg2.SSLServer">XML-RPC Server</a></li> </ul> </li> <li><a class="reference internal" href="#cherrypy-core">CherryPy Core</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="compat.html" title="previous chapter">Python Compatibility</a></p> <h4>Next topic</h4> <p class="topless"><a href="documentation.html" title="next chapter">Documentation</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/development/core.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="documentation.html" title="Documentation" >next</a> |</li> <li class="right" > <a href="compat.html" title="Python Compatibility" >previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" >Bcfg2 Development</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Narayan Desai. Last updated on Mar 20, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>