Software Defined Networking
1753787 Members
7456 Online
108799 Solutions
New Discussion

Rest API execution problem

 
MePrabhakar
Occasional Visitor

Rest API execution problem

Hi,

 

Our topology is one swicth connected to the controller and two machines connetcted with the swicth.

Ping is working file and flow has been also inserted on teh swicth.

 

We have downloaded (version 2.0)the trial version of HP VAN SDN Controller. We are doing hands on for the REST API output. We are getting some problem with the rest api which is mentioned below:

 

1-

REST API to get the device info but combination of vid and mac  highlighted is not working.

~$ curl -sk -H "X-Auth-Token:5ed7886eabaa4aa2b36681cce11c9422" https://192.168.1.58:8443/sdn/v2.0/net/nodes/vid=0&ip="192.168.1.181"

 

sdn@sdn:~$ {"nodes":[{"ip":"192.168.1.191","mac":"00:22:cc:bb:bb:10","vid":0,"dpid":"00:00:00:07:e9:0f:5f:59","port":9},{"ip":"192.168.1.181","mac":"22:22:77:77:cc:10",

"vid":0,"dpid":"00:00:00:07:e9:0f:5f:59","port":5}]}

 

As per our understanding it should give the output of 192.168.1.181 host.We  have tried with mac as well but it was also not working.

 

2-

sdn@sdn: ~^Gsdn@sdn:~$ curl -sk -H "X-Auth-Token:5ed7886eabaa4aa2b36681cce11c9422" https://192.168.1.58:8443/sdn/v2.0/net/paths/forward/

 

{"error":"java.lang.IllegalArgumentException","message":"source or destination datapath ID cannot be null."}sdn@sdn: ~^Gsdn@sdn:~$

^[]0;sdn@sdn: ~^Gsdn@sdn:~$ ^M

 

We were geeting the error please let us know what we are missing in this rest api.

 

3-

Is there any rest api so that we can get the queue stats (which we have created on OVS Swicth) with the help of that particular rest api?

 

Please let us know what we are missing or what we are doing wrong ?

 

Thanks in advance

 

Regards,

Prabhakar Rai

4 REPLIES 4
ScottReeve
Advisor

Re: Rest API execution problem

Prabakhar,

 

As for #1:

 

I have an example of what worked for me below.

 

(I've got the token and the UMS exported)

 

You'll need the backslash before the &, otherwise it will try to background what's to the left.

 

curl -sk -H "X-Auth-Token:$token" $UMS/sdn/v2.0/net/nodes?vid=0\&ip="10.0.0.1"

 

I'll see if I can look into questions #2 and #3 also.

 

Regards,

 

Scott

 

 

sdnindia
Trusted Contributor

Re: Rest API execution problem

Hello Prabhakar,

 

For question no 1, you are missing a question mark which is used to provide the parameters . Also you have to use a backslash before the & as suggested by the Scott.

You should use the curl command with /sdn/v2.0/net/nodes?vid=0\&ip=" 192.168.1.181" instead of using with sdn/v2.0/net/nodes/vid=0&ip="192.168.1.181"

 

e.g.  curl -sk -H "X-Auth-Token:$token" $UMS/v2.0/net/nodes?vid=0\&ip="10.0.0.1"  

 

For question no.2 -As per REST API document [page 68]  you should provide  the values for mandatory parameters src_dpid and dst_dpid else you will get the error {"error":"java.lang.IllegalArgumentException","message":"source or destination datapath ID cannot be null."}

You can run curl command as

 

e.g.  curl -sk -H "X-Auth-Token:$token" $UMS/v2.0/net/paths/forward?src_dpid="00:00:00:00:00:00:00:0d"\&dst_dpid="00:00:00:00:00:00:00:0b"

 

Please note that for above examples, we have exported token and UMS already.

 

Thanks,

HP SDN Team

ScottReeve
Advisor

Re: Rest API execution problem

Can you show the output of this:

 

curl -sk -H "X-Auth-Token:$token" $UMS/sdn/v2.0/of/stats

 

And then we can get an idea of what stats you're looking for.

And perhaps the queue(s) that you've defined on the switch will show up.

 

Thanks,

 

Scott

 

sdnindia
Trusted Contributor

Re: Rest API execution problem

Hello Prabhakar,

 

Doing a follow up to check if you get any chance to run the command as Scott had asked for.

If yes please do help us with the response of the command to take this further.

 

Please also let know if you have already resolved the issue

 

Thanks

HP SDN Team