The cinder.message.message_field Module

The cinder.message.message_field Module

Message Resource, Action, Detail and user visible message.

Use Resource, Action and Detail’s combination to indicate the Event in the format of:

EVENT: VOLUME_RESOURCE_ACTION_DETAIL

Also, use exception-to-detail mapping to decrease the workload of classifying event in cinder’s task code.

class Action

Bases: object

ALL = (('001', u'schedule allocate volume'), ('002', u'attach volume'), ('003', u'copy volume to image'), ('004', u'update attachment'), ('005', u'copy image to volume'), ('006', u'unmanage volume'))
ATTACH_VOLUME = ('002', u'attach volume')
COPY_IMAGE_TO_VOLUME = ('005', u'copy image to volume')
COPY_VOLUME_TO_IMAGE = ('003', u'copy volume to image')
SCHEDULE_ALLOCATE_VOLUME = ('001', u'schedule allocate volume')
UNMANAGE_VOLUME = ('006', u'unmanage volume')
UPDATE_ATTACHMENT = ('004', u'update attachment')
class Detail

Bases: object

ALL = (('001', u'An unknown error occurred.'), ('002', u'Driver is not initialized at present.'), ('003', u'Could not find any available weighted backend.'), ('004', u'Failed to upload volume to image at backend.'), ('005', u"Volume's attach mode is invalid."), ('006', u'Not enough quota resource for operation.'), ('007', u'Image used for creating volume exceeds available space.'), ('008', u'Unmanaging encrypted volumes is not supported.'))
DRIVER_NOT_INITIALIZED = ('002', u'Driver is not initialized at present.')
EXCEPTION_DETAIL_MAPPINGS = {('006', u'Not enough quota resource for operation.'): ['ImageLimitExceeded', 'BackupLimitExceeded', 'SnapshotLimitExceeded'], ('003', u'Could not find any available weighted backend.'): ['NoValidBackend'], ('002', u'Driver is not initialized at present.'): ['DriverNotInitialized'], ('008', u'Unmanaging encrypted volumes is not supported.'): ['UnmanageEncVolNotSupported'], ('005', u"Volume's attach mode is invalid."): ['InvalidVolumeAttachMode'], ('007', u'Image used for creating volume exceeds available space.'): ['ImageTooBig']}
FAILED_TO_UPLOAD_VOLUME = ('004', u'Failed to upload volume to image at backend.')
NOT_ENOUGH_SPACE_FOR_IMAGE = ('007', u'Image used for creating volume exceeds available space.')
NO_BACKEND_AVAILABLE = ('003', u'Could not find any available weighted backend.')
QUOTA_EXCEED = ('006', u'Not enough quota resource for operation.')
UNKNOWN_ERROR = ('001', u'An unknown error occurred.')
UNMANAGE_ENC_NOT_SUPPORTED = ('008', u'Unmanaging encrypted volumes is not supported.')
VOLUME_ATTACH_MODE_INVALID = ('005', u"Volume's attach mode is invalid.")
class Resource

Bases: object

VOLUME = 'VOLUME'
translate_action(action_id)
translate_detail(detail_id)
translate_detail_id(exception, detail)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.