Commit c0ff3a4b authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

SRG configuration openroadm

parent d49c4b99
Loading
Loading
Loading
Loading

.context.log.swp

deleted100644 → 0
−128 KiB

File deleted.

delete.json

0 → 100644
+230 −0
Original line number Original line Diff line number Diff line
{
    "name": "OMS-DEG3-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG3-AMPTX",
    "port": "DEG3-AMPTX-IN/DEG3-AMPTX-OUT",
    "interface_list": "OMS-DEG3-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG2-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG2-AMPRX",
    "port": "DEG2-AMPRX-IN/DEG2-AMPRX-OUT",
    "interface_list": "OMS-DEG2-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG2-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG2-AMPRX",
    "port": "DEG2-AMPRX-IN/DEG2-AMPRX-OUT",
    "interface_list": "OMS-DEG2-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG4-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG4-AMPRX",
    "port": "DEG4-AMPRX-IN/DEG4-AMPRX-OUT",
    "interface_list": "OMS-DEG4-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG3-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG3-AMPRX",
    "port": "DEG3-AMPRX-IN/DEG3-AMPRX-OUT",
    "interface_list": "OMS-DEG3-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG2-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG2-AMPTX",
    "port": "DEG2-AMPTX-IN/DEG2-AMPTX-OUT",
    "interface_list": "OMS-DEG2-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "MC-TTP-DEG1-RX-192056250",
    "type": "mc",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-AMPRX",
    "port": "DEG1-AMPRX-OUT",
    "interface_list": "NMC-CTP-DEG1-RX-192056250",
    "frequency": 192056250.0,
    "width": 0
},
{
    "name": "DEG2-WSS",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG2-WSS",
    "port": "DEG2-WSS-IN1/DEG2-WSS-IN2/DEG2-WSS-IN3/DEG2-WSS-IN4/DEG2-WSS-IN5/DEG2-WSS-IN6/DEG2-WSS-OUT1/DEG2-WSS-OUT2/DEG2-WSS-OUT3/DEG2-WSS-OUT4/DEG2-WSS-OUT5/DEG2-WSS-OUT6/DEG2-WSS-RX/DEG2-WSS-TX",
    "interface_list": "Null",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG1-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-AMPTX",
    "port": "DEG1-AMPTX-IN/DEG1-AMPTX-OUT",
    "interface_list": "OMS-DEG1-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "DEG1-WSS",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-WSS",
    "port": "DEG1-WSS-IN1/DEG1-WSS-IN2/DEG1-WSS-IN3/DEG1-WSS-IN4/DEG1-WSS-IN5/DEG1-WSS-IN6/DEG1-WSS-OUT1/DEG1-WSS-OUT2/DEG1-WSS-OUT3/DEG1-WSS-OUT4/DEG1-WSS-OUT5/DEG1-WSS-OUT6/DEG1-WSS-RX/DEG1-WSS-TX",
    "interface_list": "Null",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG4-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG4-AMPTX",
    "port": "DEG4-AMPTX-IN/DEG4-AMPTX-OUT",
    "interface_list": "OMS-DEG4-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG1-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-AMPTX",
    "port": "DEG1-AMPTX-IN/DEG1-AMPTX-OUT",
    "interface_list": "OMS-DEG1-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "DEG4-WSS",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG4-WSS",
    "port": "DEG4-WSS-IN1/DEG4-WSS-IN2/DEG4-WSS-IN3/DEG4-WSS-IN4/DEG4-WSS-IN5/DEG4-WSS-IN6/DEG4-WSS-OUT1/DEG4-WSS-OUT2/DEG4-WSS-OUT3/DEG4-WSS-OUT4/DEG4-WSS-OUT5/DEG4-WSS-OUT6/DEG4-WSS-RX/DEG4-WSS-TX",
    "interface_list": "Null",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG4-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG4-AMPTX",
    "port": "DEG4-AMPTX-IN/DEG4-AMPTX-OUT",
    "interface_list": "OMS-DEG4-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG4-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG4-AMPRX",
    "port": "DEG4-AMPRX-IN/DEG4-AMPRX-OUT",
    "interface_list": "OMS-DEG4-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "NMC-CTP-DEG1-RX-192056250",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-AMPRX",
    "port": "DEG1-AMPRX-IN/DEG1-AMPRX-OUT",
    "interface_list": "NMC-CTP-DEG1-RX-192056250",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "NMC-CTP-DEG1-RX-192056250",
    "type": "nmc",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG1-AMPRX",
    "port": "DEG1-AMPRX-OUT",
    "interface_list": "NMC-CTP-DEG1-RX-192056250",
    "frequency": 192056250.0,
    "width": 100000
},
{
    "name": "OMS-DEG2-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG2-AMPTX",
    "port": "DEG2-AMPTX-IN/DEG2-AMPTX-OUT",
    "interface_list": "OMS-DEG2-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "NMC-SRG-SRG1-WSS-192031250",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "SRG1-WSS",
    "port": "SRG1-INT-IN1/SRG1-INT-IN2/SRG1-INT-IN3/SRG1-INT-IN4/SRG1-INT-OUT1/SRG1-INT-OUT2/SRG1-INT-OUT3/SRG1-INT-OUT4/SRG1-IN1/SRG1-IN2/SRG1-IN3/SRG1-IN4/SRG1-IN5/SRG1-IN6/SRG1-OUT1/SRG1-OUT2/SRG1-OUT3/SRG1-OUT4/SRG1-OUT5/SRG1-OUT6",
    "interface_list": "NMC-SRG-SRG1-WSS-192031250",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG3-TTP-TX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG3-AMPTX",
    "port": "DEG3-AMPTX-IN/DEG3-AMPTX-OUT",
    "interface_list": "OMS-DEG3-TTP-TX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "OMS-DEG3-TTP-RX",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG3-AMPRX",
    "port": "DEG3-AMPRX-IN/DEG3-AMPRX-OUT",
    "interface_list": "OMS-DEG3-TTP-RX",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "DEG3-WSS",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "DEG3-WSS",
    "port": "DEG3-WSS-IN1/DEG3-WSS-IN2/DEG3-WSS-IN3/DEG3-WSS-IN4/DEG3-WSS-IN5/DEG3-WSS-IN6/DEG3-WSS-OUT1/DEG3-WSS-OUT2/DEG3-WSS-OUT3/DEG3-WSS-OUT4/DEG3-WSS-OUT5/DEG3-WSS-OUT6/DEG3-WSS-RX/DEG3-WSS-TX",
    "interface_list": "Null",
    "frequency": 0.0,
    "width": 0
},
{
    "name": "NMC-SRG-SRG1-WSS-192031250",
    "type": "Null",
    "administrative_state": "inService",
    "circuit_pack_name": "SRG1-WSS",
    "port": "SRG1-INT-IN1/SRG1-INT-IN2/SRG1-INT-IN3/SRG1-INT-IN4/SRG1-INT-OUT1/SRG1-INT-OUT2/SRG1-INT-OUT3/SRG1-INT-OUT4/SRG1-IN1/SRG1-IN2/SRG1-IN3/SRG1-IN4/SRG1-IN5/SRG1-IN6/SRG1-OUT1/SRG1-OUT2/SRG1-OUT3/SRG1-OUT4/SRG1-OUT5/SRG1-OUT6",
    "interface_list": "NMC-SRG-SRG1-WSS-192031250",
    "frequency": 0.0,
    "width": 0
}
 No newline at end of file
+35 −8
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?><data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<?xml version="1.0" encoding="UTF-8"?><data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <org-openroadm-device xmlns="http://org/openroadm/device">
    <org-openroadm-device xmlns="http://org/openroadm/device" xmlns:wd="urn:ietf:params:xml:ns:netconf:default:1.0">
      <info>
      <info>
        <node-id>ROADM-Torino</node-id>
        <node-id>ROADM-Torino</node-id>
        <node-number>1</node-number>
        <node-number>1</node-number>
@@ -1181,32 +1181,47 @@
        <type>openROADM-if:mediaChannelTrailTerminationPoint</type>
        <type>openROADM-if:mediaChannelTrailTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>DEG1-AMPRX</supporting-circuit-pack-name>
        <supporting-circuit-pack-name>DEG1-AMPRX</supporting-circuit-pack-name>
        <supporting-port>DEG1-AMPRX-OUT</supporting-port>
        <supporting-port>DEG1-AMPRX-IN</supporting-port>
        <supporting-interface-list>OMS-DEG1-TTP-RX</supporting-interface-list>
        <supporting-interface-list>OMS-DEG1-TTP-RX</supporting-interface-list>
        <mc-ttp xmlns="http://org/openroadm/media-channel-interfaces">
        <mc-ttp xmlns="http://org/openroadm/media-channel-interfaces">
          <max-freq>192056300000.0</max-freq>
          <max-freq>192056300000.0</max-freq>
          <min-freq>192056200000.0</min-freq>
          <min-freq>192056200000.0</min-freq>
        </mc-ttp>
        </mc-ttp>
        <supporting-interface-list>NMC-CTP-DEG1-RX-192056250</supporting-interface-list>
      </interface>
      <interface>
        <name>NMC-CTP-DEG1-RX-192056250</name>
        <description>Media-channel-192056250THz</description>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>DEG1-AMPRX</supporting-circuit-pack-name>
        <supporting-port>DEG1-AMPRX-IN</supporting-port>
        <supporting-interface-list>OMS-DEG1-TTP-RX</supporting-interface-list>
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
          <frequency>192056250</frequency>
          <width>100000.0</width>
        </nmc-ctp>
        <supporting-interface-list>NMC-CTP-DEG1-RX-192056250</supporting-interface-list>
      </interface>
      </interface>
      <interface>
      <interface>
        <name>NMC-SRG-SRG1-WSS-SRG1-WSStype-192031250</name>
        <name>NMC-SRG-SRG1-WSS-192031250</name>
        <description>Network-Media-Channel-CTP-192031250THz</description>
        <description>Network-Media-Channel-CTP-192031250THz</description>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>SRG1-WSS</supporting-circuit-pack-name>
        <supporting-circuit-pack-name>SRG1-WSS</supporting-circuit-pack-name>
        <supporting-port>SRG1-OUT2</supporting-port>
        <supporting-port>SRG1-IN3</supporting-port>
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
          <frequency>192031250</frequency>
          <frequency>192031250</frequency>
          <width>50000.0</width>
          <width>50000.0</width>
        </nmc-ctp>
        </nmc-ctp>
      </interface>
      </interface>
      <interface>
      <interface>
        <name>NMC-CTP-DEG1-RX-192056250</name>
        <name>NMC-NMC-CTP-DEG1-RX-192056250</name>
        <description>Media-channel-192056250THz</description>
        <description>Media-channel-192056250THz</description>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>DEG1-AMPRX</supporting-circuit-pack-name>
        <supporting-circuit-pack-name>DEG1-AMPRX</supporting-circuit-pack-name>
        <supporting-port>DEG1-AMPRX-OUT</supporting-port>
        <supporting-port>DEG1-AMPRX-IN</supporting-port>
        <supporting-interface-list>OMS-DEG1-TTP-RX</supporting-interface-list>
        <supporting-interface-list>OMS-DEG1-TTP-RX</supporting-interface-list>
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
          <frequency>192056250</frequency>
          <frequency>192056250</frequency>
@@ -1214,17 +1229,29 @@
        </nmc-ctp>
        </nmc-ctp>
      </interface>
      </interface>
      <interface>
      <interface>
        <name>NMC-SRG1-WSS-SRG1-WSStype-192031250</name>
        <name>NMC-SRG-SRG-SRG1-WSS-192031250</name>
        <description>Network-Media-Channel-CTP-192031250THz</description>
        <description>Network-Media-Channel-CTP-192031250THz</description>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>SRG1-WSS</supporting-circuit-pack-name>
        <supporting-circuit-pack-name>SRG1-WSS</supporting-circuit-pack-name>
        <supporting-port>SRG1-OUT2</supporting-port>
        <supporting-port>SRG1-IN3</supporting-port>
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
          <frequency>192031250</frequency>
          <frequency>192031250</frequency>
          <width>50000.0</width>
          <width>50000.0</width>
        </nmc-ctp>
        </nmc-ctp>
      </interface>
      </interface>
      <interface>
        <name>NMC-SRG-SRG-SRG1-WSS-192056250</name>
        <description>Network-Media-Channel-CTP-192056250THz</description>
        <type>openROADM-if:networkMediaChannelConnectionTerminationPoint</type>
        <administrative-state>inService</administrative-state>
        <supporting-circuit-pack-name>SRG1-WSS</supporting-circuit-pack-name>
        <supporting-port>SRG1-IN3</supporting-port>
        <nmc-ctp xmlns="http://org/openroadm/network-media-channel-interfaces">
          <frequency>192056250</frequency>
          <width>100000</width>
        </nmc-ctp>
      </interface>
    </org-openroadm-device>
    </org-openroadm-device>
    <netopeer xmlns="urn:cesnet:tmc:netopeer:1.0">
    <netopeer xmlns="urn:cesnet:tmc:netopeer:1.0">
      <modules>
      <modules>

device.xml

deleted100644 → 0
+0 −260

File deleted.

Preview size limit exceeded, changes collapsed.

+14 −8
Original line number Original line Diff line number Diff line
@@ -99,10 +99,9 @@ class OpenConfigServicer(DeviceServiceServicer):
            driver : _Driver = get_driver(self.driver_instance_cache, device)
            driver : _Driver = get_driver(self.driver_instance_cache, device)
            results,new_config = driver.SetConfig(resources=resources,conditions=conditions)
            results,new_config = driver.SetConfig(resources=resources,conditions=conditions)
        
        
            for result in results:
            errors = [r for r in results if r is not None]
                if  result  is not None:
            if errors:
                    is_all_good = False
                raise Exception(f"Driver errors: {errors}")
                    raise Exception(result)


            if is_all_good:
            if is_all_good:
                #driver.GetConfig(resource_keys=[])   
                #driver.GetConfig(resource_keys=[])   
@@ -112,15 +111,22 @@ class OpenConfigServicer(DeviceServiceServicer):
                if handled_flow is not None and len(handled_flow) > 0:
                if handled_flow is not None and len(handled_flow) > 0:
                    config['flow_handled'] = handled_flow['value']
                    config['flow_handled'] = handled_flow['value']
                    
                    
                    
                if 'interfaces' in new_config and device.device_type == DeviceTypeEnum.OPEN_ROADM._value_:
                    LOGGER.info(f"with_new_config  {new_config}") 
                    config["interfaces"].extend(new_config['interfaces'])
                    LOGGER.info(f"updating_the_oc  {request}") 
                    request.config=json.dumps(config) 
                    request.config=json.dumps(config) 
                if 'interfaces' in new_config and device.type == DeviceTypeEnum.OPEN_ROADM._value_:
                    config["interfaces"]=new_config['interfaces']    
                    context_client.SetOpticalConfig(request)   
                    context_client.SetOpticalConfig(request)   
                else :    
                else :    
                    request.config=json.dumps(config) 
                    context_client.UpdateOpticalConfig(request) 
                    context_client.UpdateOpticalConfig(request) 
                context_client.close()    
                
        except Exception as e:
        except Exception as e:
            logging.error("Exception occurred:\n%s", traceback.format_exc())   
            logging.error("Exception occurred:\n%s", traceback.format_exc())   
        finally : 
            context_client.close()   
                
        return Empty()
        return Empty()


    @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
    @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
Loading