Other Class Definitions¶
Wrapper¶
- class curator.classdef.Wrapper(cls)¶
Bases:
objectWrapper Class
Instantiate with passed Class (not instance or object)
- Parameters:
cls – A class (not an instance of the class)
- class_instance¶
An instance of
class_object
- class_object¶
The class itself (not an instance of it), passed from
cls
- get_instance(*args, **kwargs)¶
Return the instance with
*argsand**kwargs
- set_instance(*args, **kwargs)¶
Set up
class_instancefromclass_object
ActionsFile¶
- class curator.classdef.ActionsFile(action_file)¶
Bases:
objectClass to parse and verify entire actions file
Individual actions are
ActionDefobjects- actions¶
A dict of all actions in the provided configuration. Each original key name is preserved and the value is now an
ActionDef, rather than a dict.
- fullconfig¶
The full, validated configuration from
action_file.
- get_validated(action_file)¶
- Parameters:
action_file (str) – The path to a valid YAML action configuration file
- Returns:
The result from passing
action_filetovalidate_actions()
- parse_actions(all_actions)¶
Parse the individual actions found in
all_actions['actions']
- set_actions(all_actions)¶
Set the actions via
parse_actions()- Parameters:
all_actions (dict) – All actions, each its own dictionary behind a numeric key. Making the keys numeric guarantees that if they are sorted, they will always be executed in order.
- Return type:
None
ActionDef¶
- class curator.classdef.ActionDef(action_dict)¶
Bases:
objectIndividual Action Definition Class
Instances of this class represent an individual action from an action file.
- action¶
The action name
- action_cls¶
The action’s class (Alias, Allocation, etc.)
- action_dict¶
The whole action dictionary
- allow_ilm¶
The action option
allow_ilm_indices
- cif¶
The action option
continue_if_exception
- description¶
The action
description
- disabled¶
The action option
disable_action
- get_action_class()¶
Get the action class from
CLASS_MAPDo extra setup when action is
aliasSet
list_objtoSnapshotListwhenactionisdelete_snapshotsorrestore
- get_obj_instance(wrapper, *args, **kwargs)¶
Get the class instance wrapper identified by
wrapperPass all other args and kwargs to theget_instance()method.- Returns:
An instance of the class that
Wrapperis wrapping
- iel¶
The action option
ignore_empty_list
- instantiate(attribute, *args, **kwargs)¶
Convert
attributefrom being aWrapperof a Class to an instantiated object of that Class.This is madness or genius. You decide. This entire method plus the
Wrapperclass came about because I couldn’t cleanly instantiate a class variable into a class object. It works, and that’s good enough for me.- Parameters:
attribute (str) – The name of an attribute that references a Wrapper class instance
- list_obj¶
The list class, either
IndexListorSnapshotList. Default isIndexList
- log_the_options()¶
Log options at initialization time
- set_alias_extras()¶
Populate the
alias_addsandalias_removesattributes
- set_root_attrs()¶
Iteratively get the keys and values from
action_dictand set the attributes
- timeout_override¶
The action option
timeout_override