[NETCONF-769] Cannot create new NETCONF connector with a POST Created: 05/May/21  Updated: 04/Nov/21  Resolved: 04/Nov/21

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: mikael petterson Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have opendaylight-14.0.0 installed.

I am following this guide:

https://docs.opendaylight.org/projects/netconf/en/latest/user-guide.html#southbound-netconf-connector

I have started karaf with java 11 and done:

feature:install odl-restconf

feature:install odl-netconf-topology

curl -vv -k -X POST --header 'Content-Type: application/json' -u admin:admin http://10.200.120.168:8181/rest/data/network-topology:network-topology/topology=topology-netconf -d @create-new-netconf-connector.json

  • About to connect() to 10.200.120.168 port 8181 (#0)
  • Trying 10.200.120.168...
  • Connected to 10.200.120.168 (10.200.120.168) port 8181 (#0)
  • Server auth using Basic with user 'admin'
    > POST /rest/data/network-topology:network-topology/topology=topology-netconf HTTP/1.1
    > Authorization: Basic YWRtaW46YWRtaW4=
    > User-Agent: curl/7.29.0
    > Host: 10.200.120.168:8181
    > Accept: /
    > Content-Type: application/json
    > Content-Length: 722
    >
  • upload completely sent off: 722 out of 722 bytes
    < HTTP/1.1 401 Unauthorized
    < Cache-Control: must-revalidate,no-cache,no-store
    < Content-Type: text/html;charset=iso-8859-1
    < Content-Length: 436
    <
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>Error 401 Unauthorized</title>
    </head>
    <body><h2>HTTP ERROR 401 Unauthorized</h2>
    <table>
    <tr><th>URI:</th><td>/rest/data/network-topology:network-topology/topology=topology-netconf</td></tr>
    <tr><th>STATUS:</th><td>401</td></tr>
    <tr><th>MESSAGE:</th><td>Unauthorized</td></tr>
    <tr><th>SERVLET:</th><td>default</td></tr>
    </table>

</body>
</html>

 

What am I lacking?

 

//mike



 Comments   
Comment by Tomas Cere [ 02/Jul/21 ]

Looks like you have a typo in the link you are trying to send the POST request to:

http://10.200.120.168:8181/rest/data/network-topology:network-topology/topology=topology-netconf 

The rfc8040 restconf endpoint is located under /rests/data

Generated at Wed Feb 07 20:15:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.