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= [{'table-name': 'chassises', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'nodes', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'chassis_uuid', 'col': 'owner_chassis', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'power_state', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'maintenance', 'desc': ''}, {'translator': {'in-list': False, 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT', 'parent-key': 'id', 'parent-col-name': 'properties', 'table-name': 'node_properties', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'memory_mb'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'cpu_arch'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'local_gb'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'cpus'})}, 'fieldname': 'properties', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'driver'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'instance_uuid', 'col': 'running_instance'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provision_updated_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'ports', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'node_uuid', 'col': 'owner_node'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'address', 'col': 'mac_address'}, {'translator': {'extract-fn': <function safe_port_extra at 0x7f25788e8938>, 'translation-type': 'VALUE'}, 'fieldname': 'extra', 'col': 'vif_port_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}, {'table-name': 'drivers', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translator': {'translation-type': 'VALUE'}, 'val-col': 'hosts', 'translation-type': 'LIST', 'parent-key': 'name', 'parent-col-name': 'name', 'table-name': 'active_hosts'}, 'fieldname': 'hosts'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}]¶
-
chassises_translator= {'table-name': 'chassises', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}¶
-
drivers_translator= {'table-name': 'drivers', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'name'}, {'translator': {'translator': {'translation-type': 'VALUE'}, 'val-col': 'hosts', 'translation-type': 'LIST', 'parent-key': 'name', 'parent-col-name': 'name', 'table-name': 'active_hosts'}, 'fieldname': 'hosts'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}¶
-
execute(action, action_args)¶ Overwrite ExecutionDriver.execute().
-
static
get_datasource_info()¶
-
get_ironic_credentials(creds)¶
-
initialize_update_methods()¶
-
nodes_translator= {'table-name': 'nodes', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'chassis_uuid', 'col': 'owner_chassis', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'power_state', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'maintenance', 'desc': ''}, {'translator': {'in-list': False, 'selector-type': 'DICT_SELECTOR', 'translation-type': 'HDICT', 'parent-key': 'id', 'parent-col-name': 'properties', 'table-name': 'node_properties', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'memory_mb'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'cpu_arch'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'local_gb'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'cpus'})}, 'fieldname': 'properties', 'desc': ''}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'driver'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'instance_uuid', 'col': 'running_instance'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'provision_updated_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}¶
-
ports_translator= {'table-name': 'ports', 'field-translators': ({'translator': {'translation-type': 'VALUE'}, 'fieldname': 'uuid', 'col': 'id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'node_uuid', 'col': 'owner_node'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'address', 'col': 'mac_address'}, {'translator': {'extract-fn': <function safe_port_extra at 0x7f25788e8938>, 'translation-type': 'VALUE'}, 'fieldname': 'extra', 'col': 'vif_port_id'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'created_at'}, {'translator': {'translation-type': 'VALUE'}, 'fieldname': 'updated_at'}), 'selector-type': 'DOT_SELECTOR', 'translation-type': 'HDICT'}¶
-
safe_id(x)¶
-
safe_port_extra(x)¶
-
value_trans= {'translation-type': 'VALUE'}¶
-