X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fvalidation.py;h=da3dd04a361a0de06ea8b89d174ee4b438821abb;hp=292ec97a8f9f5b26e1ba005897f3c9b92952cb75;hb=e45aded97f406476e5f03d21f2624a092796f7f9;hpb=870060400cacf0aaa511fca035937544173237f0 diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 292ec97..da3dd04 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -25,6 +25,8 @@ null_schema = {"type": "null"} id_schema = {"type": "string", "pattern": "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"} time_schema = {"type": "string", "pattern": "^[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]([0-5]:){2}"} pci_schema = {"type": "string", "pattern": "^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\\.[0-9a-fA-F]$"} +# allows [] for wildcards. For that reason huge length limit is set +pci_extended_schema = {"type": "string", "pattern": "^[0-9a-fA-F.:-\\[\\]]{12,40}$"} http_schema = {"type": "string", "pattern": "^https?://[^'\"=]+$"} bandwidth_schema = {"type": "string", "pattern": "^[0-9]+ *([MG]bps)?$"} memory_schema = {"type": "string", "pattern": "^[0-9]+ *([MG]i?[Bb])?$"} @@ -194,8 +196,9 @@ ns_instantiate = { "nsDescription": {"oneOf": [description_schema, {"type": "null"}]}, "nsdId": id_schema, "vimAccountId": id_schema, - "ssh_keys": {"type": "string"}, + "ssh_keys": {"type": "array", "items": {"type": "string"}}, "nsr_id": id_schema, + "vduImage": name_schema, "vnf": { "type": "array", "minItems": 1, @@ -393,7 +396,7 @@ sdn_port_mapping_schema = { "items": { "type": "object", "properties": { - "pci": pci_schema, + "pci": pci_extended_schema, "switch_port": nameshort_schema, "switch_mac": mac_schema },