X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fvalidation.py;h=2601e90c7dec64ed08d97cc58a5c9976caf8c1c1;hp=efd940cb2aecc90f1c1f3e41d2fa8f16079d6fb6;hb=78f474e69fde9d64e8716978b5ea38f9f5aace48;hpb=80135b928ab442c38898750b4751480205b4affc diff --git a/NG-RO/osm_ng_ro/validation.py b/NG-RO/osm_ng_ro/validation.py index efd940cb..2601e90c 100644 --- a/NG-RO/osm_ng_ro/validation.py +++ b/NG-RO/osm_ng_ro/validation.py @@ -13,9 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from jsonschema import validate as js_v, exceptions as js_e from http import HTTPStatus +from jsonschema import exceptions as js_e, validate as js_v + __author__ = "Alfonso Tierno " __version__ = "0.1" version_date = "Jun 2020" @@ -106,10 +107,27 @@ deploy_schema = { "vld": deploy_item_list, }, }, + "affinity-or-anti-affinity-group": deploy_item_list, }, "additionalProperties": False, } +rebuild_schema = { + "$schema": "http://json-schema.org/draft-04/schema#", + "vm_rebuild": { + "type": "array", + "items": { + "type": "object", + "properties": { + "vdu-id": id_schema, + "vim_name": name_schema, + "member-vnf-index": name_schema, + }, + }, + "additionalProperties": True, + }, +} + class ValidationError(Exception): def __init__(self, message, http_code=HTTPStatus.UNPROCESSABLE_ENTITY):