- Community Home
- >
- Networking
- >
- Software Defined Networking
- >
- how can I make more than two flows using rest api?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2014 10:17 PM - edited 11-22-2014 10:18 PM
11-22-2014 10:17 PM - edited 11-22-2014 10:18 PM
how can I make more than two flows using rest api?
I can make one flow as below
{
"flow": {
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 1}]}]
}
}
I made two flows as below but..
{
"flow": [
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 1}]}]
},
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.5"},
{"ipv4_dst": "10.0.0.3"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 5}]}]
}
]
}
I couldn't make it. it's failed
how to make more than two flows?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 06:51 AM
11-24-2014 06:51 AM
Re: how can I make more than two flows using rest api?
Hello,
How are you trying to add these flows?
Do you get an error message?
Regards,
Antonio
SDN CoE Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 04:29 PM
11-24-2014 04:29 PM
Re: how can I make more than two flows using rest api?
I made two examples('flow' or 'flows').
First,
------------------------------------------------------------------------------------------------------
{
"flow": [
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 1}]}]
},
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.5"},
{"ipv4_dst": "10.0.0.3"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 5}]}]
}
]
}
------------------------------------------------------------------------------------------------------
Response Body
[unable to parse as json; raw response below]
HTTP Status 500 - com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
type Exception report
message com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.ClassCastException: com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode com.hp.of.json.OfJsonCodec.decode(OfJsonCodec.java:55) com.hp.of.json.OfJsonCodec.decode(OfJsonCodec.java:42) com.hp.util.json.JSON.fromJson(JSON.java:68) com.hp.sdn.rs.FlowProvider.update(FlowProvider.java:87) com.hp.sdn.rs.DatapathsResource.updateFlow(DatapathsResource.java:395) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) javax.servlet.http.HttpServlet.service(HttpServlet.java:848) com.hp.util.rs.SecurityFilter.doFilter(SecurityFilter.java:94) com.hp.util.rs.auth.AbstractTokenAuthFilter.doFilter(AbstractTokenAuthFilter.java:106)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.35 logs.
Response Code
500
*************************************************************************************************
Second,
------------------------------------------------------------------------------------------------------
{
"flows": [
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 1}]}]
},
{
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.5"},
{"ipv4_dst": "10.0.0.3"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 5}]}]
}
]
}
------------------------------------------------------------------------------------------------------
Respose Body
{
"message": "Invalid JSON format: Invalid JSON format: {\"version\":\"1.3.0\",\r\n\"flows\": [\r\n{\r\n\"priority\": 30000,\r\n\"table_id\": 200,\r\n\"idle_timeout\": 60,\r\n\"match\": [\r\n{ \"ipv4_src\": \"10.0.0.1\"},\r\n{\"ipv4_dst\": \"10.0.0.22\"},\r\n{\"ip_proto\": \"tcp\"},\r\n{\"eth_type\": \"ipv4\"},\r\n{\"tcp_dst\": \"80\"}],\r\n\"instructions\": [{\"apply_actions\": [{\"output\": 1}]}]\r\n},\r\n\r\n{\r\n\"priority\": 30000,\r\n\"table_id\": 200,\r\n\"idle_timeout\": 60,\r\n\"match\": [\r\n{ \"ipv4_src\": \"10.0.0.5\"},\r\n{\"ipv4_dst\": \"10.0.0.3\"},\r\n{\"ip_proto\": \"tcp\"},\r\n{\"eth_type\": \"ipv4\"},\r\n{\"tcp_dst\": \"80\"}],\r\n\"instructions\": [{\"apply_actions\": [{\"output\": 5}]}]\r\n}\r\n]\r\n}\r\n. Please refer to the HP VAN SDN Controller JSON schema for more information."
}
ResPonse Code
400
*************************************************************************************************
how to make two flowJson? Could I make it possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 01:54 AM
12-05-2014 01:54 AM
Re: how can I make more than two flows using rest api?
Hello,
At the moment I am researching your issue with our engineering department. Once I get an answer from our team I will contact you.
Best Regards,
Antonio
CSC CoE SDN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2015 08:06 AM
01-08-2015 08:06 AM
Re: how can I make more than two flows using rest api?
Hello sylee,
I just received a confirmation that unfortunately adding more than one flow via the Rest API is not supported.
Regards,
Antonio
SDN Team