From daf8cc508218b12dc05633a537c6ef67dd723d4b Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 30 Nov 2018 14:17:20 +0100 Subject: [PATCH] validation.py: added nsi slice subnet and slice vld params Change-Id: Iae405ca0c86bd48c79eaefef6ec8a3246611dc89 Signed-off-by: garciadeblas --- osm_nbi/validation.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index f0b8054..98fd511 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -15,6 +15,7 @@ from jsonschema import validate as js_v, exceptions as js_e from http import HTTPStatus +from copy import deepcopy __author__ = "Alfonso Tierno " __version__ = "0.1" @@ -575,6 +576,24 @@ nbi_edit_input_schemas = { } # NETSLICE SCHEMAS +nsi_slice_instantiate = deepcopy(ns_instantiate) +nsi_slice_instantiate["title"] = "netslice subnet instantiation params input schema" +nsi_slice_instantiate["properties"]["id"] = name_schema +nsi_slice_instantiate["required"].append("id") + +nsi_vld_instantiate = { + "title": "netslice vld instantiation params input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": string_schema, + "vim-network-name": {"OneOf": [string_schema, object_schema]}, + "ip-profile": object_schema, + }, + "required": ["name"], + "additionalProperties": False +} + nsi_instantiate = { "title": "netslice action instantiate input schema", "$schema": "http://json-schema.org/draft-04/schema#", @@ -588,10 +607,15 @@ nsi_instantiate = { "vimAccountId": id_schema, "ssh_keys": {"type": "string"}, "nsi_id": id_schema, - "ns": { + "netslice-subnet": { + "type": "array", + "minItems": 1, + "items": nsi_slice_instantiate + }, + "netslice-vld": { "type": "array", "minItems": 1, - "items": ns_instantiate + "items": nsi_vld_instantiate }, }, "required": ["nsiName", "nstId", "vimAccountId"], -- 2.25.1