X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fvalidation.py;h=ae9644c44b458d0146b9ef0a43548511f6fcd7ce;hp=112461b1db6463efbed41ed4f483687d5595a41e;hb=50e815b31413684b26655c481b84da6099c49da2;hpb=544a2ae8b0b950b55f29c3f0a223ffe4874285e5 diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 112461b..ae9644c 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -447,6 +447,7 @@ ns_update = { "properties": { "lcmOperationType": string_schema, "nsInstanceId": id_schema, + "timeout_ns_update": integer1_schema, "updateType": { "enum": ["CHANGE_VNFPKG", "REMOVE_VNF", "MODIFY_VNF_INFORMATION"] }, @@ -525,6 +526,28 @@ ns_scale = { # TODO for the moment it is only VDU-scaling "additionalProperties": False, } +ns_migrate = { + "title": "ns migrate input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "lcmOperationType": string_schema, + "nsInstanceId": id_schema, + "vnfInstanceId": id_schema, + "migrateToHost": string_schema, + "vdu": { + "type": "object", + "properties": { + "vduId": name_schema, + "vduCountIndex": integer0_schema, + }, + "required": ["vduId"], + "additionalProperties": False, + }, + }, + "required": ["vnfInstanceId"], + "additionalProperties": False +} schema_version = {"type": "string", "enum": ["1.0"]} schema_type = {"type": "string"} @@ -695,6 +718,18 @@ sdn_external_port_schema = { } # K8s Clusters +k8scluster_deploy_method_schema = { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Deployment methods for K8s cluster", + "type": "object", + "properties": { + "helm-chart": {"type": "boolean"}, + "juju-bundle": {"type": "boolean"}, + "helm-chart-v3": {"type": "boolean"}, + }, + "additionalProperties": False, + "minProperties": 3, +} k8scluster_nets_schema = { "title": "k8scluster nets input schema", "$schema": "http://json-schema.org/draft-04/schema#", @@ -717,6 +752,7 @@ k8scluster_new_schema = { "vca_id": id_schema, "k8s_version": string_schema, "nets": k8scluster_nets_schema, + "deployment_methods": k8scluster_deploy_method_schema, "namespace": name_schema, "cni": nameshort_list_schema, }, @@ -1286,6 +1322,63 @@ subscription = { "required": ["CallbackUri"], } +vnflcmsub_schema = { + "title": "vnflcmsubscription input schema", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "VnfInstanceSubscriptionFilter": { + "type": "object", + "properties": { + "vnfdIds": {"type": "array"}, + "vnfInstanceIds": {"type": "array"}, + }, + }, + "notificationTypes": { + "type": "array", + "items": { + "enum": [ + "VnfIdentifierCreationNotification", + "VnfLcmOperationOccurrenceNotification", + "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" + ] + } + }, + "operationStates": { + "type": "array", + "items": { + "enum": [ + "STARTING", "PROCESSING", "COMPLETED", "FAILED_TEMP", "FAILED", + "ROLLING_BACK", "ROLLED_BACK" + ] + } + } + }, + "required": ["VnfInstanceSubscriptionFilter", "notificationTypes"] + } + +vnf_subscription = { + "title": "vnf subscription input schema", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "filter": vnflcmsub_schema, + "CallbackUri": description_schema, + "authentication": authentication_schema + }, + "required": ["filter", "CallbackUri"] +} + class ValidationError(Exception): def __init__(self, message, http_code=HTTPStatus.UNPROCESSABLE_ENTITY):