silo.low_code.framework.decorators module

silo.low_code.framework.decorators.cleanup_run(func)

Ensure the framework cleanup steps occur regardless of the outcome

silo.low_code.framework.decorators.framework_execution(func)

Execute the Snippet Framework and perform all required setup / teardown

silo.low_code.framework.decorators.register_cacher(*args, **kwargs)

Decorator to register a cacher

Register a cacher that will be validated once the Framework is initialized.

Parameters
  • get_req_id (callable) – Optional. Function used for generating the request id

  • name (str) – Step Name to use for the Custom Step

  • metadata (dict) – Metadata related to the step

  • read (callable) – Callable function that performs a cache read for fast-forwarding

  • required_args (list) – List of required top-level arguments for the step. If these arguments are not present in the action_arg, the Snippet Framework will not attempt to execute the collection and log a warning message instead.

  • arg_required (bool) – If an argument is required for a step. This denotes a step must have an argument, regardless of the type. This can be used in conjunction with required_args if your step accepts a dictionary or a single value.

Returns

Original object

Return type

object

silo.low_code.framework.decorators.register_processor(*args, **kwargs)

Decorator to register a processor

Register a processor that will be validated once the Framework is initialized. There are no sanity checks on a processor so it should always be valid.

Parameters
  • get_req_id (callable) – Optional. Function used for generating the request id

  • name (str) – Step Name to use for the Custom Step

  • metadata (dict) – Metadata related to the step

  • type (str) – Type of the step.

  • required_args (list) – List of required top-level arguments for the step. If these arguments are not present in the action_arg, the Snippet Framework will not attempt to execute the collection and log a warning message instead.

  • arg_required (bool) – If an argument is required for a step. This denotes a step must have an argument, regardless of the type. This can be used in conjunction with required_args if your step accepts a dictionary or a single value.

Returns

Original object

Return type

object

silo.low_code.framework.decorators.register_requestor(*args, **kwargs)

Decorator for registering Requesters

Register a Requester that will be validated once the Framework is initialized. A Requester must inherit from the class silo.low_code.RequestMaker.

Parameters
  • get_req_id (callable) – Optional. Function used for generating the request id

  • name (str) – Step Name to use for the Custom Step

  • metadata (dict) – Metadata related to the step

  • rewind (callable) – Callable function that updates the action_arg to start the rewinding process

  • required_args (list) – List of required top-level arguments for the step. If these arguments are not present in the action_arg, the Snippet Framework will not attempt to execute the collection and log a warning message instead.

  • arg_required (bool) – If an argument is required for a step. This denotes a step must have an argument, regardless of the type. This can be used in conjunction with required_args if your step accepts a dictionary or a single value.

Returns

Original object

Return type

object

silo.low_code.framework.decorators.register_syntax(*args, **kwargs)

Decorator for registering a Syntax

Register a Syntax that will be validated once the Framework is initialized. An Argument Parser must inherit from the class silo.low_code.ArgParser.

Parameters
  • get_req_id (callable) – Optional. Function used for generating the request id

  • name (str) – Step Name to use for the Custom Step

  • metadata (dict) – Metadata related to the step

Returns

Original object

Return type

object

class silo.low_code.framework.decorators.registered_step(func, reg_type, reg_info)

Bases: tuple

Information to be consumed during registration

Parameters
  • func (callable) – Callable for the step

  • reg_type (int) – Type of registration

  • reg_info (registration_info) – Information related to the step that was extracted during registration

func

Alias for field number 0

reg_info

Alias for field number 2

reg_type

Alias for field number 1

class silo.low_code.framework.decorators.registration_info(name, get_req_id, metadata)

Bases: tuple

Information related to the step that was extracted during registration

Parameters
  • name (str) – Name used by the snippet framework to find the step

  • get_req_id (callable) – Function that is used to generate the request id

  • metadata (dict) – Metadata related to the step

get_req_id

Alias for field number 1

metadata

Alias for field number 2

name

Alias for field number 0

silo.low_code.framework.decorators.reset_decorator_registration()

Remove all requested registrations from decorators

The standard steps (ScienceLogic namespace) are always available. The non-standard steps should be based on import but due to Dynamic collection running serially we are unable to dynamically make them available. Snippet-based imports are always cleared out

silo.low_code.framework.decorators.time_execution(func)

Times the execution from start to finish

silo.low_code.framework.decorators.unique_id_execution(func)

Ensure a unique id is present for each execution