reportingplugins Package¶
elasticsearchreporter
Module¶
-
class
fastr.resources.plugins.reportingplugins.elasticsearchreporter.
ElasticsearchReporter
[source]¶ Bases:
fastr.plugins.reportingplugin.ReportingPlugin
-
__abstractmethods__
= frozenset()¶
-
__init__
()[source]¶ The BasePlugin constructor.
Returns: the created plugin Return type: BasePlugin Raises: FastrPluginNotLoaded – if the plugin did not load correctly
-
__module__
= 'fastr.resources.plugins.reportingplugins.elasticsearchreporter'¶
-
configuration_fields
= {'elasticsearch_debug': (<class 'bool'>, False, 'Setup elasticsearch debug mode to send stdout stderr on job succes'), 'elasticsearch_host': (<class 'str'>, '', 'The elasticsearch host to report to'), 'elasticsearch_index': (<class 'str'>, 'fastr', 'The elasticsearch index to store data in')}¶
-
pimreporter
Module¶
-
class
fastr.resources.plugins.reportingplugins.pimreporter.
BasePimAPI
[source]¶ Bases:
object
Base class for PIM API classes which specifies the methods required to function
-
__abstractmethods__
= frozenset({'pim_log_line', 'pim_update_status', 'pim_finish_run', 'pim_register_run'})¶
-
__dict__
= mappingproxy({'__module__': 'fastr.resources.plugins.reportingplugins.pimreporter', '__doc__': '\n Base class for PIM API classes which specifies the methods required to function\n ', 'pim_update_status': <function BasePimAPI.pim_update_status>, 'pim_register_run': <function BasePimAPI.pim_register_run>, 'pim_finish_run': <function BasePimAPI.pim_finish_run>, 'pim_log_line': <function BasePimAPI.pim_log_line>, '__dict__': <attribute '__dict__' of 'BasePimAPI' objects>, '__weakref__': <attribute '__weakref__' of 'BasePimAPI' objects>, '__abstractmethods__': frozenset({'pim_log_line', 'pim_update_status', 'pim_finish_run', 'pim_register_run'}), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 55})¶
-
__module__
= 'fastr.resources.plugins.reportingplugins.pimreporter'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
pim_finish_run
(network)[source]¶ Set the PIM run to finished and clean up
Parameters: network ( NetworkRun
) – The network run to finish
-
pim_log_line
(record)[source]¶ Send a new line of log record to PIM :type record:
LogRecord
:param record: the log record to send
-
pim_register_run
(network)[source]¶ Send the basic Network layout to PIM and register the run.
Parameters: network ( NetworkRun
) – The network run to register to PIM
-
-
class
fastr.resources.plugins.reportingplugins.pimreporter.
PimAPIv2
(uri=None)[source]¶ Bases:
object
Class to publish to PIM
-
NODE_CLASSES
= {'ConstantNodeRun': 'constant', 'NodeRun': 'node', 'SinkNodeRun': 'sink', 'SourceNodeRun': 'source'}¶
-
PIM_STATUS_MAPPING
= {<JobState.nonexistent: ('nonexistent', 'idle', False)>: 5, <JobState.created: ('created', 'idle', False)>: 0, <JobState.queued: ('queued', 'idle', False)>: 0, <JobState.hold: ('hold', 'idle', False)>: 0, <JobState.running: ('running', 'in_progress', False)>: 1, <JobState.execution_done: ('execution_done', 'in_progress', False)>: 1, <JobState.execution_failed: ('execution_failed', 'in_progress', True)>: 1, <JobState.processing_callback: ('processing_callback', 'in_progress', False)>: 1, <JobState.finished: ('finished', 'done', False)>: 2, <JobState.failed: ('failed', 'done', True)>: 3, <JobState.cancelled: ('cancelled', 'done', True)>: 4}¶
-
STATUS_TYPES
= [{'color': '#aaccff', 'description': 'Jobs that are waiting for input', 'title': 'idle'}, {'color': '#daa520', 'description': 'Jobs that are running', 'title': 'running'}, {'color': '#23b22f', 'description': 'Jobs that finished successfully', 'title': 'success'}, {'color': '#dd3311', 'description': 'Jobs that have failed', 'title': 'failed'}, {'color': '#334477', 'description': 'Jobs which were cancelled', 'title': 'cancelled'}, {'color': '#ccaa99', 'description': 'Jobs with an undefined state', 'title': 'undefined'}]¶
-
__dict__
= mappingproxy({'__module__': 'fastr.resources.plugins.reportingplugins.pimreporter', '__doc__': '\n Class to publish to PIM\n ', 'PIM_STATUS_MAPPING': {<JobState.nonexistent: ('nonexistent', 'idle', False)>: 5, <JobState.created: ('created', 'idle', False)>: 0, <JobState.queued: ('queued', 'idle', False)>: 0, <JobState.hold: ('hold', 'idle', False)>: 0, <JobState.running: ('running', 'in_progress', False)>: 1, <JobState.execution_done: ('execution_done', 'in_progress', False)>: 1, <JobState.execution_failed: ('execution_failed', 'in_progress', True)>: 1, <JobState.processing_callback: ('processing_callback', 'in_progress', False)>: 1, <JobState.finished: ('finished', 'done', False)>: 2, <JobState.failed: ('failed', 'done', True)>: 3, <JobState.cancelled: ('cancelled', 'done', True)>: 4}, 'NODE_CLASSES': {'NodeRun': 'node', 'SourceNodeRun': 'source', 'ConstantNodeRun': 'constant', 'SinkNodeRun': 'sink'}, 'STATUS_TYPES': [{'color': '#aaccff', 'description': 'Jobs that are waiting for input', 'title': 'idle'}, {'color': '#daa520', 'description': 'Jobs that are running', 'title': 'running'}, {'color': '#23b22f', 'description': 'Jobs that finished successfully', 'title': 'success'}, {'color': '#dd3311', 'description': 'Jobs that have failed', 'title': 'failed'}, {'color': '#334477', 'description': 'Jobs which were cancelled', 'title': 'cancelled'}, {'color': '#ccaa99', 'description': 'Jobs with an undefined state', 'title': 'undefined'}], '__init__': <function PimAPIv2.__init__>, 'create_job_data': <function PimAPIv2.create_job_data>, 'pim_update_status': <function PimAPIv2.pim_update_status>, 'job_update_loop': <function PimAPIv2.job_update_loop>, 'pim_serialize_node': <function PimAPIv2.pim_serialize_node>, 'pim_serialize_macro': <function PimAPIv2.pim_serialize_macro>, 'pim_serialize_network': <function PimAPIv2.pim_serialize_network>, 'pim_serialize_link': <function PimAPIv2.pim_serialize_link>, 'pim_register_run': <function PimAPIv2.pim_register_run>, 'pim_finish_run': <function PimAPIv2.pim_finish_run>, 'pim_log_line': <function PimAPIv2.pim_log_line>, '__dict__': <attribute '__dict__' of 'PimAPIv2' objects>, '__weakref__': <attribute '__weakref__' of 'PimAPIv2' objects>})¶
-
__module__
= 'fastr.resources.plugins.reportingplugins.pimreporter'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
fastr.resources.plugins.reportingplugins.pimreporter.
PimReporter
[source]¶ Bases:
fastr.plugins.reportingplugin.ReportingPlugin
-
SUPPORTED_APIS
= {2: <class 'fastr.resources.plugins.reportingplugins.pimreporter.PimAPIv2'>}¶
-
__abstractmethods__
= frozenset()¶
-
__init__
()[source]¶ The BasePlugin constructor.
Returns: the created plugin Return type: BasePlugin Raises: FastrPluginNotLoaded – if the plugin did not load correctly
-
__module__
= 'fastr.resources.plugins.reportingplugins.pimreporter'¶
-
configuration_fields
= {'pim_batch_size': (<class 'int'>, 100, 'Maximum number of jobs that can be send to PIM in a single interval'), 'pim_debug': (<class 'bool'>, False, 'Setup PIM debug mode to send stdout stderr on job succes'), 'pim_host': (<class 'str'>, '', 'The PIM host to report to'), 'pim_update_interval': (<class 'float'>, 2.5, 'The interval in which to send jobs to PIM')}¶
-