ironic.objects.node_inventory module

class ironic.objects.node_inventory.NodeInventory(context=None, **kwargs)[source]

Bases: IronicObject, VersionedObjectDictCompat

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.

create(context=None)[source]

Create a NodeInventory record in the DB.

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.: NodeHistory(context)

property created_at
dbapi = <oslo_db.api.DBAPI object>
destroy(context=None)[source]

Delete the NodeInventory from the DB.

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.: NodeInventory(context)

Raises:

NodeInventoryNotFound

fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'inventory_data': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'plugin_data': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), '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 a NodeInventory object by its node ID.

Parameters:
  • cls – the NodeInventory

  • context – Security context

  • uuid – The UUID of a NodeInventory.

Returns:

A NodeInventory object.

Raises:

NodeInventoryNotFound

property id
property inventory_data
property node_id
property plugin_data
property updated_at