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])?$"}
"properties": {
"lcmOperationType": string_schema,
"nsInstanceId": id_schema,
+ "netsliceInstanceId": id_schema,
"nsName": name_schema,
"nsDescription": {"oneOf": [description_schema, {"type": "null"}]},
"nsdId": id_schema,
"items": {
"type": "object",
"properties": {
- "pci": pci_schema,
+ "pci": pci_extended_schema,
"switch_port": nameshort_schema,
"switch_mac": mac_schema
},
"pdus": pdu_edit_schema,
}
+# NETSLICE SCHEMAS
+nsi_instantiate = {
+ "title": "netslice action instantiate input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "lcmOperationType": string_schema,
+ "nsiInstanceId": id_schema,
+ "nsiName": name_schema,
+ "nsiDescription": {"oneOf": [description_schema, {"type": "null"}]},
+ "nstdId": string_schema,
+ "vimAccountId": id_schema,
+ "ssh_keys": {"type": "string"},
+ "nsi_id": id_schema,
+ "ns": {
+ "type": "array",
+ "minItems": 1,
+ "items": ns_instantiate
+ },
+ },
+ "required": ["nsiName", "nstdId", "vimAccountId"],
+ "additionalProperties": False
+}
+
+nsi_action = {
+
+}
+
+nsi_terminate = {
+
+}
+
class ValidationError(Exception):
pass