Skip to content
Snippets Groups Projects
Select Git revision
  • ededfa65e0f75f054570057a6a242f1371675a5e
  • master default
  • cnit_ofc26
  • feat/344-implement-a-new-firewall-agent-controllable-through-restconf-openconfig
  • feat/343-integration-of-mimir-deployment-in-production-environment
  • ofc_polimi
  • feat/305-cttc-enhanced-netconf-openconfig-sbi-driver-for-dscm-pluggables
  • feat/306-cttc-enhanced-restconf-based-openconfig-nbi-for-dscm-pluggables
  • feat/301-cttc-dscm-pluggables
  • CTTC-IMPLEMENT-NBI-CONNECTOR-NOS-ZTP
  • CTTC-TEST-SMARTNICS-6GMICROSDN-ZTP
  • develop protected
  • feat/327-tid-new-service-to-ipowdm-controller-to-manage-transceivers-configuration-on-external-agent
  • cnit_tapi
  • feat/330-tid-pcep-component
  • feat/tid-newer-pcep-component
  • feat/116-ubi-updates-in-telemetry-backend-to-support-p4-in-band-network-telemetry
  • feat/292-cttc-implement-integration-test-for-ryu-openflow
  • cnit-p2mp-premerge
  • feat/325-tid-nbi-e2e-to-manage-e2e-path-computation
  • feat/326-tid-external-management-of-devices-telemetry-nbi
  • feat/324-tid-nbi-ietf_l3vpn-deploy-fail
  • v5.0.0 protected
  • v4.0.0 protected
  • demo-dpiab-eucnc2024
  • v3.0.0 protected
  • v2.1.0 protected
  • v2.0.0 protected
  • v1.0.0 protected
29 results

Analyzer_DB.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    test.py 1.87 KiB
    from ncclient import manager
    
    
    media_channel = ''' 
    <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">  
        <wavelength-router xmlns="http://openconfig.net/yang/wavelength-router">    
            <media-channels>      
                <channel operation="create">        
                <index>2</index>       
                    <config>          
                    <name>C_BAND</name>          
                    <optical-band-parent xmlns="http://flex-scale-project.eu/yang/flex-scale-mg-on">1</optical-band-parent>          
                    <index>2</index>          
                    <lower-frequency>192006251</lower-frequency>          
                    <upper-frequency>192056250</upper-frequency>       
                    </config>        
                <dest>          
                    <config>            
                    <port-name>2</port-name>          
                    </config>        
                </dest>      
                </channel>    
            </media-channels>  
        </wavelength-router>
    </config>
    
    '''
    
    
    
    
    
    
    # Define device connection details
    device = {
        'host': '10.0.2.4',  # replace with the target device's hostname or IP address
        'port': 2026,               # NETCONF default port
        'username': 'admin', # replace with your username
        'password': 'admin', # replace with your password
        'hostkey_verify': False ,   # disable host key verification (use only for testing)
    
        
        "look_for_keys": False,
        "allow_agent": False,
    
        "device_params": {
                    "name": "default"
                    },
    }
    
    # Establish a NETCONF connection
    with manager.connect(**device) as m:
        print("Connected to the device successfully!")
        config = m.get_config(source='running').data_xml
      
        print("Device Configuration:")
        with open('d.log', 'w') as log_file:
            print(config,file=log_file)
        # result = m.edit_config(target='running', config=media_channel)
        # print (result)