Currently we have lot of validation code inside
server tag controller class which can be moved to
json schema.
Same can be reused on other place also.
For example, microversion 2.40 adds server tag while
boot. Same schema can be used there.
Current python code validation shows conceret error message about each
tag where using json schema error msg will be like below-
For requesting tags more than max limit:
Invalid input for field/attribute tags. Value: ['0', '1', '2', '3', '4',
'5', '6', ...] is too long
For requesting tags more than char limit:
Invalid input for field/attribute 0. Value: aaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too
long
I think those error message are clear enough to understand the wrong
tags.
Change-Id: I457cf630aeae9034c0b175d016148a1d50a0b469
tag schema is being used in multiple place like server tags
and device tags and may be in future it will be used in many
other schema also.
So this patch moves tag schema from server_tags.py to common
place (parameter_types.py).
Change-Id: I9385c436c48c881dc5fab475ed35eb0e10010637
Added new controller which allows the following:
- add tag to the server
- replace set of server tags with new set of tags
- get list of tags for server
- check if tag exists on a server
- remove specified tag from server
- remove all tags from server
Functional tests and annotations "@wsgi.Controller.api_version(*)"
for controller methods will be added in next patch
with creation of new API microversion.
APIImpact
Implements: blueprint tag-instances
Change-Id: Ibc44228aeae94c17353af7fccfcfb2c11b2e9190