Added Schemas to DesignateObjects

This enables the <object>.validate() command

Partially-Implements: blueprint validation-cleanup

Change-Id: I147ae0b622f5fd29f536846607b5f7fa2cb87606
This commit is contained in:
Graham Hayes
2015-03-10 12:02:14 +00:00
parent 1c07a1de32
commit a604ec01ae
14 changed files with 520 additions and 76 deletions

View File

@@ -16,11 +16,30 @@ from designate.objects import base
class PoolAttribute(base.DictObjectMixin, base.PersistentObjectMixin,
base.DesignateObject):
base.DesignateObject):
FIELDS = {
'pool_id': {},
'key': {},
'value': {}
'pool_id': {
'schema': {
'type': 'string',
'description': 'Pool identifier',
'format': 'uuid',
},
'required': True
},
'key': {
'schema': {
'type': 'string',
'maxLength': 50,
},
'required': True,
},
'value': {
'schema': {
'type': 'string',
'maxLength': 50,
},
'required': True
}
}