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 = [{'table-name': 'volumes', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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': {'parent-key': 'id', 'in-list': True, 'parent-key-desc': 'UUID of volume', 'parent-col-name': 'volume_id', 'table-name': 'attachments', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'server_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'attachment_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, 'fieldname': 'attachments'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'snapshots', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'services', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}]
VOLUMES = 'volumes'
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
initialize_update_method()
services_translator = {'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'selector-type': 'DOT_SELECTOR', 'table-name': 'services', 'translation-type': 'HDICT'}
snapshots_translator = {'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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'}), 'selector-type': 'DOT_SELECTOR', 'table-name': 'snapshots', 'translation-type': 'HDICT'}
value_trans = {'translation-type': 'VALUE'}
volumes_translator = {'field-translators': ({'translator': {'translation-type': 'VALUE'}, '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': {'parent-key': 'id', 'in-list': True, 'parent-key-desc': 'UUID of volume', 'parent-col-name': 'volume_id', 'table-name': 'attachments', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'server_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'attachment_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, 'fieldname': 'attachments'}), '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.