"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"}
"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):