/
netconf-cli

netconf-cli


Install

pip3 install netconf 




hello

netconf-client --host 172.16.10.206 -u ocnos -p ocnos --hello



get-config

netconf-client --host 172.16.10.206 -u ocnos -p ocnos --get-config


get + filter


get + filter
netconf-client --host 172.16.10.206 -u ocnos -p ocnos --get '<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
        <interface>
          <state>
            <name>xe5</name>
          </state>
        </interface>

>>> the response will be:
-------------------------

  <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
       <interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
  <interface>
    <name>xe5</name>
      <state>
        <name>xe5</name>
        <ifindex>10006</ifindex>
        <admin-status>up</admin-status>
        <oper-status>up</oper-status>
        <last-change>15300</last-change>
        <logical>false</logical>
        <counters>
          <in-octets>1913744</in-octets>
          <in-pkts>18400</in-pkts>
          <in-unicast-pkts>0</in-unicast-pkts>
          <in-broadcast-pkts>0</in-broadcast-pkts>
          <in-multicast-pkts>18400</in-multicast-pkts>
. . . 






Related content

OcNOS automation with netconfig
OcNOS automation with netconfig
More like this
yangcli from external server or OcNOS shell ( start-shell )
yangcli from external server or OcNOS shell ( start-shell )
More like this
show commands VPLS on OcNOS
show commands VPLS on OcNOS
More like this
configure interface and tunnel
configure interface and tunnel
More like this
TWAMP on OcNOS netconf
TWAMP on OcNOS netconf
More like this
configure interface description and ip address with NetConf
configure interface description and ip address with NetConf
More like this