hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
hlccOldbloader.hlccOldbloader.OldbSpecFile Class Reference

Class used to encode/decode configuration nodes of type 'OldbSpecFile' to python types. More...

Public Member Functions

def __init__ (self, file_name, prefix)
 Constructor.
 
def __repr__ (self)
 

Static Public Member Functions

def encode_to_configng (instance)
 Convert value of instance to python object (map) that can be converted into config-ng node hierarchy.
 
def decode_from_configng (CiiConfigNode node)
 Convert value of top node to python object OldbSpecFile.
 

Protected Attributes

 _file_name
 
 _prefix
 

Detailed Description

Class used to encode/decode configuration nodes of type 'OldbSpecFile' to python types.

For each deployment there is one yaml configuration file that stores the list of all oldb specification files part of that deployment. Each specification file is composed by a file name and a prefix. A custom type was created to group those tho fields (!cfg.typedef OldbSpecFile), so we can store them as a list of the custom type in a config-ng configuration file. Those configuration files are then loaded using the config-ng engine and finally decoded to python types with the help of this class which knows how to make the conversion by being aware of the custom type. Check below how a configuration file looks like:

!cfg.typedef OldbSpecFile: file_name !cfg.type:string prefix !cfg.type:string

oldb_spec_files !cfg.type:vector_OldbSpecFile

...

Constructor & Destructor Documentation

◆ __init__()

def hlccOldbloader.hlccOldbloader.OldbSpecFile.__init__ (   self,
  file_name,
  prefix 
)

Constructor.

Member Function Documentation

◆ __repr__()

def hlccOldbloader.hlccOldbloader.OldbSpecFile.__repr__ (   self)

◆ decode_from_configng()

def hlccOldbloader.hlccOldbloader.OldbSpecFile.decode_from_configng ( CiiConfigNode  node)
static

Convert value of top node to python object OldbSpecFile.

◆ encode_to_configng()

def hlccOldbloader.hlccOldbloader.OldbSpecFile.encode_to_configng (   instance)
static

Convert value of instance to python object (map) that can be converted into config-ng node hierarchy.

Parameters
instanceinstance of OldbSpecFile class to convert to map
Returns
python dict representing value of the instance

Member Data Documentation

◆ _file_name

hlccOldbloader.hlccOldbloader.OldbSpecFile._file_name
protected

◆ _prefix

hlccOldbloader.hlccOldbloader.OldbSpecFile._prefix
protected

The documentation for this class was generated from the following file: