ironic.objects.firmware module¶
- class ironic.objects.firmware.FirmwareComponent(context=None, **kwargs)[source]¶
Bases:
IronicObject
- VERSION = '1.0'¶
- property component¶
- create(context=None)[source]¶
Create a Firmware record in the DB.
- Parameters:
context – Security context.
- Raises:
NodeNotFound if the node is not found.
- Raises:
FirmwareComponentAlreadyExists if the record already exists.
- property created_at¶
- property current_version¶
- dbapi = <oslo_db.api.DBAPI object>¶
- fields = {'component': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'current_version': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'initial_version': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'last_version_flashed': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
- classmethod get(context, node_id, name)[source]¶
Get a FirmwareComponent based on its node_id and name.
- Parameters:
context – Security context.
node_id – The node id.
name – The Firmware Component name.
- Raises:
NodeNotFound if the node id is not found.
- Raises:
FirmwareComponentNotFound if the Firmware Component name is not found.
- Returns:
A :class:’FirmwareComponent’ object.
- property id¶
- property initial_version¶
- property last_version_flashed¶
- property node_id¶
- save(context=None)[source]¶
Save updates to this Firmware Component.
Updates will be made column by column based on the result of self.what_changed()
- Parameters:
context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: FirmwareComponent(context)
- Raises:
NodeNotFound if the node id is not found.
- Raises:
FirmwareComponentNotFound if the component is not found.
- property updated_at¶
- class ironic.objects.firmware.FirmwareComponentList(*args, **kwargs)[source]¶
Bases:
IronicObjectListBase
,IronicObject
- VERSION = '1.0'¶
- property created_at¶
- dbapi = <oslo_db.api.DBAPI object>¶
- fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'objects': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
- classmethod get_by_node_id(context, node_id)[source]¶
Get FirmwareComponent based on node_id.
- Parameters:
context – Security context.
node_id – The node id.
- Raises:
NodeNotFound if the node is not found.
- Returns:
A list of FirmwareComponent objects.
- property objects¶
- classmethod sync_firmware_components(context, node_id, components)[source]¶
Returns a list of create/update components.
This method sync with the ‘firmware_information’ database table and sorts three lists - create / update / unchanged components.
- Parameters:
context – Security context.
node_id – The node id.
components – List of FirmwareComponents.
- Returns:
A 3-tuple of lists of Firmware Components to be created, updated and unchanged.
- property updated_at¶