X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO-SDN-onos_openflow%2Fosm_rosdn_onosof%2Fsdnconn_onosof.py;fp=RO-SDN-onos_openflow%2Fosm_rosdn_onosof%2Fsdnconn_onosof.py;h=79c144129c6468bfe653dda0f6b59a313277b4f7;hp=0000000000000000000000000000000000000000;hb=ed3e4d4fc2819e425bb8b165e43fcbac259d3f1b;hpb=72e918cb69191ac04720444bbf4906680059d60c diff --git a/RO-SDN-onos_openflow/osm_rosdn_onosof/sdnconn_onosof.py b/RO-SDN-onos_openflow/osm_rosdn_onosof/sdnconn_onosof.py new file mode 100644 index 00000000..79c14412 --- /dev/null +++ b/RO-SDN-onos_openflow/osm_rosdn_onosof/sdnconn_onosof.py @@ -0,0 +1,41 @@ +## +# Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. +# All Rights Reserved. +# +# 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. +# +## +"""The SdnConnectorOnosOf connector is responsible for creating services using pro active operflow rules. +""" + +import logging +from osm_ro.wim.openflow_conn import SdnConnectorOpenFlow +from .onos_of import OfConnOnos + + +class SdnConnectorOnosOf(SdnConnectorOpenFlow): + + def __init__(self, wim, wim_account, config=None, logger=None): + """Creates a connectivity based on pro-active openflow rules + """ + self.logger = logging.getLogger('openmano.sdnconn.onosof') + super().__init__(wim, wim_account, config, logger) + of_params = { + "of_url": wim["wim_url"], + "of_dpid": config.get("dpid"), + "of_user": wim_account["user"], + "of_password": wim_account["password"], + } + self.openflow_conn = OfConnOnos(of_params) + super().__init__(wim, wim_account, config, logger, self.openflow_conn)