ironic.objects.runbook module¶
- class ironic.objects.runbook.Runbook(context=None, **kwargs)[source]¶
Bases:
IronicObject
,VersionedObjectDictCompat
- VERSION = '1.0'¶
- create(context=None)[source]¶
Create a Runbook record in the DB.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
- Raises:
RunbookDuplicateName if a runbook with the same name exists.
- Raises:
RunbookAlreadyExists if a runbook with the same UUID exists.
- property created_at¶
- dbapi = <oslo_db.api.DBAPI object>¶
- destroy()[source]¶
Delete the Runbook from the DB.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
- Raises:
RunbookNotFound if the runbook no longer appears in the database.
- property disable_ramdisk¶
- property extra¶
- fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'disable_ramdisk': Boolean(default=False,nullable=False), '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), 'owner': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'public': Boolean(default=False,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, runbook_id)[source]¶
Find a runbook based on its integer ID.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
runbook_id – The ID of a runbook.
- Raises:
RunbookNotFound if the runbook no longer appears in the database.
- Returns:
a
Runbook
object.
- classmethod get_by_name(context, name)[source]¶
Find a runbook based on its name.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
name – The name of a runbook.
- Raises:
RunbookNotFound if the runbook no longer appears in the database.
- Returns:
a
Runbook
object.
- classmethod get_by_uuid(context, uuid)[source]¶
Find a runbook based on its UUID.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
uuid – The UUID of a runbook.
- Raises:
RunbookNotFound if the runbook no longer appears in the database.
- Returns:
a
Runbook
object.
- property id¶
- classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None, filters=None)[source]¶
Return a list of Runbook objects.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(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”.
filters – Filters to apply.
- Returns:
a list of
Runbook
objects.
- classmethod list_by_names(context, names)[source]¶
Return a list of Runbook objects matching a set of names.
- Parameters:
context – security context. NOTE: This should only be used internally by the indirection_api, but, 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.: Runbook(context).
names – a list of names to filter by.
- Returns:
a list of
Runbook
objects.
- property name¶
- property owner¶
- property public¶
- refresh(context=None)[source]¶
Loads updates for this runbook.
Loads a runbook 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, but, 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:
RunbookNotFound if the runbook no longer appears in the database.
- save(context=None)[source]¶
Save updates to this Runbook.
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, but, 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.: Runbook(context)
- Raises:
RunbookDuplicateName if a runbook with the same name exists.
- Raises:
RunbookNotFound if the runbook does not exist.
- property steps¶
- property updated_at¶
- property uuid¶
- class ironic.objects.runbook.RunbookCRUDNotification(context=None, **kwargs)[source]¶
Bases:
NotificationBase
Notification emitted on runbook 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.runbook.RunbookCRUDPayload(runbook, **kwargs)[source]¶
Bases:
NotificationPayloadBase
- SCHEMA = {'created_at': ('runbook', 'created_at'), 'disable_ramdisk': ('runbook', 'disable_ramdisk'), 'extra': ('runbook', 'extra'), 'name': ('runbook', 'name'), 'owner': ('runbook', 'owner'), 'public': ('runbook', 'public'), 'steps': ('runbook', 'steps'), 'updated_at': ('runbook', 'updated_at'), 'uuid': ('runbook', 'uuid')}¶
- VERSION = '1.0'¶
- property created_at¶
- property disable_ramdisk¶
- property extra¶
- fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'disable_ramdisk': Boolean(default=False,nullable=False), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'owner': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'public': Boolean(default=False,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 owner¶
- property public¶
- property steps¶
- property updated_at¶
- property uuid¶