Optional plugins

Module contents

class probator.plugins.Worker(name, interval, entry_point)

Bases: tuple

entry_point

Alias for field number 2

interval

Alias for field number 1

name

Alias for field number 0

class probator.plugins.CollectorType

Bases: enum.Enum

An enumeration.

class probator.plugins.BootstrappedBasePlugin

Bases: probator.plugins.BasePlugin, abc.ABC

static bootstrap()

Bootstrapping method for the plugin

class probator.plugins.BaseAuditor

Bases: probator.plugins.BootstrappedBasePlugin, abc.ABC

ns

Namespace prefix for configuration settings

interval

Interval, in minutes, of how frequently the auditor executus

run(*args, **kwargs)

Main worker entry point for the auditor

class probator.plugins.BaseAuthPlugin

Bases: probator.plugins.BasePlugin, abc.ABC

bootstrap()

Default bootstrapping method, auth plugin’s can do initialization tasks here, will only be run on startup of the API server.

Returns:None
class probator.plugins.BaseCollector

Bases: probator.plugins.BasePlugin, abc.ABC

process_resources(*, resource_class, account_id, location, new_resources, existing_resources)
Parameters:
  • resource_class (class) – A reference to the Resource class
  • account_id (int) – ID of the account the resource is in
  • location (str, None) – Location of the resource. Optional
  • (dict of str (existing_resources) – NewResource): A dict of resources from the API
  • (dict of strBaseResource): A dict containing all existing resources of the given type
Returns:

None

class probator.plugins.BaseCommand

Bases: probator.plugins.BasePlugin, flask_script.commands.Command, abc.ABC

class probator.plugins.BaseNotifier

Bases: probator.plugins.BasePlugin, abc.ABC

class probator.plugins.BaseScheduler

Bases: probator.plugins.BasePlugin, abc.ABC

load_plugins()

Refresh the list of available collectors and auditors

Returns:None
execute_scheduler()

Entry point to execute the scheduler

The scheduler should execute as a daemon, which will ensure that the worker threads will get scheduled until the process is stopped

execute_worker()

Main worker execution entry point

Each execution of the worker thread should handle a single request from the scheduler and exit, to allow for manual/stepped execution of the jobs. The command line worker utility will handle running schedulers in daemon mode, unless the user explicitly requests single a execution

class probator.plugins.BaseView

Bases: probator.plugins.BasePlugin, flask_restful.Resource