Skip to content

Instantly share code, notes, and snippets.

@mirceaulinic
Created October 18, 2016 04:16
Show Gist options
  • Save mirceaulinic/4c7ba8d8a5f90892aa46d16ebe8f1635 to your computer and use it in GitHub Desktop.
Save mirceaulinic/4c7ba8d8a5f90892aa46d16ebe8f1635 to your computer and use it in GitHub Desktop.
Config data from interfaces OC
>>> dev.rpc.get_config('<interfaces xmlns="http://openconfig.net/yang/interfaces"/>')
{u'data': {u'interfaces': {u'interface': [{u'ethernet': {u'config': {u'auto-negotiate': u'false'}}, u'config': {u'enabled': u'true', u'type': u'idx:ethernetCsmacd', u'name': u'MgmtEth0/RP0/CPU0/0'}, u'name': u'MgmtEth0/RP0/CPU0/0'}, {u'ethernet': {u'config': {u'auto-negotiate': u'false'}}, u'config': {u'enabled': u'false', u'type': u'idx:ethernetCsmacd', u'name': u'GigabitEthernet0/0/0/0'}, u'name': u'GigabitEthernet0/0/0/0'}, {u'ethernet': {u'config': {u'auto-negotiate': u'false'}}, u'config': {u'enabled': u'false', u'type': u'idx:ethernetCsmacd', u'name': u'GigabitEthernet0/0/0/1'}, u'name': u'GigabitEthernet0/0/0/1'}, {u'ethernet': {u'config': {u'auto-negotiate': u'false'}}, u'config': {u'enabled': u'false', u'type': u'idx:ethernetCsmacd', u'name': u'GigabitEthernet0/0/0/2'}, u'name': u'GigabitEthernet0/0/0/2'}, {u'ethernet': {u'config': {u'auto-negotiate': u'false'}}, u'config': {u'enabled': u'false', u'type': u'idx:ethernetCsmacd', u'name': u'GigabitEthernet0/0/0/3'}, u'name': u'GigabitEthernet0/0/0/3'}]}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment