SD-WAN

 View Only
  • 1.  SDN Delete Flow REST in Java

    Posted Jun 02, 2015 04:06 AM

    Hi,

    I am trying to delete a flow in the VAN controller using DELETE REST call, something like below:

     

    curl -sk -H "X-Auth-Token:6b2fa61a754a4cb984cc943689e65276" -X DELETE -H 'Content-Type:application/json' -d '{"flow":{"priority":50000,"idle_timeout":200,"match":[{"eth_type":"ipv4"},{"ipv4_src":"10.0.0.1"},{"ipv4_dst":"10.0.0.2"},{"ip_proto":"tcp"},{"tcp_dst":"80"}],"actions":[{"output":2}]}}' https://127.0.0.1:8443/sdn/v2.0/of/datapaths/00:00:00:00:00:00:00:01/flows

     

    Using curl command, this works fine. Is there a similar way in Java (library/package etc.), which can be used to do the same?

     

    I have tried the common Http client libraries of Java but unable to implement the DELETE method with payload. Please help.



  • 2.  RE: SDN Delete Flow REST in Java

    Posted Jul 03, 2015 07:28 AM

    Hi Avimany,

     

    There is a Java wrapper for libcurl. Since it's implemented on libcurl, anything that works with cURL also works with libcurl. For an example of using libcurl (in C, regrettably not in Java, but the principle should be the same) see here. Let me know whether this helps.

     

    Best regards,

     

    Wouter

    HP SDN CoE Team