change SDN types from tapi to ietfl2vpn, from arista to arista_cloudvision
[osm/RO.git] / RO-SDN-arista / osm_rosdn_arista / aristaConfigLet.py
diff --git a/RO-SDN-arista/osm_rosdn_arista/aristaConfigLet.py b/RO-SDN-arista/osm_rosdn_arista/aristaConfigLet.py
deleted file mode 100644 (file)
index 8e34091..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-# -*- coding: utf-8 -*-\r
-##\r
-# Copyright 2019 Atos - CoE Telco NFV Team\r
-# All Rights Reserved.\r
-#\r
-# Contributors: Oscar Luis Peral, Atos\r
-#\r
-# Licensed under the Apache License, Version 2.0 (the "License"); you may\r
-# not use this file except in compliance with the License. You may obtain\r
-# a copy of the License at\r
-#\r
-#         http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
-# License for the specific language governing permissions and limitations\r
-# under the License.\r
-#\r
-# For those usages not covered by the Apache License, Version 2.0 please\r
-# contact with: <oscarluis.peral@atos.net>\r
-#\r
-# Neither the name of Atos nor the names of its\r
-# contributors may be used to endorse or promote products derived from\r
-# this software without specific prior written permission.\r
-#\r
-# This work has been performed in the context of Arista Telefonica OSM PoC.\r
-##\r
-\r
-\r
-class AristaSDNConfigLet:\r
-    _VLAN = "VLAN"\r
-    _VXLAN = "VXLAN"\r
-    _VLAN_MLAG = "VLAN-MLAG"\r
-    _VXLAN_MLAG = "VXLAN-MLAG"\r
-    topology = _VXLAN_MLAG\r
-\r
-    def __init__(self, topology=_VXLAN_MLAG):\r
-        self.topology = topology\r
-\r
-    _basic_int ="""\r
-interface {interface}\r
-   !! service: {uuid}\r
-   switchport\r
-   switchport mode {type}\r
-   switchport {switchport_def}\r
-!\r
-"""\r
-    _int_SRIOV = "trunk group {service}{vlan_id}"\r
-    _int_PASSTROUGH = "access vlan {vlan_id}"\r
-\r
-    def _get_interface(self, uuid, interface, vlan_id, s_type, index, i_type):\r
-        if i_type == "trunk":\r
-            switchport_def = self._int_SRIOV.format(service=s_type, vlan_id=vlan_id)\r
-        else:\r
-            switchport_def = self._int_PASSTROUGH.format(vlan_id=vlan_id)\r
-        return self._basic_int.format(uuid=uuid,\r
-                                      interface=interface,\r
-                                      type=i_type,\r
-                                      switchport_def=switchport_def)\r
-\r
-    def getElan_sriov(self, uuid, interface, vlan_id, index):\r
-        return self._get_interface(uuid, interface, vlan_id, "ELAN", index, "trunk")\r
-\r
-    def getEline_sriov(self, uuid, interface, vlan_id, index):\r
-        return self._get_interface(uuid, interface, vlan_id, "ELINE", index, "trunk")\r
-\r
-    def getElan_passthrough(self, uuid, interface, vlan_id, index):\r
-        return self._get_interface(uuid, interface, vlan_id, "ELAN", index, "dot1q-tunnel")\r
-\r
-    def getEline_passthrough(self, uuid, interface, vlan_id, index):\r
-        return self._get_interface(uuid, interface, vlan_id, "ELINE", index, "dot1q-tunnel")\r
-\r
-    _basic_vlan ="""\r
-vlan {vlan}\r
-   !! service: {service} {vlan} {uuid}\r
-   name {service}{vlan}\r
-   trunk group {service}{vlan}\r
-"""\r
-    _basic_mlag ="""   trunk group MLAGPEER\r
-"""\r
-    _basic_vxlan ="""interface VXLAN1\r
-   VXLAN vlan {vlan} vni {vni}\r
-"""\r
-    _basic_end ="!"\r
-\r
-    _configLet_VLAN = _basic_vlan + _basic_end\r
-    _configLet_VXLAN = _basic_vlan + _basic_vxlan + _basic_end\r
-    _configLet_VLAN_MLAG = _basic_vlan + _basic_mlag + _basic_end\r
-    _configLet_VXLAN_MLAG = _basic_vlan + _basic_mlag + _basic_vxlan + _basic_end\r
-\r
-    def _get_vlan(self, uuid, vlan_id, vni_id, s_type):\r
-        if self.topology == self._VLAN:\r
-            return self._configLet_VLAN.format(service=s_type, vlan=vlan_id, uuid=uuid)\r
-        if self.topology == self._VLAN_MLAG:\r
-            return self._configLet_VLAN_MLAG.format(service=s_type, vlan=vlan_id, uuid=uuid)\r
-        if self.topology == self._VXLAN:\r
-            return self._configLet_VXLAN.format(service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id)\r
-        if self.topology == self._VXLAN_MLAG:\r
-            return self._configLet_VXLAN_MLAG.format(service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id)\r
-\r
-    def getElan_vlan(self, uuid, vlan_id, vni_id):\r
-        return self._get_vlan(uuid, vlan_id, vni_id, "ELAN")\r
-\r
-    def getEline_vlan(self, uuid, vlan_id, vni_id):\r
-        return self._get_vlan(uuid, vlan_id, vni_id, "ELINE")\r
-\r
-    _configLet_BGP = """\r
-router bgp {bgp}\r
-    vlan {vlan}\r
-    !! service: {uuid}\r
-        rd {loopback}:{vni}\r
-        route-target both {vni}:{vni}\r
-        redistribute learned\r
-!\r
-"""\r
-\r
-    def _get_bgp(self, uuid, vlan_id, vni_id, loopback0, bgp, s_type):\r
-        if self.topology == self._VXLAN or self.topology == self._VXLAN_MLAG:\r
-            return self._configLet_BGP.format(uuid=uuid,\r
-                                              bgp=bgp,\r
-                                              vlan=vlan_id,\r
-                                              loopback=loopback0,\r
-                                              vni=vni_id)\r
-\r
-\r
-    def getElan_bgp(self, uuid, vlan_id, vni_id, loopback0, bgp):\r
-        return self._get_bgp(uuid, vlan_id, vni_id, loopback0, bgp, "ELAN")\r
-\r
-    def getEline_bgp(self, uuid, vlan_id, vni_id, loopback0, bgp):\r
-        return self._get_bgp(uuid, vlan_id, vni_id, loopback0, bgp, "ELINE")\r