+dpid_type = {
+ "type": "string",
+ "pattern":
+ "^[0-9a-zA-Z]+(:[0-9a-zA-Z]+)*$"
+}
+
+port_type = {
+ "oneOf": [
+ {"type": "string",
+ "minLength": 1,
+ "maxLength": 5},
+ {"type": "integer",
+ "minimum": 1,
+ "maximum": 65534}
+ ]
+}
+
+wim_port_mapping_desc = {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "datacenter_name": nameshort_schema,
+ "pop_wan_mappings": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "pop_switch_dpid": dpid_type,
+ "pop_switch_port": port_type,
+ "wan_service_endpoint_id": name_schema,
+ "wan_service_mapping_info": {
+ "type": "object",
+ "properties": {
+ "mapping_type": name_schema,
+ "wan_switch_dpid": dpid_type,
+ "wan_switch_port": port_type
+ },
+ "additionalProperties": True,
+ "required": ["mapping_type"]
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "pop_switch_dpid",
+ "pop_switch_port",
+ "wan_service_endpoint_id"
+ ]
+ },
+ {
+ "required": [
+ "pop_switch_dpid",
+ "pop_switch_port",
+ "wan_service_mapping_info"
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "required": ["datacenter_name", "pop_wan_mappings"]
+ }
+}
+