Validators¶
SchemaCheck¶
-
class
curator.validators.
SchemaCheck
(config, schema, test_what, location)¶ Validate
config
with the providedSchema
fromschema
.test_what
andlocation
are for reporting the results, in case of failure. If validation is successful,result()
returnsconfig
a validSchema
.Parameters: -
badvalue
= None¶ Object attribute that is only populated in
__parse_error()
-
config
= None¶ Object attribute that gets the value of param
config
-
location
= None¶ Object attribute that gets the value of param
location
-
result
()¶ Evaluate
config
usingschema
. Try to parse and log the error if validation fails, then raise aConfigurationError
Returns: A validated Schema
based onconfig
-
schema
= None¶ Object attribute that gets the value of param
schema
-
test_what
= None¶ Object attribute that gets the value of param
test_what
-
Actions¶
Validate root actions
and individual action
Schemas
-
curator.validators.actions.
root
()¶ Return a valid
Schema
definition which is a dictionary withactions
Required
to be the root key with another dictionary as the value.
-
curator.validators.actions.
structure
(data, location)¶ Return a valid
Schema
definition which testsdata
, which is ostensibly an individual action dictionary. If it is avalid_action()
, then it willupdate()
the baseSchema
with other options, based on the what the value ofdata['action']
is.Parameters: Returns: A
Schema
object
-
curator.validators.actions.
valid_action
()¶ Return a valid
Schema
definition which is that the value of keyaction
isRequired
to beIn
the value returned byall_actions()
.
Options¶
Set up voluptuous Schema defaults for various actions
-
curator.validators.options.
action_specific
(action)¶ Parameters: action (str) – The name of an action Returns: A list
containing one or moreOptional
orRequired
options fromoption_defaults
, defining acceptable values for each for the givenaction
Return type: list
-
curator.validators.options.
get_schema
(action)¶ Return a
Schema
of acceptable options and their default values as returned byaction_specific()
, passing along the value ofaction
.Parameters: action (str) – The name of an action Returns: A valid Schema
of the options foraction
Filter Functions¶
Functions validating the filter
Schema of an action
-
curator.validators.filter_functions.
filterstructure
()¶ Return a
Schema
object that uses the return value fromstructural_filter_elements()
to populate acceptable values and updates/merges the Schema object with the return value fromfiltertype()
Returns: A Schema
object
-
curator.validators.filter_functions.
filtertype
()¶ Return a
Schema
object that usesall_filtertypes()
to populate acceptable valuesReturns: A Schema
object
-
curator.validators.filter_functions.
singlefilter
(action, data)¶ Return a
Schema
object that is created using the return value fromfiltertype()
to create a local variableftype
. The values fromaction
anddata
are used to updateftype
based on matching function names infiltertypes
.structural_filter_elements()
to populate acceptable values and updates/merges the Schema object with the return value fromfiltertype()
Parameters: - action (str) – The Curator action name
- data – The filter block of the action
Returns: A
Schema
object
-
curator.validators.filter_functions.
validfilters
(action, location=None)¶ Validate the filters in a list
Log Config¶
Logging Schema definition
-
curator.validators.logconfig.
logging
()¶ Pulls value from
config_logging()
Returns: {Optional('logging'): logging_defaults.config_logging()}
Return type: Schema