Allow description fields to be translated in schema

The description fields for the schema elements were hard coded
english strings but are intended for end user consumption and
should be translation enabled.

bug 1115495
Change-Id: Ic3b16af75a41a186640762d0c7af787f1bf49ad0
This commit is contained in:
Michael J Fork 2013-01-31 18:22:38 +00:00
parent 7feecf19ea
commit 802af0fe04

View File

@ -435,68 +435,68 @@ class ResponseSerializer(wsgi.JSONResponseSerializer):
_BASE_PROPERTIES = {
'id': {
'type': 'string',
'description': 'An identifier for the image',
'description': _('An identifier for the image'),
'pattern': ('^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}'
'-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'),
},
'name': {
'type': 'string',
'description': 'Descriptive name for the image',
'description': _('Descriptive name for the image'),
'maxLength': 255,
},
'status': {
'type': 'string',
'description': 'Status of the image',
'description': _('Status of the image'),
'enum': ['queued', 'saving', 'active', 'killed',
'deleted', 'pending_delete'],
},
'visibility': {
'type': 'string',
'description': 'Scope of image accessibility',
'description': _('Scope of image accessibility'),
'enum': ['public', 'private'],
},
'protected': {
'type': 'boolean',
'description': 'If true, image will not be deletable.',
'description': _('If true, image will not be deletable.'),
},
'checksum': {
'type': 'string',
'description': 'md5 hash of image contents.',
'description': _('md5 hash of image contents.'),
'type': 'string',
'maxLength': 32,
},
'size': {
'type': 'integer',
'description': 'Size of image file in bytes',
'description': _('Size of image file in bytes'),
},
'container_format': {
'type': 'string',
'description': '',
'description': _(''),
'type': 'string',
'enum': ['bare', 'ovf', 'ami', 'aki', 'ari'],
},
'disk_format': {
'type': 'string',
'description': '',
'description': _(''),
'type': 'string',
'enum': ['raw', 'vhd', 'vmdk', 'vdi', 'iso', 'qcow2',
'aki', 'ari', 'ami'],
},
'created_at': {
'type': 'string',
'description': 'Date and time of image registration',
'description': _('Date and time of image registration'),
#TODO(bcwaldon): our jsonschema library doesn't seem to like the
# format attribute, figure out why!
#'format': 'date-time',
},
'updated_at': {
'type': 'string',
'description': 'Date and time of the last image modification',
'description': _('Date and time of the last image modification'),
#'format': 'date-time',
},
'tags': {
'type': 'array',
'description': 'List of strings related to the image',
'description': _('List of strings related to the image'),
'items': {
'type': 'string',
'maxLength': 255,
@ -504,15 +504,17 @@ _BASE_PROPERTIES = {
},
'direct_url': {
'type': 'string',
'description': 'URL to access the image file kept in external store',
'description': _('URL to access the image file kept in external '
'store'),
},
'min_ram': {
'type': 'integer',
'description': 'Amount of ram (in MB) required to boot image.',
'description': _('Amount of ram (in MB) required to boot image.'),
},
'min_disk': {
'type': 'integer',
'description': 'Amount of disk space (in GB) required to boot image.',
'description': _('Amount of disk space (in GB) required to boot '
'image.'),
},
'self': {'type': 'string'},
'file': {'type': 'string'},