X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_nbi%2Fvalidation.py;h=e5c2a0328fe2addfbad187fd8aef8325b7f3fe15;hb=5f3111606f278c4b21c9f0d37b7c5c9af92cfe43;hp=7e50aa905727ca9ec72b11114fd68d3a85e18b29;hpb=0964edf54da6607131d354e1bcb30fbb97dbc5f4;p=osm%2FNBI.git diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 7e50aa9..e5c2a03 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -96,7 +96,7 @@ ip_schema = { } ipv6_schema = { "type": "string", - "pattern": "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))", + "pattern": "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))", # noqa: W605 } ip_prefix_schema = { "type": "string", @@ -137,6 +137,7 @@ ns_instantiate_vdu = { "type": "object", "properties": { "id": name_schema, + "vim-flavor-id": name_schema, "volume": { "type": "array", "minItems": 1, @@ -194,19 +195,6 @@ ip_profile_dhcp_schema = { } ip_profile_schema = { - "title": "ip profile validation schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "ip-version": {"enum": ["ipv4", "ipv6"]}, - "subnet-address": ip_prefix_schema, - "gateway-address": ip_schema, - "dns-server": ip_profile_dns_schema, - "dhcp-params": ip_profile_dhcp_schema, - }, -} - -ip_profile_update_schema = { "title": "ip profile validation schema", "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", @@ -253,7 +241,7 @@ ns_instantiate_internal_vld = { "name": name_schema, "vim-network-name": name_schema, "vim-network-id": name_schema, - "ip-profile": ip_profile_update_schema, + "ip-profile": ip_profile_schema, "provider-network": provider_network_schema, "internal-connection-point": { "type": "array", @@ -394,7 +382,7 @@ ns_instantiate = { "vim-network-id": {"oneOf": [string_schema, object_schema]}, "ns-net": object_schema, "wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]}, - "ip-profile": object_schema, + "ip-profile": ip_profile_schema, "provider-network": provider_network_schema, "vnfd-connection-point-ref": { "type": "array", @@ -449,7 +437,12 @@ ns_update = { "nsInstanceId": id_schema, "timeout_ns_update": integer1_schema, "updateType": { - "enum": ["CHANGE_VNFPKG", "REMOVE_VNF", "MODIFY_VNF_INFORMATION"] + "enum": [ + "CHANGE_VNFPKG", + "REMOVE_VNF", + "MODIFY_VNF_INFORMATION", + "OPERATE_VNF", + ] }, "modifyVnfInfoData": { "type": "object", @@ -468,6 +461,24 @@ ns_update = { }, "required": ["vnfInstanceId", "vnfdId"], }, + "operateVnfData": { + "type": "object", + "properties": { + "vnfInstanceId": id_schema, + "changeStateTo": name_schema, + "additionalParam": { + "type": "object", + "properties": { + "run-day1": bool_schema, + "vdu_id": name_schema, + "count-index": integer0_schema, + }, + "required": ["vdu_id", "count-index"], + "additionalProperties": False, + }, + }, + "required": ["vnfInstanceId", "changeStateTo"], + }, }, "required": ["updateType"], "additionalProperties": False, @@ -538,16 +549,16 @@ ns_migrate = { "migrateToHost": string_schema, "vdu": { "type": "object", - "properties": { - "vduId": name_schema, - "vduCountIndex": integer0_schema, - }, - "required": ["vduId"], - "additionalProperties": False, + "properties": { + "vduId": name_schema, + "vduCountIndex": integer0_schema, + }, + "required": ["vduId"], + "additionalProperties": False, }, }, "required": ["vnfInstanceId"], - "additionalProperties": False + "additionalProperties": False, } ns_heal = { @@ -595,6 +606,37 @@ ns_heal = { "additionalProperties": False, } +ns_verticalscale = { + "title": "vertial scale input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "lcmOperationType": string_schema, + "verticalScale": string_schema, + "nsInstanceId": id_schema, + "changeVnfFlavorData": { + "type": "object", + "properties": { + "vnfInstanceId": id_schema, + "additionalParams": { + "type": "object", + "properties": { + "vduid": string_schema, + "vduCountIndex": integer0_schema, + "virtualMemory": integer1_schema, + "sizeOfStorage": integer0_schema, + "numVirtualCpu": integer1_schema, + }, + }, + }, + "required": ["vnfInstanceId", "additionalParams"], + "additionalProperties": False, + }, + }, + "required": ["lcmOperationType", "verticalScale", "nsInstanceId"], + "additionalProperties": False, +} + schema_version = {"type": "string", "enum": ["1.0"]} schema_type = {"type": "string"} vim_type = shortname_schema # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]} @@ -1387,32 +1429,46 @@ vnflcmsub_schema = { "enum": [ "VnfIdentifierCreationNotification", "VnfLcmOperationOccurrenceNotification", - "VnfIdentifierDeletionNotification" - ] - } + "VnfIdentifierDeletionNotification", + ] + }, }, "operationTypes": { "type": "array", "items": { "enum": [ - "INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", - "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO", "CREATE_SNAPSHOT", - "REVERT_TO_SNAPSHOT", "CHANGE_VNFPKG" - ] - } + "INSTANTIATE", + "SCALE", + "SCALE_TO_LEVEL", + "CHANGE_FLAVOUR", + "TERMINATE", + "HEAL", + "OPERATE", + "CHANGE_EXT_CONN", + "MODIFY_INFO", + "CREATE_SNAPSHOT", + "REVERT_TO_SNAPSHOT", + "CHANGE_VNFPKG", + ] + }, }, "operationStates": { "type": "array", "items": { "enum": [ - "STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", - "ROLLING_BACK", "ROLLED_BACK" - ] - } - } + "STARTING", + "PROCESSING", + "COMPLETED", + "FAILED_TEMP", + "FAILED", + "ROLLING_BACK", + "ROLLED_BACK", + ] + }, + }, }, - "required": ["VnfInstanceSubscriptionFilter", "notificationTypes"] - } + "required": ["VnfInstanceSubscriptionFilter", "notificationTypes"], +} vnf_subscription = { "title": "vnf subscription input schema", @@ -1421,9 +1477,9 @@ vnf_subscription = { "properties": { "filter": vnflcmsub_schema, "CallbackUri": description_schema, - "authentication": authentication_schema + "authentication": authentication_schema, }, - "required": ["filter", "CallbackUri"] + "required": ["filter", "CallbackUri"], }