X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fvalidation.py;h=69caff7b3b4d593f06400f9a7129cf2850c3fae8;hp=c6821c5240a0f91dd9819fe666b63b02756e6bdf;hb=cea9591384b32a78fd44bf26ea7129498be034d6;hpb=21f03f572ec5a9883107de8e7dbd7b4891f6860b;ds=sidebyside diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index c6821c5..69caff7 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -221,11 +221,35 @@ additional_params_for_vnf = { "properties": { "member-vnf-index": name_schema, "additionalParams": object_schema, + "additionalParamsForVdu": { + "type": "array", + "items": { + "type": "object", + "properties": { + "vdu_id": name_schema, + "additionalParams": object_schema, + }, + "required": ["vdu_id", "additionalParams"], + "additionalProperties": False, + }, + }, + "additionalParamsForKdu": { + "type": "array", + "items": { + "type": "object", + "properties": { + "kdu_name": name_schema, + "additionalParams": object_schema, + }, + "required": ["kdu_name", "additionalParams"], + "additionalProperties": False, + }, + }, }, - "required": ["member-vnf-index", "additionalParams"], + "required": ["member-vnf-index"], + "minProperties": 2, "additionalProperties": False } - } ns_instantiate = { @@ -363,7 +387,7 @@ ns_scale = { # TODO for the moment it is only VDU-scaling schema_version = {"type": "string", "enum": ["1.0"]} schema_type = {"type": "string"} -vim_type = {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]} +vim_type = shortname_schema # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]} vim_account_edit_schema = { "title": "vim_account edit input schema", @@ -410,7 +434,7 @@ vim_account_new_schema = { "additionalProperties": False } -wim_type = {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]} +wim_type = shortname_schema # {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]} wim_account_edit_schema = { "title": "wim_account edit input schema", @@ -522,7 +546,7 @@ k8scluster_nets_schema = { "title": "k8scluster nets input schema", "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", - "patternProperties": {".": string_schema}, + "patternProperties": {".": {"oneOf": [description_schema, null_schema]}}, "minProperties": 1, "additionalProperties": False } @@ -563,7 +587,7 @@ k8scluster_edit_schema = { } # K8s Repos -k8srepo_types = {"enum": ["chart", "bundle"]} +k8srepo_types = {"enum": ["helm-chart", "juju-bundle"]} k8srepo_properties = { "name": name_schema, "description": description_schema,