The congress.datasources.vCenter_driver Module

class congress.datasources.vCenter_driver.VCenterDriver(name='', args=None, session=None)

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

HOSTS = 'hosts'
HOST_DNS = 'host.DNS_IPs'
HOST_PNICS = 'host.PNICs'
HOST_VNICS = 'host.VNICs'
TRANSLATORS = [{'table-name': 'hosts', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid'}, {'translator': {'id-col': 'Host:DNS_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'host.DNS_IPs', 'val-col': 'DNS_IPs', 'translation-type': 'LIST'}, 'fieldname': 'host.DNS_IPs', 'col': 'Host:DNS_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'host.PNICs', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'ipAddress'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'subnetMask'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'host.VNICs', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'portgroup'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'ipAddress'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'subnetMask'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'vms', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'pathName'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'CpuDemand'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'CpuUsage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'memorySizeMB'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'MemoryUsage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'committedStorage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uncommittedStorage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'annotation'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}]
VMS = 'vms'
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
hosts_translator = {'table-name': 'hosts', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid'}, {'translator': {'id-col': 'Host:DNS_id', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'host.DNS_IPs', 'val-col': 'DNS_IPs', 'translation-type': 'LIST'}, 'fieldname': 'host.DNS_IPs', 'col': 'Host:DNS_id'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
pnic_translator = {'table-name': 'host.PNICs', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'ipAddress'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'subnetMask'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
update_from_datasource()

Called when it is time to pull new data from this datasource.

Pulls lists of objects from vCenter, if the data does not match the correspondig table in the driver’s raw state or has not yet been added to the state, the driver calls methods to parse this data.

value_trans = {'translation-type': 'VALUE'}
vms_translator = {'table-name': 'vms', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'pathName'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'status'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'CpuDemand'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'CpuUsage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'memorySizeMB'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'MemoryUsage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'committedStorage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uncommittedStorage'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'annotation'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}
vnic_translator = {'table-name': 'host.VNICs', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'host_uuid'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'device'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'mac'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'portgroup'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'ipAddress'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'subnetMask'}), 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT'}