+
+ns_instantiate = {
+ "title": "ns action instantiate input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "lcmOperationType": string_schema,
+ "nsInstanceId": id_schema,
+ "nsName": name_schema,
+ "nsDescription": {"oneOf": [description_schema, {"type": "null"}]},
+ "nsdId": id_schema,
+ "vimAccountId": id_schema,
+ "ssh_keys": {"type": "string"},
+ "nsr_id": id_schema,
+ "vnf": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "member-vnf-index": name_schema,
+ "vimAccountId": id_schema,
+ "vdu": {
+ "type": "array",
+ "minItems": 1,
+ "items": ns_instantiate_vdu,
+ },
+ "internal-vld": {
+ "type": "array",
+ "minItems": 1,
+ "items": ns_instantiate_internal_vld
+ }
+ },
+ "required": ["member-vnf-index"],
+ "minProperties": 2,
+ "additionalProperties": False
+ }
+ },
+ "vld": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": string_schema,
+ "vim-network-name": {"OneOf": [string_schema, object_schema]},
+ "ip-profile": object_schema,
+ "vnfd-connection-point-ref": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "member-vnf-index-ref": name_schema,
+ "vnfd-connection-point-ref": name_schema,
+ "ip-address": ip_schema,
+ # "mac-address": mac_schema,
+ },
+ "required": ["member-vnf-index-ref", "vnfd-connection-point-ref"],
+ "minProperties": 3,
+ "additionalProperties": False
+ },
+ }
+ },
+ "required": ["name"],
+ "additionalProperties": False
+ }
+ },
+ },
+ "required": ["nsName", "nsdId", "vimAccountId"],
+ "additionalProperties": False
+}
+
+ns_action = { # TODO for the moment it is only contemplated the vnfd primitive execution
+ "title": "ns action input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "lcmOperationType": string_schema,
+ "nsInstanceId": id_schema,
+ "member_vnf_index": name_schema,
+ "vnf_member_index": name_schema, # TODO for backward compatibility. To remove in future
+ "vdu_id": name_schema,
+ "primitive": name_schema,
+ "primitive_params": {"type": "object"},
+ },
+ "required": ["primitive", "primitive_params"], # TODO add member_vnf_index
+ "additionalProperties": False
+}
+ns_scale = { # TODO for the moment it is only VDU-scaling
+ "title": "ns scale input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "lcmOperationType": string_schema,
+ "nsInstanceId": id_schema,
+ "scaleType": {"enum": ["SCALE_VNF"]},
+ "scaleVnfData": {
+ "type": "object",
+ "properties": {
+ "vnfInstanceId": name_schema,
+ "scaleVnfType": {"enum": ["SCALE_OUT", 'SCALE_IN']},
+ "scaleByStepData": {
+ "type": "object",
+ "properties": {
+ "scaling-group-descriptor": name_schema,
+ "member-vnf-index": name_schema,
+ "scaling-policy": name_schema,
+ },
+ "required": ["scaling-group-descriptor", "member-vnf-index"],
+ "additionalProperties": False
+ },
+ },
+ "required": ["scaleVnfType", "scaleByStepData"], # vnfInstanceId
+ "additionalProperties": False
+ },
+ "scaleTime": time_schema,
+ },
+ "required": ["scaleType", "scaleVnfData"],
+ "additionalProperties": False
+}
+
+
+schema_version = {"type": "string", "enum": ["1.0"]}
+vim_account_edit_schema = {
+ "title": "vim_account edit input schema",