ironic.objects.firmware module

class ironic.objects.firmware.FirmwareComponent(context=None, **kwargs)[source]

Bases: IronicObject

VERSION = '1.1'

Object version field

Each service has its set of objects, each with a version attached. When a client attempts to call an object method, the server checks to see if the version of that object matches (in a compatible way) its object implementation. If so, cool, and if not, fail.

This version is allowed to have three parts, X.Y.Z, where the .Z element is reserved for stable branch backports. The .Z is ignored for the purposes of triggering a backport, which means anything changed under a .Z must be additive and non-destructive such that a node that knows about X.Y can consider X.Y.Z equivalent.

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)}

The fields present in this object as key:field pairs.

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
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.1'

Object version field

Each service has its set of objects, each with a version attached. When a client attempts to call an object method, the server checks to see if the version of that object matches (in a compatible way) its object implementation. If so, cool, and if not, fail.

This version is allowed to have three parts, X.Y.Z, where the .Z element is reserved for stable branch backports. The .Z is ignored for the purposes of triggering a backport, which means anything changed under a .Z must be additive and non-destructive such that a node that knows about X.Y can consider X.Y.Z equivalent.

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)}

The fields present in this object as key:field pairs.

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
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