From b75139eb492ca3485c4bc6328265f3e75e9624fe Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Tue, 2 Nov 2010 13:52:19 -0500 Subject: docs: Added more information for the metadata object used in TGenshi and TCheetah --- doc/server/plugins/generators/tcheetah.txt | 16 +----- doc/server/plugins/generators/tgenshi/index.txt | 6 ++- doc/server/plugins/grouping/metadata.txt | 67 +++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 16 deletions(-) diff --git a/doc/server/plugins/generators/tcheetah.txt b/doc/server/plugins/generators/tcheetah.txt index e1ad600a2..52a0f3264 100644 --- a/doc/server/plugins/generators/tcheetah.txt +++ b/doc/server/plugins/generators/tcheetah.txt @@ -27,7 +27,7 @@ located in in a ``TCheetah`` subdirectory of your repository, usually files, ``template`` and ``info``. The template is a standard Cheetah template with two additions: -* `self.metadata` is the client's metadata +* `self.metadata` is the client's :ref:`metadata ` * `self.properties` is an xml document of unstructured data The ``info`` file is formatted like ``:info`` files from Cfg. @@ -44,19 +44,7 @@ Permissions entry and a Path entry to handle the same file. self.metadata variables ======================= -The following variables are available for self.metadata: - -* hostname -* bundles -* groups -* categories -* probes -* uuid -* password - -self.metadata is an instance of the class -ClientMetadata of file `Bcfg2/Server/Plugins/Metadata.py -`_. +self.metadata is an instance of the class ClientMetadata and documented :ref:`here `. self.properties =============== diff --git a/doc/server/plugins/generators/tgenshi/index.txt b/doc/server/plugins/generators/tgenshi/index.txt index cd9bcf152..425b3a289 100644 --- a/doc/server/plugins/generators/tgenshi/index.txt +++ b/doc/server/plugins/generators/tgenshi/index.txt @@ -48,8 +48,10 @@ supported. Inside of templates =================== -* metadata is the client's metadata -* properties.properties is an xml document of unstructured data +* **metadata** is the client's :ref:`metadata ` +* **properties.properties** is an xml document of unstructured data +* **name** is the path name specified in bcfg +* **path** is the path to the TGenshi template See the genshi `documentation `_ for examples of diff --git a/doc/server/plugins/grouping/metadata.txt b/doc/server/plugins/grouping/metadata.txt index 96fc70ff5..22c967262 100644 --- a/doc/server/plugins/grouping/metadata.txt +++ b/doc/server/plugins/grouping/metadata.txt @@ -225,3 +225,70 @@ Probes The metadata plugin includes client-side probing functionality. This is fully documented :ref:`here `. + +.. _server-plugins-grouping-metadata-clientmetadata: + +ClientMetadata +============== + +A special client metadata class is available to the TGenshi and TCheetah +plugins. + ++----------------------+------------------------------------------------+-------------------+ +| Attribute | Description | Value | ++======================+================================================+===================+ +| hostname | Client hostname | String | ++----------------------+------------------------------------------------+-------------------+ +| profile | Client profile | String | ++----------------------+------------------------------------------------+-------------------+ +| aliases | Client aliases | List | ++----------------------+------------------------------------------------+-------------------+ +| addresses | Adresses this client is known by | List | ++----------------------+------------------------------------------------+-------------------+ +| groups | Groups this client is a member of | List | ++----------------------+------------------------------------------------+-------------------+ +| categories | Categories of this clients groups | List | ++----------------------+------------------------------------------------+-------------------+ +| uuid | uuid identifier for this client | String | ++----------------------+------------------------------------------------+-------------------+ +| password | bcfg password for this client | String | ++----------------------+------------------------------------------------+-------------------+ +| connectors | connector plugins known to this client | List | ++----------------------+------------------------------------------------+-------------------+ +| query | MetadataQuery object | MetadataQuery | ++----------------------+------------------------------------------------+-------------------+ + +| + ++------------------------------+------------------------------------------------+-------------------+ +| Method | Description | Value | ++==============================+================================================+===================+ +| inGroup(group) | True if this client is a memnber of 'group' | Boolean | ++------------------------------+------------------------------------------------+-------------------+ +| group_in_category(category) | Returns the group in 'category' if the client | String | +| | is a member of 'category', otherwise '' | | ++------------------------------+------------------------------------------------+-------------------+ + +MetadataQuery +------------- + +This class provides query routines for the servers Metadata. + ++------------------------------+------------------------------------------------+-------------------+ +| Method | Description | Value | ++==============================+================================================+===================+ +| by_name(client) | Get ClientMetadata object for 'client' | ClientMetadata | ++------------------------------+------------------------------------------------+-------------------+ +| names_by_groups(group) | | | ++------------------------------+------------------------------------------------+-------------------+ +| names_by_profiles(profile) | All clients names in 'profile' | List | ++------------------------------+------------------------------------------------+-------------------+ +| all_clients() | All known client hostnames | List | ++------------------------------+------------------------------------------------+-------------------+ +| all_groups() | All known group names | List | ++------------------------------+------------------------------------------------+-------------------+ +| all_groups_in_category(cat) | All groups in category 'cat' | List | ++------------------------------+------------------------------------------------+-------------------+ +| all() | Get ClientMetadata for all clients | List | ++------------------------------+------------------------------------------------+-------------------+ + -- cgit v1.2.3-1-g7c22