X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fwim%2Fschemas.py;h=6c0a8489b42bb60b71436b7a3248fcf299603c47;hb=HEAD;hp=fb65fdd3a420c950f9cd1906d87aad9a042b4551;hpb=db1b22de8331161d80ef3a65ffd41ba8ea206cb9;p=osm%2FRO.git diff --git a/osm_ro/wim/schemas.py b/osm_ro/wim/schemas.py deleted file mode 100644 index fb65fdd3..00000000 --- a/osm_ro/wim/schemas.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -## -# Copyright 2018 University of Bristol - High Performance Networks Research -# Group -# All Rights Reserved. -# -# Contributors: Anderson Bravalheri, Dimitrios Gkounis, Abubakar Siddique -# Muqaddas, Navdeep Uniyal, Reza Nejabati and Dimitra Simeonidou -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# For those usages not covered by the Apache License, Version 2.0 please -# contact with: -# -# Neither the name of the University of Bristol nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# This work has been performed in the context of DCMS UK 5G Testbeds -# & Trials Programme and in the framework of the Metro-Haul project - -# funded by the European Commission under Grant number 761727 through the -# Horizon 2020 and 5G-PPP programmes. -## - -from ..openmano_schemas import ( - description_schema, - name_schema, - nameshort_schema -) - -# WIM ------------------------------------------------------------------------- -wim_types = ["tapi", "onos", "odl", "dynpac"] - -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"] - } -} - -wim_schema_properties = { - "name": name_schema, - "description": description_schema, - "type": { - "type": "string", - "enum": ["tapi", "onos", "odl", "dynpac"] - }, - "wim_url": description_schema, - "config": { - "type": "object", - "properties": { - "wim_port_mapping": wim_port_mapping_desc - } - } -} - -wim_schema = { - "title": "wim information schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "wim": { - "type": "object", - "properties": wim_schema_properties, - "required": ["name", "type", "wim_url"], - "additionalProperties": True - } - }, - "required": ["wim"], - "additionalProperties": False -} - -wim_edit_schema = { - "title": "wim edit information schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "wim": { - "type": "object", - "properties": wim_schema_properties, - "additionalProperties": False - } - }, - "required": ["wim"], - "additionalProperties": False -} - -wim_account_schema = { - "title": "wim account information schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "wim_account": { - "type": "object", - "properties": { - "name": name_schema, - "user": nameshort_schema, - "password": nameshort_schema, - "config": {"type": "object"} - }, - "additionalProperties": True - } - }, - "required": ["wim_account"], - "additionalProperties": False -} - -wim_port_mapping_schema = { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "wim mapping information schema", - "type": "object", - "properties": { - "wim_port_mapping": wim_port_mapping_desc - }, - "required": ["wim_port_mapping"] -}