congress.datasources.cinder_driver module

congress.datasources.cinder_driver module

Schema version history

version: 2.1 date: 2016-03-27 changes:

  • Added columns to the volumes table: encrypted, availability_zone, replication_status, multiattach, snapshot_id, source_volid, consistencygroup_id, migration_status
  • Added the attachments table for volume attachment information.

version: 2.0 Initial schema version.

class congress.datasources.cinder_driver.CinderDriver(name='', args=None)

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

ATTACHMENTS = 'attachments'
SERVICES = 'services'
SNAPSHOTS = 'snapshots'
TRANSLATORS = [{'translation-type': 'HDICT', 'table-name': 'volumes', 'selector-type': 'DOT_SELECTOR', 'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'size', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'user_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'description', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'bootable', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'volume_type', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'encrypted', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'availability_zone', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'replication_status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'multiattach', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'snapshot_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'source_volid', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'consistencygroup_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'migration_status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'attachments', 'translator': {'translation-type': 'HDICT', 'table-name': 'attachments', 'parent-key': 'id', 'parent-col-name': 'volume_id', 'parent-key-desc': 'UUID of volume', 'selector-type': 'DICT_SELECTOR', 'in-list': True, 'field-translators': ({'fieldname': 'server_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'attachment_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host_name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'device', 'translator': {'translation-type': 'VALUE'}})}})}, {'translation-type': 'HDICT', 'table-name': 'snapshots', 'selector-type': 'DOT_SELECTOR', 'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'size', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'volume_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}})}, {'translation-type': 'HDICT', 'table-name': 'services', 'selector-type': 'DOT_SELECTOR', 'field-translators': ({'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'binary', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'zone', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'disabled_reason', 'translator': {'translation-type': 'VALUE'}})}]
VOLUMES = 'volumes'
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
initialize_update_method()
services_translator = {'field-translators': ({'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'binary', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'zone', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'state', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'disabled_reason', 'translator': {'translation-type': 'VALUE'}}), 'selector-type': 'DOT_SELECTOR', 'table-name': 'services', 'translation-type': 'HDICT'}
snapshots_translator = {'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'size', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'volume_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}), 'selector-type': 'DOT_SELECTOR', 'table-name': 'snapshots', 'translation-type': 'HDICT'}
value_trans = {'translation-type': 'VALUE'}
volumes_translator = {'field-translators': ({'fieldname': 'id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'size', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'user_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'description', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'bootable', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'volume_type', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'encrypted', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'availability_zone', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'replication_status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'multiattach', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'snapshot_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'source_volid', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'consistencygroup_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'migration_status', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'attachments', 'translator': {'translation-type': 'HDICT', 'table-name': 'attachments', 'parent-key': 'id', 'parent-col-name': 'volume_id', 'parent-key-desc': 'UUID of volume', 'selector-type': 'DICT_SELECTOR', 'in-list': True, 'field-translators': ({'fieldname': 'server_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'attachment_id', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host_name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'device', 'translator': {'translation-type': 'VALUE'}})}}), 'selector-type': 'DOT_SELECTOR', 'table-name': 'volumes', 'translation-type': 'HDICT'}
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.