congress.datasources.monasca_driver module

class congress.datasources.monasca_driver.MonascaDriver(name='', args=None)

Bases: congress.datasources.datasource_driver.PollingDataSourceDriver, congress.datasources.datasource_driver.ExecutionDriver

TRANSLATORS = [{'translation-type': 'HDICT', 'table-name': 'metrics', 'selector-type': 'DICT_SELECTOR', 'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'dimensions', 'translator': {'translation-type': 'VDICT', 'table-name': 'dimensions', 'id-col': 'id', 'key-col': 'key', 'val-col': 'value', 'translator': {'translation-type': 'VALUE'}}})}, {'translation-type': 'HDICT', 'table-name': 'statistics', 'selector-type': 'DICT_SELECTOR', 'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'statistics', 'translator': {'translation-type': 'LIST', 'table-name': 'statistics.data', 'id-col': 'name', 'val-col': 'value_col', 'translator': {'translation-type': 'VALUE'}}})}]
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
initialize_update_methods()
metric_translator = {'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'dimensions', 'translator': {'translation-type': 'VDICT', 'table-name': 'dimensions', 'id-col': 'id', 'key-col': 'key', 'val-col': 'value', 'translator': {'translation-type': 'VALUE'}}}), 'selector-type': 'DICT_SELECTOR', 'table-name': 'metrics', 'translation-type': 'HDICT'}
statistics_translator = {'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'statistics', 'translator': {'translation-type': 'LIST', 'table-name': 'statistics.data', 'id-col': 'name', 'val-col': 'value_col', 'translator': {'translation-type': 'VALUE'}}}), 'selector-type': 'DICT_SELECTOR', 'table-name': 'statistics', 'translation-type': 'HDICT'}
update_statistics()
class congress.datasources.monasca_driver.MonascaWebhookDriver(name='', args=None)

Bases: congress.datasources.datasource_driver.PushedDataSourceDriver

DIMENSIONS = 'alarms.metrics.dimensions'
METRICS = 'alarms.metrics'
TRANSLATORS = [{'translation-type': 'HDICT', 'table-name': 'alarm_notification', 'selector-type': 'DICT_SELECTOR', 'field-translators': ({'fieldname': 'alarm_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_definition_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_description', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_timestamp', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'old_state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'message', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'tenant_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'metrics', 'translator': {'translation-type': 'HDICT', 'table-name': 'alarms.metrics', 'parent-key': 'alarm_id', 'parent-col-name': 'alarm_id', 'parent-key-desc': 'ALARM id', 'selector-type': 'DICT_SELECTOR', 'in-list': True, 'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'dimensions', 'translator': {'translation-type': 'VDICT', 'table-name': 'alarms.metrics.dimensions', 'id-col': 'id', 'key-col': 'key', 'val-col': 'value', 'translator': {'translation-type': 'VALUE'}}})}})}]
alarm_notification_translator = {'field-translators': ({'fieldname': 'alarm_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_definition_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_description', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'alarm_timestamp', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'old_state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'message', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'tenant_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'metrics', 'translator': {'translation-type': 'HDICT', 'table-name': 'alarms.metrics', 'parent-key': 'alarm_id', 'parent-col-name': 'alarm_id', 'parent-key-desc': 'ALARM id', 'selector-type': 'DICT_SELECTOR', 'in-list': True, 'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'dimensions', 'translator': {'translation-type': 'VDICT', 'table-name': 'alarms.metrics.dimensions', 'id-col': 'id', 'key-col': 'key', 'val-col': 'value', 'translator': {'translation-type': 'VALUE'}}})}}), 'selector-type': 'DICT_SELECTOR', 'table-name': 'alarm_notification', 'translation-type': 'HDICT'}
static get_datasource_info()
metric_translator = {'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'dimensions', 'translator': {'translation-type': 'VDICT', 'table-name': 'alarms.metrics.dimensions', 'id-col': 'id', 'key-col': 'key', 'val-col': 'value', 'translator': {'translation-type': 'VALUE'}}}), 'in-list': True, 'parent-col-name': 'alarm_id', 'parent-key': 'alarm_id', 'parent-key-desc': 'ALARM id', 'selector-type': 'DICT_SELECTOR', 'table-name': 'alarms.metrics', 'translation-type': 'HDICT'}
set_up_periodic_tasks()