The congress.datasources.ironic_driver Module

class congress.datasources.ironic_driver.IronicDriver(name='', args=None)

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

ACTIVE_HOSTS = 'active_hosts'
CHASSISES = 'chassises'
DRIVERS = 'drivers'
NODES = 'nodes'
NODE_PROPERTIES = 'node_properties'
PORTS = 'ports'
TRANSLATORS = [{'selector-type': 'DOT_SELECTOR', 'table-name': 'chassises', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}, {'selector-type': 'DOT_SELECTOR', 'table-name': 'nodes', 'translation-type': 'HDICT', 'field-translators': ({'desc': '', 'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'desc': '', 'fieldname': 'chassis_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'owner_chassis'}, {'desc': '', 'fieldname': 'power_state', 'translator': {'translation-type': 'VALUE'}}, {'desc': '', 'fieldname': 'maintenance', 'translator': {'translation-type': 'VALUE'}}, {'desc': '', 'fieldname': 'properties', 'translator': {'selector-type': 'DICT_SELECTOR', 'table-name': 'node_properties', 'parent-key': 'id', 'parent-col-name': 'properties', 'in-list': False, 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'memory_mb', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'cpu_arch', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'local_gb', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'cpus', 'translator': {'translation-type': 'VALUE'}})}}, {'fieldname': 'driver', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'instance_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'running_instance'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'provision_updated_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}, {'selector-type': 'DOT_SELECTOR', 'table-name': 'ports', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'fieldname': 'node_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'owner_node'}, {'fieldname': 'address', 'translator': {'translation-type': 'VALUE'}, 'col': 'mac_address'}, {'fieldname': 'extra', 'translator': {'translation-type': 'VALUE', 'extract-fn': <function safe_port_extra at 0x7fdb9a1dea28>}, 'col': 'vif_port_id'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}, {'selector-type': 'DOT_SELECTOR', 'table-name': 'drivers', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'hosts', 'translator': {'val-col': 'hosts', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'active_hosts', 'parent-key': 'name', 'parent-col-name': 'name', 'translation-type': 'LIST'}})}]
chassises_translator = {'selector-type': 'DOT_SELECTOR', 'table-name': 'chassises', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}
drivers_translator = {'selector-type': 'DOT_SELECTOR', 'table-name': 'drivers', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'name', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'hosts', 'translator': {'val-col': 'hosts', 'translator': {'translation-type': 'VALUE'}, 'table-name': 'active_hosts', 'parent-key': 'name', 'parent-col-name': 'name', 'translation-type': 'LIST'}})}
execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
get_ironic_credentials(creds)
initialize_update_methods()
nodes_translator = {'selector-type': 'DOT_SELECTOR', 'table-name': 'nodes', 'translation-type': 'HDICT', 'field-translators': ({'desc': '', 'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'desc': '', 'fieldname': 'chassis_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'owner_chassis'}, {'desc': '', 'fieldname': 'power_state', 'translator': {'translation-type': 'VALUE'}}, {'desc': '', 'fieldname': 'maintenance', 'translator': {'translation-type': 'VALUE'}}, {'desc': '', 'fieldname': 'properties', 'translator': {'selector-type': 'DICT_SELECTOR', 'table-name': 'node_properties', 'parent-key': 'id', 'parent-col-name': 'properties', 'in-list': False, 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'memory_mb', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'cpu_arch', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'local_gb', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'cpus', 'translator': {'translation-type': 'VALUE'}})}}, {'fieldname': 'driver', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'instance_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'running_instance'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'provision_updated_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}
ports_translator = {'selector-type': 'DOT_SELECTOR', 'table-name': 'ports', 'translation-type': 'HDICT', 'field-translators': ({'fieldname': 'uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'id'}, {'fieldname': 'node_uuid', 'translator': {'translation-type': 'VALUE'}, 'col': 'owner_node'}, {'fieldname': 'address', 'translator': {'translation-type': 'VALUE'}, 'col': 'mac_address'}, {'fieldname': 'extra', 'translator': {'translation-type': 'VALUE', 'extract-fn': <function safe_port_extra at 0x7fdb9a1dea28>}, 'col': 'vif_port_id'}, {'fieldname': 'created_at', 'translator': {'translation-type': 'VALUE'}}, {'fieldname': 'updated_at', 'translator': {'translation-type': 'VALUE'}})}
safe_id(x)
safe_port_extra(x)
value_trans = {'translation-type': 'VALUE'}