Hello, For Cisco (at least, XRv 5.3.0) I can get some data from operational and config datastore. But for Juniper - I can get data only from config datastore. I can alter config of Cisco device, both with json or xml format. For Juniper, when I trying to reconfigure hostname with XML configuration doesn`t apply to device, in karaf.log with debug enabled I see only full configuration (like get-config RPC reply). Json way for Juniper also don`t work, java exeptions appears for PUT and 409 conflict for POST.
I turn on these debugs, but I don`t see outbound (from ODL to device) netconf messages, only replies from device: opendaylight-user@root>log:list Logger | Level --------------------------------------------------------- ROOT | ERROR org.opendaylight.controller.netconf | DEBUG org.opendaylight.controller.sal-netconf-connector | DEBUG org.opendaylight.controller.sal.connect.netconf | DEBUG org.opendaylight.netconf.sal | DEBUG Cisco, get operational datastore data: GET http://192.168.5.199:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/xrv-P1/yang-ext:mount/ { "Cisco-IOS-XR-man-netconf-cfg:netconf-yang": { "agent": { "ssh": { "enable": [ null ] } } }, "Cisco-IOS-XR-ha-eem-oper:system-monitoring": { "cpu-utilization": [ { "node-name": "0/0/CPU0", "total-cpu-fifteen-minute": 0, "total-cpu-one-minute": 0, "total-cpu-five-minute": 0, "process-cpu": [ { "process-cpu-fifteen-minute": 0, "process-id": 1, "process-cpu-five-minute": 0, "process-cpu-one-minute": 0, "process-name": "kernel" } ...........cut........... Cisco, get config datastore data: GET http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/xrv-P1/yang-ext:mount/ { "Cisco-IOS-XR-man-netconf-cfg:netconf-yang": { "agent": { "ssh": { "enable": [ null ] } } }, "Cisco-IOS-XR-shellutil-cfg:host-name": "xrv-P1", "Cisco-IOS-XR-ifmgr-cfg:interface-configurations": { "interface-configuration": [ { "interface-name": "Loopback0", "active": "act", "interface-virtual": [ null ], "Cisco-IOS-XR-ipv4-io-cfg:ipv4-network": { "addresses": { "primary": { "address": "172.16.17.1", "netmask": "255.255.255.255" } ...........cut........... Juniper, get operational datastore data: GET http://192.168.5.199:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/PE-1/yang-ext:mount/ Result: { "errors": { "error": [ { "error-type": "application", "error-tag": "data-missing", "error-message": "Request could not be completed because the relevant data model content does not exist " } ] } } Juniper, get config datastore data: GET http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/PE-1/yang-ext:mount/ Result: { "configuration:configuration": { "interfaces": { "interface": [ { "name": "lo0", "unit": [ { "name": "0", "family": { "iso": { "address": [ { "name": "49.0010.1720.1601.6001.00" } ----CUT--- (full config at Json format) } Alter config of Cisco device, both with json or xml format: PUT http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/xrv-P1/yang-ext:mount/Cisco-IOS-XR-ifmgr-cfg:interface-configurations/interface-configuration/act/Loopback11/ { "interface-configuration": [ { "interface-name": "Loopback11", "active": "act", "interface-virtual": [ null ], "Cisco-IOS-XR-ipv4-io-cfg:ipv4-network": { "addresses": { "primary": { "address": "1.1.1.1", "netmask": "255.255.255.255" } } }, "description": "Netconf-test-Json" } ] } Status: 201 created POST http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/xrv-P1/yang-ext:mount/Cisco-IOS-XR-ifmgr-cfg:interface-configurations <interface-configuration xmlns=" http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"> <active>act</active> <interface-name>Loopback11</interface-name> <description>NETCONF-XML-TEST</description> <interface-virtual/> <ipv4-network xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-io-cfg"> <addresses> <primary> <address>1.1.1.1</address> <netmask>255.255.255.255</netmask> </primary> </addresses> </ipv4-network> </interface-configuration> Status: 204 no content (but configurations is applied) And xml way works only if interface Lo11 does not exist. For Juniper, when I trying to reconfigure hostname with XML: PUT http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/PE-1/yang-ext:mount/configuration:configuration/ <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"> <system> <host-name>vMX-PE1</host-name> </system> </configuration> Status: 200 OK Configuration doesn`t apply to device, in karaf.log with debug enabled I see this: opendaylight-user@root>log:tail 2017-02-27 14:32:54,215 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-15"> <ok/> </rpc-reply> 2017-02-27 14:32:54,233 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-16"> <data> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" junos:commit-localtime="2017-02-27 12:21:44 UTC" junos:commit-seconds="1488198104" junos:commit-user="root"> <version>16.1R3.10</version> <system> <host-name>PE1</host-name> <root-authentication> ----CUT--- (full config at XML format) </configuration> </data> </rpc-reply> 2017-02-27 14:32:54,249 | DEBUG | oupCloseable-3-2 | BrokerFacade | 267 - org.opendaylight.netconf.sal-rest-connector - 1.4.2.Boron-SR2 | Reading result data from transaction. 2017-02-27 14:32:54,280 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-17"> <ok/> </rpc-reply> 2017-02-27 14:32:54,839 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-18"> <ok/> </rpc-reply> 2017-02-27 14:32:54,909 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-19"> <ok/> </rpc-reply> Json way for Juniper also don`t work, java exeptions appears for PUT: PUT http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/PE-1/yang-ext:mount/configuration:configuration/ body: { "system": { "host-name": "netconf-PE1" } } Result: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-type>protocol</error-type> <error-tag>malformed-message</error-tag> <error-message>Error parsing input: Schema node with name system wasn't found under (urn:ietf:params:xml:ns:netconf:base:1.0)data.</error-message> <error-info>java.lang.IllegalStateException: Schema node with name system wasn't found under (urn:ietf:params:xml:ns:netconf:base:1.0)data. at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.resolveNamespace(JsonParserStream.java:316) at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:218) ----CUT--- (more errors) POST http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/PE-1/yang-ext:mount/configuration:configuration/ body: { "system": { "host-name": "netconf-PE1" } } Result: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-type>protocol</error-type> <error-tag>data-exists</error-tag> <error-message>Data already exists for path: /( http://xml.juniper.net/xnm/1.1/xnm?revision=2015-09-11)configuration/system </error-message> </error> </errors> Status: 409 conflict Log file: opendaylight-user@root>log:clear opendaylight-user@root>log:tail 2017-02-27 14:52:34,349 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-38"> <ok/> </rpc-reply> 2017-02-27 14:52:34,414 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-39"> <data> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" junos:commit-localtime="2017-02-27 13:13:31 UTC" junos:commit-seconds="1488201211" junos:commit-user="root"> <system> <host-name>PE1</host-name> <root-authentication> ----CUT--- (system config at XML format) </system> </configuration> </data> </rpc-reply> 2017-02-27 14:52:34,418 | DEBUG | qtp2111324189-71 | BrokerFacade | 267 - org.opendaylight.netconf.sal-rest-connector - 1.4.2.Boron-SR2 | Reading result data from transaction. 2017-02-27 14:52:34,419 | DEBUG | qtp2111324189-71 | estconfDocumentedExceptionMapper | 267 - org.opendaylight.netconf.sal-rest-connector - 1.4.2.Boron-SR2 | In toResponse: errors: [RestconfError [error-type: protocol, error-tag: data-exists, error-message: Data already exists for path: /( http://xml.juniper.net/xnm/1.1/xnm?revision=2015-09-11)configuration/system ]] 2017-02-27 14:52:34,419 | DEBUG | qtp2111324189-71 | estconfDocumentedExceptionMapper | 267 - org.opendaylight.netconf.sal-rest-connector - 1.4.2.Boron-SR2 | Accept headers: [application/xml] 2017-02-27 14:52:34,419 | DEBUG | qtp2111324189-71 | estconfDocumentedExceptionMapper | 267 - org.opendaylight.netconf.sal-rest-connector - 1.4.2.Boron-SR2 | Using MediaType: application/xml 2017-02-27 14:52:34,573 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-40"> <ok/> </rpc-reply> 2017-02-27 14:52:34,626 | DEBUG | oupCloseable-3-2 | NetconfDeviceCommunicator | 327 - org.opendaylight.netconf.sal-netconf-connector - 1.4.2.Boron-SR2 | RemoteDevice{PE-1}: Message received <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos=" http://xml.juniper.net/junos/16.1R3/junos" message-id="m-41"> <ok/> </rpc-reply>
_______________________________________________ controller-dev mailing list controller-dev@lists.opendaylight.org https://lists.opendaylight.org/mailman/listinfo/controller-dev