ironic.objects.node_history module

class ironic.objects.node_history.NodeHistory(context=None, **kwargs)[source]

Bases: IronicObject, VersionedObjectDictCompat

VERSION = '1.2'

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 conductor
create(context=None)[source]

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

Raises:

NodeHistoryNotFound

property event
property event_type
fields = {'conductor': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'event': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'event_type': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'project': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'severity': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'user': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(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, history_ident)[source]

Get a history based on its id or uuid.

Parameters:
  • history_ident – The id or uuid of a history.

  • context – Security context

Returns:

A NodeHistory object.

Raises:

InvalidIdentity

classmethod get_by_id(context, history_id)[source]

Get a NodeHistory object by its integer ID.

Parameters:
  • cls – the NodeHistory

  • context – Security context

  • history_id – The ID of a history.

Returns:

A NodeHistory object.

Raises:

NodeHistoryNotFound

classmethod get_by_uuid(context, uuid)[source]

Get a NodeHistory object by its UUID.

Parameters:
  • cls – the NodeHistory

  • context – Security context

  • uuid – The UUID of a NodeHistory.

Returns:

A NodeHistory object.

Raises:

NodeHistoryNotFound

property id
classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None)[source]

Return a list of NodeHistory objects.

Parameters:
  • cls – the NodeHistory

  • context – Security context.

  • limit – Maximum number of resources to return in a single result.

  • marker – Pagination marker for large data sets.

  • sort_key – Column to sort results by.

  • sort_dir – Direction to sort. “asc” or “desc”.

Returns:

A list of NodeHistory object.

Raises:

InvalidParameterValue

classmethod list_by_node_id(context, node_id, limit=None, marker=None, sort_key=None, sort_dir=None)[source]

Return a list of NodeHistory objects belongs to a given node ID.

Parameters:
  • cls – the NodeHistory

  • context – Security context.

  • node_id – The ID of the node.

  • limit – Maximum number of resources to return in a single result.

  • marker – Pagination marker for large data sets.

  • sort_key – Column to sort results by.

  • sort_dir – Direction to sort. “asc” or “desc”.

Returns:

A list of NodeHistory object.

Raises:

InvalidParameterValue

property node_id
property project
property severity
property updated_at
property user
property uuid