Validators¶
Actions¶
Validate root actions and individual action Schemas
- curator.validators.actions.root()¶
Return a valid
Schemadefinition which is a dictionary withactionsRequiredto be the root key with another dictionary as the value.
- curator.validators.actions.structure(data, location)¶
Return a valid
Schemadefinition which testsdata, which is ostensibly an individual action dictionary. If it is avalid_action(), then it willupdate()the baseSchemawith other options, based on the what the value ofdata['action']is.
- curator.validators.actions.valid_action()¶
Return a valid
Schemadefinition which is that the value of keyactionisRequiredto beInthe 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
listcontaining one or moreOptionalorRequiredoptions fromoption_defaults, defining acceptable values for each for the givenaction- Return type:
- curator.validators.options.get_schema(action)¶
Return a
Schemaof 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
Schemaof the options foraction
Filter Functions¶
Functions validating the filter Schema of an action
- curator.validators.filter_functions.filterstructure()¶
Return a
Schemaobject 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
Schemaobject
- curator.validators.filter_functions.filtertype()¶
Return a
Schemaobject that usesall_filtertypes()to populate acceptable values- Returns:
A
Schemaobject
- curator.validators.filter_functions.singlefilter(action, data)¶
Return a
Schemaobject that is created using the return value fromfiltertype()to create a local variableftype. The values fromactionanddataare used to updateftypebased 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
Schemaobject
- curator.validators.filter_functions.validfilters(action, location=None)¶
Validate the filters in a list