ironic.objects.volume_target module¶
- class ironic.objects.volume_target.VolumeTarget(context=None, **kwargs)[source]¶
- Bases: - IronicObject,- VersionedObjectDictCompat- VERSION = '1.1'¶
 - property boot_index¶
 - create(context=None)[source]¶
- Create a VolumeTarget 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.: VolumeTarget(context). 
- Raises:
- VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same node ID and boot index 
- Raises:
- VolumeTargetAlreadyExists if a volume target with the same UUID exists 
 
 - property created_at¶
 - dbapi = <oslo_db.api.DBAPI object>¶
 - destroy(context=None)[source]¶
- Delete the VolumeTarget 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.: VolumeTarget(context). 
- Raises:
- VolumeTargetNotFound if the volume target cannot be found 
 
 - property extra¶
 - fields = {'boot_index': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), '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), 'node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'properties': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_type': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
 - classmethod get(context, ident)[source]¶
- Find a volume target based on its ID or UUID. - Parameters:
- context – security context 
- ident – the database primary key ID or the UUID of a volume target 
 
- Returns:
- a - VolumeTargetobject
- Raises:
- InvalidIdentity if ident is neither an integer ID nor a UUID 
- Raises:
- VolumeTargetNotFound if no volume target with this ident exists 
 
 - classmethod get_by_id(context, db_id)[source]¶
- Find a volume target based on its database ID. - Parameters:
- cls – the - VolumeTarget
- context – security context 
- db_id – the database primary key (integer) ID of a volume target 
 
- Returns:
- a - VolumeTargetobject
- Raises:
- VolumeTargetNotFound if no volume target with this ID exists 
 
 - classmethod get_by_uuid(context, uuid)[source]¶
- Find a volume target based on its UUID. - Parameters:
- cls – the - VolumeTarget
- context – security context 
- uuid – the UUID of a volume target 
 
- Returns:
- a - VolumeTargetobject
- Raises:
- VolumeTargetNotFound if no volume target with this UUID exists 
 
 - property id¶
 - classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None, project=None)[source]¶
- Return a list of VolumeTarget objects. - Parameters:
- 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”. 
- project – The associated node project to search with. 
 
- Returns:
- a list of - VolumeConnectorobjects
- Returns:
- a list of - VolumeTargetobjects
- Raises:
- InvalidParameterValue if sort_key does not exist 
 
 - classmethod list_by_node_id(context, node_id, limit=None, marker=None, sort_key=None, sort_dir=None, project=None)[source]¶
- Return a list of VolumeTarget objects related to a given node ID. - Parameters:
- context – security context 
- node_id – the integer 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”. 
- project – The associated node project to search with. 
 
- Returns:
- a list of - VolumeConnectorobjects
- Returns:
- a list of - VolumeTargetobjects
- Raises:
- InvalidParameterValue if sort_key does not exist 
 
 - classmethod list_by_volume_id(context, volume_id, limit=None, marker=None, sort_key=None, sort_dir=None, project=None)[source]¶
- Return a list of VolumeTarget objects related to a given volume ID. - Parameters:
- context – security context 
- volume_id – the UUID of the volume 
- limit – maximum number of volume targets 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 - VolumeTargetobjects
- Raises:
- InvalidParameterValue if sort_key does not exist 
 
 - property node_id¶
 - property properties¶
 - refresh(context=None)[source]¶
- Loads updates for this VolumeTarget. - Load a volume target with the same UUID from the database and check for updated attributes. If there are any updates, they are applied from the loaded volume target, column by column. - 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.: VolumeTarget(context). 
- Raises:
- VolumeTargetNotFound if the volume target cannot be found 
 
 - save(context=None)[source]¶
- Save updates to this VolumeTarget. - Updates will be made column by column based on the result of self.do_version_changes_for_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.: VolumeTarget(context). 
- Raises:
- InvalidParameterValue if the UUID is being changed 
- Raises:
- VolumeTargetBootIndexAlreadyExists if a volume target already exists with the same node ID and boot index values 
- Raises:
- VolumeTargetNotFound if the volume target cannot be found 
 
 - property updated_at¶
 - property uuid¶
 - property volume_id¶
 - property volume_type¶
 
- class ironic.objects.volume_target.VolumeTargetCRUDNotification(context=None, **kwargs)[source]¶
- Bases: - NotificationBase- Notification emitted at CRUD of a volume target. - 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.volume_target.VolumeTargetCRUDPayload(target, node_uuid)[source]¶
- Bases: - NotificationPayloadBase- SCHEMA = {'boot_index': ('target', 'boot_index'), 'created_at': ('target', 'created_at'), 'extra': ('target', 'extra'), 'properties': ('target', 'properties'), 'updated_at': ('target', 'updated_at'), 'uuid': ('target', 'uuid'), 'volume_id': ('target', 'volume_id'), 'volume_type': ('target', 'volume_type')}¶
 - VERSION = '1.0'¶
 - property boot_index¶
 - property created_at¶
 - property extra¶
 - fields = {'boot_index': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'node_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'properties': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume_type': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
 - property node_uuid¶
 - property properties¶
 - property updated_at¶
 - property uuid¶
 - property volume_id¶
 - property volume_type¶
 
