ironic.objects.deploy_template module

class ironic.objects.deploy_template.DeployTemplate(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.

create(context=None)[source]

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

Raises:

DeployTemplateDuplicateName if a deploy template with the same name exists.

Raises:

DeployTemplateAlreadyExists if a deploy template with the same UUID exists.

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

Delete the DeployTemplate 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.: DeployTemplate(context).

Raises:

DeployTemplateNotFound if the deploy template no longer appears in the database.

property extra
fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'steps': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}

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

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
classmethod get_by_id(context, template_id)[source]

Find a deploy template based on its integer ID.

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

  • template_id – The ID of a deploy template.

Raises:

DeployTemplateNotFound if the deploy template no longer appears in the database.

Returns:

a DeployTemplate object.

classmethod get_by_name(context, name)[source]

Find a deploy template based on its name.

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

  • name – The name of a deploy template.

Raises:

DeployTemplateNotFound if the deploy template no longer appears in the database.

Returns:

a DeployTemplate object.

classmethod get_by_uuid(context, uuid)[source]

Find a deploy template based on its UUID.

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

  • uuid – The UUID of a deploy template.

Raises:

DeployTemplateNotFound if the deploy template no longer appears in the database.

Returns:

a DeployTemplate object.

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

Return a list of DeployTemplate objects.

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.: DeployTemplate(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 DeployTemplate objects.

classmethod list_by_names(context, names)[source]

Return a list of DeployTemplate objects matching a set of names.

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

  • names – a list of names to filter by.

Returns:

a list of DeployTemplate objects.

property name
refresh(context=None)[source]

Loads updates for this deploy template.

Loads a deploy template with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded template column by column, if there are any updates.

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

Raises:

DeployTemplateNotFound if the deploy template no longer appears in the database.

save(context=None)[source]

Save updates to this DeployTemplate.

Column-wise updates will be made 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.: DeployTemplate(context)

Raises:

DeployTemplateDuplicateName if a deploy template with the same name exists.

Raises:

DeployTemplateNotFound if the deploy template does not exist.

property steps
property updated_at
property uuid
class ironic.objects.deploy_template.DeployTemplateCRUDNotification(context=None, **kwargs)[source]

Bases: NotificationBase

Notification emitted on deploy template API operations.

VERSION = '1.0'

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
property event_type
fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'event_type': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'level': NotificationLevel(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('debug', 'info', 'warning', 'error', 'critical')), 'payload': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'publisher': Object(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(),
}
property level
property payload
property publisher
property updated_at
class ironic.objects.deploy_template.DeployTemplateCRUDPayload(deploy_template, **kwargs)[source]

Bases: NotificationPayloadBase

SCHEMA = {'created_at': ('deploy_template', 'created_at'), 'extra': ('deploy_template', 'extra'), 'name': ('deploy_template', 'name'), 'steps': ('deploy_template', 'steps'), 'updated_at': ('deploy_template', 'updated_at'), 'uuid': ('deploy_template', 'uuid')}
VERSION = '1.0'

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
property extra
fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'steps': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}

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

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
property name
property steps
property updated_at
property uuid