The congress.datasources.doctor_driver Module

class congress.datasources.doctor_driver.DoctorDriver(name=”, args=None)

Bases: congress.datasources.datasource_driver.PushedDataSourceDriver

A DataSource Driver for OPNFV Doctor project.

This driver has a table for Doctor project’s Inspector. Please check for the details about OPNFV Doctor project.

To update the table, call Update row API.

PUT /v1/data-sources/<the driver id>/tables/<table id>/rows

For updating ‘events’ table, the request body should be following style. The request will replace all rows in the table with the body, which means if you update the table with [] it will clear the table. One {} object in the list represents one row of the table.

request body: [


“time”: “2016-02-22T11:48:55Z”, “type”: “”, “details”: {

“hostname”: “compute1”, “status”: “down”, “monitor”: “zabbix1”, “monitor_event_id”: “111”



TRANSLATORS = [{‘table-name’: ‘events’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘objects-extract-fn’: <function flatten_events>, ‘field-translators’: ({‘fieldname’: ‘time’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘type’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘hostname’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘monitor’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘monitor_event_id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}]
events_translator = {‘table-name’: ‘events’, ‘selector-type’: ‘DICT_SELECTOR’, ‘translation-type’: ‘HDICT’, ‘objects-extract-fn’: <function flatten_events>, ‘field-translators’: ({‘fieldname’: ‘time’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘type’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘hostname’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘status’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘monitor’, ‘translator’: {‘translation-type’: ‘VALUE’}}, {‘fieldname’: ‘monitor_event_id’, ‘translator’: {‘translation-type’: ‘VALUE’}})}
static get_datasource_info()
value_trans = {‘translation-type’: ‘VALUE’}