saltypie.output.OrchestrationOutput¶
-
class
saltypie.output.
OrchestrationOutput
(ret, salt=None)[source]¶ Output handler for salt orchestration return objects
Parameters: - ret (dict) – The return object of a state.orch execution.
- salt (Salt) – saltypie’s Salt object for connecting to the master where the orchestration was executed from. A bug on salt’s orchestration return object prevents it from been parsed as a full qualified JSON object when one of its state execution steps fails
-
failed_steps
¶ List of all the failed steps in the orchestration.
Returns: list
-
get_state_outputs
()[source]¶ Returns a list of all state output objects present on the orchestration.
Returns: List of dictionaries with two keys: step and data. Return type: list
-
static
get_step_type
(key)[source]¶ Returns the orchestration step type based on its key.
Parameters: key ([str) – An orchestration step key. Returns: The orchestration step type. Return type: str
-
static
is_salt_function
(key)[source]¶ Checks whether or not an orchestration step is a salt function execution.
Parameters: key (str) – An orchestration step key. Returns: bool
-
static
is_salt_state
(key)[source]¶ Checks whether or not an orchestration step is a salt state execution.
Parameters: key (str) – An orchestration step key Returns: bool
-
normalize_state
(state_data)[source]¶ Normalizes an orchestration state return data by making the changes attribute consistent even and it fails.
When normalizing data for failed states, the return object will be retrieved by querying the server using the job ID.
If OrchestrationOutput.salt object is not provided, the state data will not be altered.
Parameters: state_data (dict) – State execution dictionary. Returns: Normalized data Return type: dict
-
ordered_result
(result)[source]¶ Order orchestration steps by run number.
Parameters: result (dict) – The return object of a state.orch execution. Returns: OrderedDict
-
parse_data
(dict_only=False)[source]¶ Parses the orchestration data.
Parameters: dict_only (bool, optional) – Defaults to False. State changes will be replaced by saltypie.StateOutput objects. If this argument is set to true, it will be just an OrderedDict instead. Returns: dict
-
summary_table
(max_bar_size=30, time_unit='s', show_minions=False)[source]¶ Returns a table listing the orchestration steps and information about its duration and result.
Parameters: - max_bar_size (int, optional) – Defaults to 30. Size of the bar plot equivalent to 100% of the execution time.
- time_unit (str, optional) – Defaults to ‘s’. Step duration unit. ms: milliseconds, s: seconds or min: minutes.
- show_minions (bool) – Whether or not to display the minions that executed a step in the orchestration.
Returns: A console printable table representation of the orchestration.
Return type: