1 # -*- coding: utf-8 -*-
3 # Copyright 2018 University of Bristol - High Performance Networks Research
7 # Contributors: Anderson Bravalheri, Dimitrios Gkounis, Abubakar Siddique
8 # Muqaddas, Navdeep Uniyal, Reza Nejabati and Dimitra Simeonidou
10 # Licensed under the Apache License, Version 2.0 (the "License"); you may
11 # not use this file except in compliance with the License. You may obtain
12 # a copy of the License at
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19 # License for the specific language governing permissions and limitations
22 # For those usages not covered by the Apache License, Version 2.0 please
23 # contact with: <highperformance-networks@bristol.ac.uk>
25 # Neither the name of the University of Bristol nor the names of its
26 # contributors may be used to endorse or promote products derived from
27 # this software without specific prior written permission.
29 # This work has been performed in the context of DCMS UK 5G Testbeds
30 # & Trials Programme and in the framework of the Metro-Haul project -
31 # funded by the European Commission under Grant number 761727 through the
32 # Horizon 2020 and 5G-PPP programmes.
35 from ..openmano_schemas
import (
41 # WIM -------------------------------------------------------------------------
42 wim_types
= ["ietfl2vpn", "dynpac", "arista_cloudvision", "floodlightof", "onosof", "onos_vpls", "odlof", "dummy"]
47 "^[0-9a-zA-Z]+(:[0-9a-zA-Z]+)*$"
61 wim_port_mapping_desc
= {
66 "datacenter_name": nameshort_schema
,
72 "device_id": nameshort_schema
,
73 "device_interface_id": nameshort_schema
,
74 "service_endpoint_id": name_schema
,
75 "switch_dpid": dpid_type
,
76 "switch_port": port_type
,
77 "service_mapping_info": {
80 "mapping_type": name_schema
,
82 "additionalProperties": True,
83 "required": ["mapping_type"]
86 "required": ["service_endpoint_id"]
90 "required": ["datacenter_name", "pop_wan_mappings"]
94 wim_schema_properties
= {
96 "description": description_schema
,
99 # "enum": ["ietfl2vpn", "onos", "odl", "dynpac", "dummy", ...]
101 "wim_url": description_schema
,
105 "wim_port_mapping": wim_port_mapping_desc
111 "title": "wim information schema",
112 "$schema": "http://json-schema.org/draft-04/schema#",
117 "properties": wim_schema_properties
,
118 "required": ["name", "type", "wim_url"],
125 "title": "wim edit information schema",
126 "$schema": "http://json-schema.org/draft-04/schema#",
131 "properties": wim_schema_properties
,
137 wim_account_schema
= {
138 "title": "wim account information schema",
139 "$schema": "http://json-schema.org/draft-04/schema#",
146 "user": nameshort_schema
,
147 "password": nameshort_schema
,
148 "config": {"type": "object"}
152 "required": ["wim_account"],
155 wim_port_mapping_schema
= {
156 "$schema": "http://json-schema.org/draft-04/schema#",
157 "title": "wim mapping information schema",
160 "wim_port_mapping": wim_port_mapping_desc
162 "required": ["wim_port_mapping"]