honeycomb.integrationmanager package

Submodules

honeycomb.integrationmanager.defs module

Honeycomb integrations definitions and constants.

class honeycomb.integrationmanager.defs.IntegrationAlertStatuses[source]

Bases: honeycomb.defs.IBaseType

Provides information about the alert status in queue.

DONE = BaseNameLabel(name='done', label='Done')
ERROR_MISSING_SEND_FIELDS = BaseNameLabel(name='error_missing', label='Error. Missing required alert data.')
ERROR_POLLING = BaseNameLabel(name='error_polling', label='Error polling')
ERROR_POLLING_FORMATTING = BaseNameLabel(name='error_polling_formatting', label='Error polling. Result format not recognized.')
ERROR_SENDING = BaseNameLabel(name='error_sending', label='Error sending')
ERROR_SENDING_FORMATTING = BaseNameLabel(name='error_sending_formatting', label='Error sending. Result format not recognized.')
IN_POLLING = BaseNameLabel(name='in_polling', label='Polling')
PENDING = BaseNameLabel(name='pending', label='Pending')
POLLING = BaseNameLabel(name='polling', label='Polling')
class honeycomb.integrationmanager.defs.IntegrationTypes[source]

Bases: honeycomb.defs.IBaseType

Integration types.

Currently only output event is supported.

EVENT_OUTPUT = BaseNameLabel(name='event_output', label='Event output')

honeycomb.integrationmanager.error_messages module

Honeycomb integration error messages.

honeycomb.integrationmanager.exceptions module

Honeycomb Output Integration Exceptions.

exception honeycomb.integrationmanager.exceptions.IntegrationMissingRequiredFieldError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationMissingRequiredFieldError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

exception honeycomb.integrationmanager.exceptions.IntegrationNoMethodImplementationError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationNoMethodImplementationError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

exception honeycomb.integrationmanager.exceptions.IntegrationNotFound(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

Integration not found.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

msg_format = 'Cannot find integration named {}, try installing it?'
exception honeycomb.integrationmanager.exceptions.IntegrationOutputFormatError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationOutputFormatError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

exception honeycomb.integrationmanager.exceptions.IntegrationPackageError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationPackageError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

exception honeycomb.integrationmanager.exceptions.IntegrationPollEventError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationPollEventError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

exception honeycomb.integrationmanager.exceptions.IntegrationSendEventError(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

IntegrationSendEventError.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

msg_format = 'Error sending integration event: {}'
exception honeycomb.integrationmanager.exceptions.IntegrationTestFailed(*args, **kwargs)[source]

Bases: honeycomb.exceptions.PluginError

Integration not found.

Raise ClickException and log msg with relevant debugging info from the frame that raised the exception.

msg_format = 'Integration test failed, details: {}'

honeycomb.integrationmanager.integration_utils module

Honeycomb Integration Manager.

class honeycomb.integrationmanager.integration_utils.BaseIntegration(integration_data)[source]

Bases: object

Base Output Integration Class.

Use __init__() to set up any prerequisites needed before sending events, validate paramaters, etc.

Parameters:integration_data (dict) – Integration parameters
Raises:IntegrationMissingRequiredFieldError – If a required field is missing.
format_output_data(output_data)[source]

Process and format the output_data returned by send_event() before display.

This is currently only relevant for MazeRunner, if you don’t return an output this should return output_data without change.

Parameters:output_data – As returned by send_event()
Return type:dict
Returns:MazeRunner compatible UI output.
Raises:IntegrationOutputFormatError – If there’s a problem formatting the output data.
poll_for_updates(integration_output_data)[source]

Poll external service for updates.

If service has enabled polling, this method will be called periodically and should act like send_event()

Parameters:integration_output_data – Output data returned by previous send_event() or poll_for_updates()
Returns:See send_event()
Raises:IntegrationPollEventError – If there’s a problem polling for updates.
send_event(alert_dict)[source]

Send alert event to external integration.

Parameters:

alert_dict – A dictionary with all the alert fields.

Return type:

tuple(dict(output_data), object(output_file))

Raises:
Returns:

A tuple where the first value is a dictionary with information to display in the UI, and the second is an optional file to be attached. If polling is enabled, the returned output_data will be passed to poll_for_updates(). If your integration returns nothing, you should return ({}, None).

test_connection(integration_data)[source]

Perform a test to ensure the integration is configured correctly.

This could include testing authentication or performing a test query.

Parameters:integration_data – Integration arguments.
Returns:success
Return type:tuple(bool(success), str(response))

honeycomb.integrationmanager.models module

Honeycomb integration models.

class honeycomb.integrationmanager.models.ConfiguredIntegration(name: str, path: str, integration: honeycomb.integrationmanager.models.Integration, send_muted: bool = False, created_at: datetime.datetime = NOTHING)[source]

Bases: object

Configured integration model.

class honeycomb.integrationmanager.models.Integration(parameters: str, display_name: str, required_fields: list, polling_enabled: bool, integration_type: str, max_send_retries: int, supported_event_types: list, test_connection_enabled: bool, module=None, description: str = None, polling_duration: datetime.timedelta = 0)[source]

Bases: object

Integration model.

class honeycomb.integrationmanager.models.IntegrationAlert(alert: honeycomb.decoymanager.models.Alert, status: str, retries: int, configured_integration: honeycomb.integrationmanager.models.ConfiguredIntegration)[source]

Bases: object

Integration alert model.

honeycomb.integrationmanager.registration module

Honeycomb service manager.

honeycomb.integrationmanager.registration.get_integration_module(integration_path)[source]

Add custom paths to sys and import integration module.

Parameters:integration_path – Path to integration folder
honeycomb.integrationmanager.registration.register_integration(package_folder)[source]

Register a honeycomb integration.

Parameters:package_folder – Path to folder with integration to load
Returns:Validated integration object
Return type:honeycomb.utils.defs.Integration()

honeycomb.integrationmanager.tasks module

Honeycomb integration tasks.

honeycomb.integrationmanager.tasks.configure_integration(path)[source]

Configure and enable an integration.

honeycomb.integrationmanager.tasks.create_integration_alert_and_call_send(alert, configured_integration)[source]

Create an IntegrationAlert object and send it to Integration.

honeycomb.integrationmanager.tasks.get_current_datetime_utc()[source]

Return a datetime object localized to UTC.

honeycomb.integrationmanager.tasks.get_valid_configured_integrations(alert)[source]

Return a list of integrations for alert filtered by alert_type.

Returns:A list of relevant integrations
honeycomb.integrationmanager.tasks.poll_integration_alert_data(integration_alert)[source]

Poll for updates on waiting IntegrationAlerts.

honeycomb.integrationmanager.tasks.poll_integration_information_for_waiting_integration_alerts()[source]

poll_integration_information_for_waiting_integration_alerts.

honeycomb.integrationmanager.tasks.send_alert_to_configured_integration(integration_alert)[source]

Send IntegrationAlert to configured integration.

honeycomb.integrationmanager.tasks.send_alert_to_subscribed_integrations(alert)[source]

Send Alert to relevant integrations.

Module contents

Honeycomb Output Manager.