Software Defined Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Flow creation via REST API

 
SOLVED
Go to solution
kobisamoray
Occasional Advisor

Flow creation via REST API

Hi,

I'm writing an app which collaborates with the controller via REST API.

My app creates some static flows via the controller.

I assume that I should do that using 'POST /of/datapaths/{dpid}/flows' API.

However, I couldn't find the schema of the flowJson data which I should post to the controller.

 

Can anyone direct me to the schema?

 

Thanks,

 

8 REPLIES 8
sdean
Senior Member
Solution

Re: Flow creation via REST API

The json schema for all REST API commands is available via RSDoc.  Enter the following URL to access the json information.  Be sure the controller is running.

 

https://<controller_IP>:8443/sdn/v2.0/models

Replace <controller_IP> with the IP address of your controller.

 

This will display the json models for all REST API commands.

 

I highly recommend you use google Chrome and install the jsonview extension.  This will format the json data so it is readable.  If you don’t install jsonview, it will not be formatted and will be displayed as one very long record.  Below are the steps to install the jsonview extension:

 

-        Start google Chrome

-        Click setting in upper right corner

-        Select tools

-        Select Extensions

-        Select "get more extensions"

-        Search of json

-        Install jsonview

PaulZanna
Occasional Advisor

Re: Flow creation via REST API

You should find what you need in the new "SDN Controller REST API.pdf" which has been included as part of the version 1.14.0 release.

cmaxwell
Advisor

Re: Flow creation via REST API

JSONView is available for Firefox also and works quite well.

kobisamoray
Occasional Advisor

Re: Flow creation via REST API

The links within the PDF refer to https://genesis.americas.hpqcorp.net/ which is inaccessible from my network.
sdean
Senior Member

Re: Flow creation via REST API

I put a new version of the REST API document on the FTP site that does not contain links to websites.  The link in the document now points to other section within the same document.  The file name is "HP VAN SDN Controller REST API.pdf".

kobisamoray
Occasional Advisor

Re: Flow creation via REST API

Thanks!
jmikola
Member

Re: Flow creation via REST API


@sdean wrote:

I put a new version of the REST API document on the FTP site that does not contain links to websites.  The link in the document now points to other section within the same document.  The file name is "HP VAN SDN Controller REST API.pdf".


Hi,

 

It seems there isn't a document in the FTP folder with the specific file name you mentioned at all. I've tried Ctrl+F5 refresh too.

 

At the same time, it seems that the document with the file name of "SDN Controller REST API.pdf" is corrupted. At least my Adobe Reader cannot open it.

 

Janne

Javed Padinhakara
Respected Contributor

Re: Flow creation via REST API

@jmikola :

Can find some resources SDN Dev Cente's Resources Corner, "REST API and Security"

Inlcuding one sample json for creating flow ( picked from the above resource )

{
"flow": {
"priority": 30000,
"idle_timeout": 60,
"match": [
{"eth_type": "ipv4"},
{"ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"tcp_dst": "80"}
],
"actions": [{"output": 6}]
}
}

Hope that helps

-J

ps: The FTP site is probably accessible to select beta audience, as per what can be made out from other posts in this forum....?