How to add Multiple flows using single REST call

asked 2016-06-16 23:57:53 -0800

krishceg gravatar image

updated 2016-06-16 23:59:26 -0800

Hello Team ,

Can anyone tell how to add multiple ( more than 100 flows ) flows to switches using single REST API call either through Config Data store or RPC .

I tried using Bulk-o-matic application But I am Getting Null Pointer Exception in org.opendaylight.openflowplugin.applications.bulk.o.matic.SalBulkFlowServiceImpl.addFlowsDs(SalBulkFlowServiceImpl.java:72)

Can anyone tell me whats is the issue with my restcall?

Bulk-o-matic yang

https://github.com/opendaylight/openf...

REST Call ( tried to add only single flow )

"curl -v --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -k -X POST -d ' false 3 255 105 0 65530 0 0 false 0 0 3 2 ' https://10.45.0.227:8443/restconf/ope...

Curl Response

  • Connection #0 to host 10.45.0.227 left intact tel@tel-ProLiant-ML150-Gen9:~$ curl -v --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -k -X POST -d ' > > false > 3 > 255 > 105 > 0 > 65530 > 0 > 0 > false > > > 0 > > > 0 > > 3 > > > > > > > 2 > > ' https://10.45.0.227:8443/restconf/ope...
  • Trying 10.45.0.227...
  • Connected to 10.45.0.227 (10.45.0.227) port 8443 (#0)
  • found 187 certificates in /etc/ssl/certs/ca-certificates.crt
  • found 753 certificates in /etc/ssl/certs
  • ALPN, offering http/1.1
  • SSL connection using TLS1.2 / ECDHERSAAES128CBC_SHA1
  • server certificate verification SKIPPED
  • server certificate status verification SKIPPED
  • common name: Sanket Tandulwadkar (does not match '10.45.0.227')
  • server certificate expiration date OK
  • server certificate activation date OK
  • certificate public key: RSA
  • certificate version: #3
  • subject: C=US,ST=MA,L=Billerica,O=Avaya,OU=VEGA,CN=Sanket Tandulwadkar
  • start date: Tue, 19 Jan 2016 15:10:59 GMT
  • expire date: Fri, 16 Jan 2026 15:10:59 GMT
  • issuer: C=US,ST=MA,L=Billerica,O=Avaya,OU=VEGA,CN=Sanket Tandulwadkar
  • compression: NULL
  • ALPN, server did not agree to a protocol
  • Server auth using Basic with user 'admin' > POST /restconf/operations/sal-bulk-flow:add-flows-ds HTTP/1.1 > Host: 10.45.0.227:8443 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.43.0 > Accept: application/xml > Content-type: application/xml > Content-Length: 813 >
  • upload completely sent off: 813 out of 813 bytes < HTTP/1.1 500 Server Error < Content-Type: text/html;charset=ISO-8859-1 < Cache-Control: must-revalidate,no-cache,no-store < Content-Length: 7648 < Server: Jetty(8.1.15.v20140411) < <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Error 500 Server Error</title> </head> <body>

    HTTP ERROR 500

    Problem accessing /restconf/operations/sal-bulk-flow:add-flows-ds. Reason:

    Server Error

Caused by:

java.lang.NullPointerException
        at org.opendaylight.openflowplugin.applications.bulk.o.matic.SalBulkFlowServiceImpl.addFlowsDs(SalBulkFlowServiceImpl.java:72)
        at org.opendaylight.yangtools.yang.binding.util.RpcMethodInvokerWithInput.invokeOn(RpcMethodInvokerWithInput.java:30)
        at org.opendaylight.yangtools.yang.binding.util.AbstractMappedRpcInvoker.invokeRpc(AbstractMappedRpcInvoker.java:52)
        at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invoke(BindingDOMRpcImplementationAdapter.java:85)
        at org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcImplementationAdapter.invokeRpc(BindingDOMRpcImplementationAdapter.java:72)
        at org.opendaylight.controller.md.sal.dom.broker.impl.GlobalDOMRpcRoutingTableEntry.invokeRpc(GlobalDOMRpcRoutingTableEntry.java:40)
        at org.opendaylight.controller.md.sal ...
(more)
edit retag flag offensive close merge delete