awslimitchecker.alerts.dummy module

class awslimitchecker.alerts.dummy.Dummy(region_name, **_)[source]

Bases: awslimitchecker.alerts.base.AlertProvider

Initialize an AlertProvider class. This MUST be overridden by subclasses. All configuration must be passed as keyword arguments to the class constructor (these come from --alert-config CLI arguments). Any dependency imports must be made in the constructor. The constructor should do as much as possible to validate configuration.

Parameters:region_name (str) – the name of the region we’re connected to
__init__(region_name, **_)[source]

Initialize an AlertProvider class. This MUST be overridden by subclasses. All configuration must be passed as keyword arguments to the class constructor (these come from --alert-config CLI arguments). Any dependency imports must be made in the constructor. The constructor should do as much as possible to validate configuration.

Parameters:region_name (str) – the name of the region we’re connected to
__module__ = 'awslimitchecker.alerts.dummy'
on_critical(problems, problem_str, exc=None, duration=None)[source]

Method called when the run encountered errors, or at least one critical threshold was met or crossed.

Parameters:
  • problems (dict or None) – dict of service name to nested dict of limit name to limit, same format as the return value of check_thresholds(). None if exc is specified.
  • problem_str (str or None) – String representation of problems, as displayed in awslimitchecker command line output. None if exc is specified.
  • exc (Exception) – Exception object that was raised during the run (optional)
  • duration (float) – duration of the run
on_success(duration=None)[source]

Method called when no thresholds were breached, and run completed successfully. Should resolve any open incidents (if the service supports that functionality) or else simply return.

Parameters:duration (float) – duration of the usage/threshold checking run
on_warning(problems, problem_str, duration=None)[source]

Method called when one or more warning thresholds were crossed, but no criticals and the run did not encounter any errors.

Parameters:
  • problems (dict or None) – dict of service name to nested dict of limit name to limit, same format as the return value of check_thresholds().
  • problem_str (str or None) – String representation of problems, as displayed in awslimitchecker command line output.
  • duration (float) – duration of the run