ironic.objects.deploy_template module

class ironic.objects.deploy_template.DeployTemplate(context=None, **kwargs)[source]

Bases: IronicObject, VersionedObjectDictCompat

VERSION = '1.1'
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)}
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'
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)}
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'
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)}
property name
property steps
property updated_at
property uuid