Other Class Definitions¶
Wrapper¶
- class curator.classdef.Wrapper(cls)¶
Bases:
object
Wrapper 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
*args
and**kwargs
- set_instance(*args, **kwargs)¶
Set up
class_instance
fromclass_object
ActionsFile¶
- class curator.classdef.ActionsFile(action_file)¶
Bases:
object
Class to parse and verify entire actions file
Individual actions are
ActionDef
objects- 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_file
tovalidate_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:
object
Individual 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_MAP
Do extra setup when action is
alias
Set
list_obj
toSnapshotList
whenaction
isdelete_snapshots
orrestore
- get_obj_instance(wrapper, *args, **kwargs)¶
Get the class instance wrapper identified by
wrapper
Pass all other args and kwargs to theget_instance()
method.- Returns:
An instance of the class that
Wrapper
is wrapping
- iel¶
The action option
ignore_empty_list
- instantiate(attribute, *args, **kwargs)¶
Convert
attribute
from being aWrapper
of a Class to an instantiated object of that Class.This is madness or genius. You decide. This entire method plus the
Wrapper
class 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
IndexList
orSnapshotList
. Default isIndexList
- log_the_options()¶
Log options at initialization time
- set_alias_extras()¶
Populate the
alias_adds
andalias_removes
attributes
- set_root_attrs()¶
Iteratively get the keys and values from
action_dict
and set the attributes
- timeout_override¶
The action option
timeout_override