congress.datasources.doctor_driver module

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 https://wiki.opnfv.org/display/doctor/Doctor+Home 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": "compute.host.down",
    "details": {
        "hostname": "compute1",
        "status": "down",
        "monitor": "zabbix1",
        "monitor_event_id": "111"
    }
  },
  .....
]
TRANSLATORS = [{'table-name': 'events', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT', 'objects-extract-fn': <function flatten_events>}]
events_translator = {'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'objects-extract-fn': <function flatten_events at 0x7faa464e72a8>, 'selector-type': 'DICT_SELECTOR', 'table-name': 'events', 'translation-type': 'HDICT'}
flatten_events()
static get_datasource_info()
safe_id()
value_trans = {'translation-type': 'VALUE'}
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.