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 = [{'selector-type': 'DICT_SELECTOR', 'table-name': 'hosts', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host.DNS_IPs', 'translator': {'table-name': 'host.DNS_IPs', 'val-col': 'DNS_IPs', 'translator': {'translation-type': 'VALUE'}, 'translation-type': 'LIST', 'id-col': 'Host:DNS_id'}, 'col': 'Host:DNS_id'})}, {'selector-type': 'DICT_SELECTOR', 'table-name': 'host.PNICs', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}, {'selector-type': 'DICT_SELECTOR', 'table-name': 'host.VNICs', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}, {'selector-type': 'DICT_SELECTOR', 'table-name': 'vms', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}]
VMS = 'vms'
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
hosts_translator = {'selector-type': 'DICT_SELECTOR', 'table-name': 'hosts', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'host.DNS_IPs', 'translator': {'table-name': 'host.DNS_IPs', 'val-col': 'DNS_IPs', 'translator': {'translation-type': 'VALUE'}, 'translation-type': 'LIST', 'id-col': 'Host:DNS_id'}, 'col': 'Host:DNS_id'})}
pnic_translator = {'selector-type': 'DICT_SELECTOR', 'table-name': 'host.PNICs', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}
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 = {'selector-type': 'DICT_SELECTOR', 'table-name': 'vms', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}
vnic_translator = {'selector-type': 'DICT_SELECTOR', 'table-name': 'host.VNICs', 'translation-type': 'HDICT', 'field-translators': ({'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', 'translator': {'translation-type': 'VALUE'}})}