The LIO configuration API.
The Config object provide methods to edit, search, validate and update
the current configuration, and commit that configuration to the live
system on request.
It features pattern-matching search for all configuration objects and
attributes as well as multi-level undo capabilities. In addition, all
configuration changes are staged before being applied, isolating the
current configuration from load-time and validation errors.
|
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
|
_load_policy(self)
Loads all LIO system policy files. |
|
|
|
_load_parse_tree(self,
parse_tree,
cur_stage=None,
replace=False,
source=None,
target=' config ' ,
allow_new_attrs=False)
target can be 'config', 'policy' or 'reference' |
|
|
|
_add_missing_attributes(self,
obj)
Given an obj node, add all missing attributes and attribute groups in
the configuration. |
|
|
|
validate_val(self,
value,
val_type,
parent=None) |
|
|
|
validate_obj(self,
token,
parent) |
|
|
|
validate_attr(self,
token,
parent,
allow_new_attr=False) |
|
|
|
undo(self)
Restores the previous state of the configuration, before the last
set, load, delete, update or clear operation. |
|
|
|
set(self,
configuration)
Evaluates the configuration (a string in LIO configuration format)
and sets the relevant objects, attributes and atttribute groups. |
|
|
|
delete(self,
pattern,
node_filter=<function <lambda> at 0x7fedce549398>)
Deletes all configuration objects and attributes whose paths match the
pattern, along with their children. |
|
|
|
load(self,
filepath,
allow_new_attrs=False)
Loads an LIO configuration file and replace the current configuration
with it. |
|
|
|
load_live(self)
Loads the live-running configuration. |
|
|
|
update(self,
filepath)
Updates the current configuration with the contents of an LIO
configuration file. |
|
|
|
clear(self)
Clears the current configuration. |
|
|
|
search(self,
search_statement,
node_filter=<function <lambda> at 0x7fedce549668>)
Returns a list of nodes matching the search_statement, relative to the
current node, or an empty list if no match was found. |
|
|
|
dump(self,
search_statement=None,
node_filter=<function <lambda> at 0x7fedce549758>)
Returns a LIO configuration file format dump of the nodes matching
the search_statement, or of all nodes if search_statement is None. |
|
|
|
save(self,
filepath,
pattern=None)
Saves the current configuration to filepath, using LIO configuration
file format. |
|
|
|
verify(self)
Validates the configuration for the following points: |
|
|
|
apply(self,
brute_force=True)
Applies the configuration to the live system: |
|
|
|
diff_live(self)
Returns a diff between the current configuration and the live
configuration as a reference. |
|
|
|
diff(self)
Computes differences between a valid current configuration and a
previously loaded valid reference configuration. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|