cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3250
Views
3
Helpful
1
Replies
Highlighted
Cisco Employee

PUT and POST operation error on RESTCONF CONF

Hi,

I am fairly new to ODL. I managed to set up PCEP and BGP-LS on ODL connected to CRS box, However I am facing some issues.

Currently I can GET the configuration from the box using PCEP-topology and BGP-LS topology, however PUT or POST function doesn't work. Since tunnels are delegated on the CRS box, I need the operation working in order to make any changes.

Here are my configuration details, Please take a look, any type of suggestions are appreciated. Below outputs are collected from POSTMAN

POST FUNCTION:

http://localhost:8181/restconf/config/network-topology:network-topology/topology/pcep-topology

500 server error

Header:

Access-Control-Allow-Credentials true
Access-Control-Allow-Origin file://
Access-Control-Expose-Headers location
Content-Type application/json
Server Jetty(8.1.15.v20140411)
Transfer-Encoding
chunked

Server error:

2016-04-29 14:01:33,459 | INFO | p684741745-10980 | RestconfImpl | 300 - org.opendaylight.netconf.sal-rest-connector - 1.3.1.Beryllium-SR1 | Error creating data config/network-topology:network-topology/topology/pcep-topology java.lang.NullPointerException at org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.checkInstanceIdentifierReferencesData(AbstractDOMBrokerWriteTransaction.java:80) at org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.put(AbstractDOMBrokerWriteTransaction.java:73) at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.postDataViaTransaction(BrokerFacade.java:330)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.commitConfigurationDataPost(BrokerFacade.java:216)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:871)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:816)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.createConfigurationData(StatisticsRestconfServiceWrapper.java:152)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.createConfigurationData(RestconfCompositeWrapper.java:89)[300:org.opendaylight.netconf.sal-rest-connector:1.3.1.Beryllium-SR1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_79] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_79] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_79] at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_79] at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)[248:com.sun.jersey.jersey-server:1.17.0] at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)[266:com.sun.jersey.servlet:1.17.0] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)[266:com.sun.jersey.servlet:1.17.0] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)[266:com.sun.jersey.servlet:1.17.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)[230:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:247)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:210)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:256)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)[294:org.apache.shiro.core:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)[294:org.apache.shiro.core:1.2.3] at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)[294:org.apache.shiro.core:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)[293:org.apache.shiro.web:1.2.3] at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)[293:org.apache.shiro.web:1.2.3] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[245:org.ops4j.pax.web.pax-web-jetty:3.1.4] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[245:org.ops4j.pax.web.pax-web-jetty:3.1.4] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[245:org.ops4j.pax.web.pax-web-jetty:3.1.4] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.Server.handle(Server.java:370)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[236:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]

========================

PUT FUNCTION:

http://localhost:8181/restconf/config/network-topology:network-topology/topology/pcep-topology

Received 400 BAD REQUEST

{ "errors": { "error": [ { "error-type": "protocol", "error-tag": "malformed-message", "error-message": "Input is required." } ] } } Access-Control-Allow-Credentials true Access-Control-Allow-Origin file:// Access-Control-Expose-Headers location Content-Type application/json Server Jetty(8.1.15.v20140411) Transfer-Encoding chunked

No error on the server

=================

Working Get output

Content-Encoding gzip
Content-Type application/yang.data+json
Server Jetty(8.1.15.v20140411)
Transfer-Encoding chunked
Vary Accept-Encoding, User-Agent




{
 
"topology": [
  
{
  
"topology-id": "pcep-topology",
  
"topology-types": {
  
"network-topology-pcep:topology-pcep": {}
  
},
  
"node": [
  
{
  
"node-id": "pcc://192.168.1.2",
  
"network-topology-pcep:path-computation-client": {
  
"reported-lsp": [
  
{
  
"name": "blue3_t16",
  
"path": [
  
{
  
"lsp-id": 3,
  
"lspa": {
  
"local-protection-desired": false,
  
"hold-priority": 7,
  
"ignore": false,
  
"include-all": 0,
  
"include-any": 0,
  
"processing-rule": false,
  
"exclude-any": 0,
  
"tlvs": {},
  
"setup-priority": 7
  
},
  
"bandwidth": {
  
"ignore": false,
  
"processing-rule": false,
  
"bandwidth": "AAAAAA=="
  
},
  
"odl-pcep-ietf-stateful07:lsp": {
  
"remove": false,
  
"ignore": false,
  
"plsp-id": 17,
  
"delegate": true,
  
"administrative": true,
  
"processing-rule": false,
  
"odl-pcep-ietf-initiated00:create": false,
  
"sync": false,
  
"operational": "up",
  
"tlvs": {
  
"lsp-identifiers": {
  
"ipv4": {
  
"ipv4-tunnel-sender-address": "6.6.6.6",
  
"ipv4-extended-tunnel-id": "1.1.1.1",
  
"ipv4-tunnel-endpoint-address": "1.1.1.1"
  
},
  
"tunnel-id": 16,
  
"lsp-id": 3
  
},
  
"symbolic-path-name": {
  
"path-name": "Ymx1ZTNfdDE2"
  
},
  
"path-binding": {
  
"binding-value": "AAXc4AA=",
  
"binding-type": 0
  
}
  
}
  
},
  
"ero": {
  
"ignore": false,
  
"processing-rule": false,
  
"subobject": [
  
{
  
"ip-prefix": {
  
"ip-prefix": "192.168.2.2/32"
  
},
  
"loose": false
  
},
  
{
  
"ip-prefix": {
  
"ip-prefix": "192.168.3.2/32"
  
},
  
"loose": false
  
},
  
{
  
"ip-prefix": {
  
"ip-prefix": "1.1.1.1/32"
  
},
  
"loose": false
  
}
  
]
  
}
  
}
  
]
  
},
  
{
  
"name": "blue3_t11",
  
"path": [
  
{
  
"lsp-id": 63,
  
"lspa": {
  
"local-protection-desired": false,
  
"hold-priority": 7,
  
"ignore": false,
  
"include-all": 0,
  
"include-any": 0,
  
"processing-rule": false,
  
"exclude-any": 0,
  
"tlvs": {},
  
"setup-priority": 7
  
},
  
"bandwidth": {
  
"ignore": false,
  
"processing-rule": false,
  
"bandwidth": "AAAAAA=="
  
},
  
"odl-pcep-ietf-stateful07:lsp": {
  
"remove": false,
  
"ignore": false,
  
"plsp-id": 12,
  
"delegate": true,
  
"administrative": true,
  
"processing-rule": false,
  
"odl-pcep-ietf-initiated00:create": false,
  
"sync": false,
  
"operational": "up",
  
"tlvs": {
  
"lsp-identifiers": {
  
"ipv4": {
  
"ipv4-tunnel-sender-address": "6.6.6.6",
  
"ipv4-extended-tunnel-id": "1.1.1.1",
  
"ipv4-tunnel-endpoint-address": "1.1.1.1"
  
},
  
"tunnel-id": 11,
  
"lsp-id": 63
  
},
  
"symbolic-path-name": {
  
"path-name": "Ymx1ZTNfdDEx"
  
},
  
"path-binding": {
  
"binding-value": "AAXcQAA=",
  
"binding-type": 0
  
}
  
}
  
},
  
"ero": {
  
"ignore": false,
  
"processing-rule": false,
  
"subobject": [
  
{
  
"ip-prefix": {
  
"ip-prefix": "1.35.1.2/32"
  
},
  
"loose": false
  
},
  
{
  
"ip-prefix": {
  
"ip-prefix": "1.1.1.1/32"
  
},
  
"loose": false
  
}
  
]
  
}
  
}
  
]
  
}
  
],
  
"stateful-tlv": {
  
"odl-pcep-ietf-stateful07:stateful": {
  
"odl-pcep-ietf-initiated00:initiation": true,
  
"lsp-update-capability": true
  
}
  
},
  
"state-sync": "synchronized",
  
"ip-address": "192.168.1.2"
  
}
  
}
  
]
  
}
 
]
}

POST on stack overflow: http://stackoverflow.com/questions/36944923/postman-restconf-put-and-post-function-error

1 REPLY 1
Cisco Employee

Re: PUT and POST operation error on RESTCONF CONF

I've replied on Stack Overflow (noting that it probably isn't the right place to ask the question).

As I said there, you'd be better off asking on the ODL BGP users mailer.  You can subscribe at:

https://lists.opendaylight.org/mailman/listinfor/bgpcep-users

or you could look in the ODL Wiki at:

https://wiki.opendaylight.org/view/BGP_LS_PCEP:Beryllium_Operations_Guide#Tunnel_Management_for_draft-ietf-pce-stateful-pce-07_and_draft-ietf-pce-pce-initiated-lsp-00

At any rate the brief summary is that the PCE-P topology is only present as operational data (not as config). To add LSPs you issue an RPC call.

It looks like you want to modify an existing LSP.  In that case you need an "update-lsp" RPC.  So to do that you would do a POST to:

http://localhost:8181/restconf/operations/network-topology:network-topology/topology/pcep-topology/update-lsp


if you're using JSON the message body would look like:

{

  "input" : {

    "node" : "pcc://192.168.1.2",

    "name" : "blue3_t16",

    "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]",

    "arguments": {

      "pcep-ietf-stateful:lsp": {

        "administrative": "true",

        "delegate": "true"

      },

      "ero" : {

        "subobject" :[

          {

            "ip-prefix": {

              "ip-prefix": "192.168.2.2/32"

            },

            "loose": false

          },

          {

            "ip-prefix": {

              "ip-prefix": "192.168.3.2/32"

            },

            "loose": false

          },

          {

            "ip-prefix": {

              "ip-prefix": "1.1.1.1/32"

            },

            "loose": false

          }

        ]

      }

    }

  }

}

(you'd want to change the ERO of course - I copied the one you have as already reported).

Content for Community-Ad
August's Community Spotlight Awards