Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

How to test ping application using curl

asked 2015-03-24 22:35:31 -0800

saksh gravatar image

updated 2015-03-24 22:39:27 -0800

Hello All,

I am trying to create ping application by following the link below -

https://wiki.opendaylight.org/view/Ping

I am able to create ping application and the karaf version is showing ping application active but I am not able to test this ping application using the instructions given as follows -

http://localhost:8080/restconf/operations/ping:send-echo
With the following headers:
Content-Type: application/yang.operation+json
Cache-Control: no-cache
and the data set to raw Json encoded data (for POSTMAN at least) 
{ "input" : { "destination" : "192.168.56.102" } } Note: Replace the IP address with the IP address that you want to   ping.

The error I am getting is -

HTTP/1.1 400 Bad Request
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1403
Server: Jetty(8.1.14.v20131031)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-24 22:51:19 -0800

saksh gravatar image

I tried this to test the application -

curl -v -H "Content-Type:application/json" -X POST -u admin:admin -d "{input: {destination: 127.0.0.1}}" http://localhost:8080/restconf/operations/ping:send-echo

But this is also not working. Please let me know what is the error.

* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'admin'
> POST /restconf/operations/ping:send-echo HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.35.0
> Host: localhost:8080
> Accept: */*
> Content-Type:application/json
> Content-Length: 33
> 
*  upload completely sent off: 33 out of 33 bytes
< HTTP/1.1 501 Not Implemented
< Content-Type: application/json
< Transfer-Encoding: chunked
* Server Jetty(8.1.14.v20131031) is not blacklisted
< Server: Jetty(8.1.14.v20131031)
< 
{
   "errors": {
       "error": [
            {
                "error-type": "rpc",
                "error-tag": "operation-not-supported",
                "error-message": "No implementation for this operation is available."
           }
       ]
    }
 * Connection #0 to host localhost left intact
edit flag offensive delete publish link more

Comments

Can you check if your ping application is running or not? Try 'bundle:list | grep ping'

Vishal Thapar ( 2015-03-26 04:26:22 -0800 )edit
Login/Signup to Answer

Stats

Asked: 2015-03-24 22:35:31 -0800

Seen: 339 times

Last updated: Mar 24 '15