+ns_instantiate_vdu = {
+ "title": "ns action instantiate input schema for vdu",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "id": name_schema,
+ "volume": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": name_schema,
+ "vim-volume-id": name_schema,
+ },
+ "required": ["name", "vim-volume-id"],
+ "additionalProperties": False
+ }
+ },
+ "interface": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": name_schema,
+ "ip-address": ip_schema,
+ "mac-address": mac_schema,
+ "floating-ip-required": bool_schema,
+ },
+ "required": ["name"],
+ "additionalProperties": False
+ }
+ }
+ },
+ "required": ["id"],
+ "additionalProperties": False
+}
+
+ip_profile_dns_schema = {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "address": ip_schema,
+ },
+ "required": ["address"],
+ "additionalProperties": False
+ }
+}
+
+ip_profile_dhcp_schema = {
+ "type": "object",
+ "properties": {
+ "enabled": {"type": "boolean"},
+ "count": integer1_schema,
+ "start-address": ip_schema
+ },
+ "additionalProperties": False,
+}
+
+ip_profile_schema = {
+ "title": "ip profile validation schame",
+ "$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 schame",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "ip-version": {"enum": ["ipv4", "ipv6"]},
+ "subnet-address": {"oneOf": [null_schema, ip_prefix_schema]},
+ "gateway-address": {"oneOf": [null_schema, ip_schema]},
+ "dns-server": {"oneOf": [null_schema, ip_profile_dns_schema]},
+
+ "dhcp-params": {"oneOf": [null_schema, ip_profile_dhcp_schema]},
+ },
+ "additionalProperties": False
+}
+
+ns_instantiate_internal_vld = {
+ "title": "ns action instantiate input schema for vdu",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": name_schema,
+ "vim-network-name": name_schema,
+ "ip-profile": ip_profile_update_schema,
+ "internal-connection-point": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "properties": {
+ "id-ref": name_schema,
+ "ip-address": ip_schema,
+ },
+ "required": ["id-ref", "ip-address"],
+ "additionalProperties": False
+ },
+ }
+ },
+ "required": ["name"],
+ "minProperties": 2,
+ "additionalProperties": False
+}