Python API
Cumin Python API autodoc.
Automation and orchestration framework written in Python.
- exception cumin.CuminError[source]
Bases:
ExceptionBase Exception class for all Cumin's custom Exceptions.
- cumin.trace(self, msg, *args, **kwargs)[source]
Additional logging level for development debugging.
- Parameters:
according to
logging.Loggerinterface for log levels.
- class cumin.Config(config='/etc/cumin/config.yaml')[source]
Bases:
dictSingleton-like dictionary class to load the configuration from a given path only once.
Load the given configuration if not already loaded and return it.
Called by Python's data model for each new instantiation of the class.
- Parameters:
config (str, optional) -- path to the configuration file to load.
- Returns:
the configuration dictionary.
- Return type:
Examples
>>> import cumin >>> config = cumin.Config()
- cumin.parse_config(config_file)[source]
Parse the YAML configuration file.
- Parameters:
config_file (str) -- the path of the configuration file to load.
- Returns:
the configuration dictionary.
- Return type:
- Raises:
CuminError -- if unable to read or parse the configuration.
- cumin.nodeset(nodes=None)[source]
Instantiate a ClusterShell NodeSet with the resolver defaulting to
RESOLVER_NOGROUP.This allow to avoid any conflict with Cumin grammars.
- Returns:
the instantiated NodeSet.
- Return type:
- cumin.nodeset_fromlist(nodelist)[source]
Instantiate a ClusterShell NodeSet from a list with the resolver defaulting to
RESOLVER_NOGROUP.This allow to avoid any conflict with Cumin grammars.
- Returns:
the instantiated NodeSet.
- Return type:
- cumin.ensure_kerberos_ticket(config: Config) None[source]
Ensure that there is a valid Kerberos ticket for the current user, according to the given configuration.
- Parameters:
config (cumin.Config) -- the Cumin's configuration dictionary.
Subpackages and Submodules
- Backends
InvalidQueryErrorBaseQueryBaseQueryAggregator- Direct
- KnownHosts
- OpenStack
- PuppetDB
CATEGORIESOPERATORSParsedStringgrammar()PuppetDBQueryPuppetDBQuery.base_url_templatePuppetDBQuery.endpointsPuppetDBQuery.category_prefixesPuppetDBQuery.grammarPuppetDBQuery.endpointPuppetDBQuery._open_subgroup()PuppetDBQuery._close_subgroup()PuppetDBQuery._get_grouped_tokens()PuppetDBQuery._build()PuppetDBQuery._execute()PuppetDBQuery._add_category()PuppetDBQuery._add_hosts()PuppetDBQuery._parse_token()PuppetDBQuery._get_resource_query()PuppetDBQuery._get_special_resource_query()PuppetDBQuery._get_query_string()PuppetDBQuery._add_bool()PuppetDBQuery._api_call()
GRAMMAR_PREFIXquery_class
- Color
- Grammar
- Query
- Transport
- Transports
CommandStateState.currentState.is_pendingState.is_scheduledState.is_runningState.is_successState.is_failedState.is_timeoutState.valid_statesState.pendingState.scheduledState.runningState.successState.failedState.timeoutState.states_representationState.allowed_state_transitionsState.__getattr__()State.__repr__()State.__str__()State.update()State._cmp()
WorkerErrorStateTransitionErrorInvalidStateErrorTargetBaseWorkervalidate_list()validate_positive_integer()validate_positive_float()raise_error()BaseExecutionProgressTqdmProgressBarsNoProgress- ClusterShell