cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

211
Views
2
Helpful
6
Replies
Highlighted
Cisco Employee

Where in the /logs to look for information on REST API calls

Team,

Our customer application is using the REST API to activate a template (ACTION) via NCS. There is no change on the device (ALU-7705) and there is no indication of changes in the traces under /logs. We suspect the customer application is not sending the correct API calls to NCS.

Is there a specific log that captures the REST API calls?  If yes, is there a specific marker that would make it easier to locate such API calls?

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: Where in the /logs to look for information on REST API calls

I would say devel.log.

Simplest test is to do a “ls –lat” after a call….the latest file will have some information.

View solution in original post

6 REPLIES 6
Cisco Employee

Re: Where in the /logs to look for information on REST API calls

What is the response from the REST call?

Beginner

Re: Where in the /logs to look for information on REST API calls

You can also check in the localhost:8080.access log.

==> *********/logs/localhost:8080.access <==

127.0.0.1 - admin [09/Jul/2015:16:52:43 -0400] "GET /api/running/services/*********?deep HTTP/1.1" 200 6538 "-" "curl/7.30.0"

Or another option (if its a controlled environment) is to tail (and optionally grep) the whole log directory and watch what changes.

tail -f [NCS]/logs/*

Cisco Employee

Re: Where in the /logs to look for information on REST API calls

When I ran on my setup, this is the response…

ADALTRIN-M-K05Q:REST_CALLS daltrini$ curl -v -X POST -T upspeed-cisco-SIAD.xml -u admin:admin http://127.0.0.1:8080/api/operational/upspeed-commands/_operations/upspeed-siad

* Hostname was NOT found in DNS cache

*   Trying 127.0.0.1...

* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)

* Server auth using Basic with user 'admin'

> POST /api/operational/upspeed-commands/_operations/upspeed-siad HTTP/1.1

> Authorization: Basic YWRtaW46YWRtaW4=

> User-Agent: curl/7.37.1

> Host: 127.0.0.1:8080

> Accept: */*

> Content-Length: 93

> Expect: 100-continue

>

< HTTP/1.1 100 Continue

* Server  is not blacklisted

< Server:

< Allow: GET, POST, OPTIONS, HEAD

< Content-Length: 0

* We are completely uploaded and fine

< HTTP/1.1 200 OK

* Server  is not blacklisted

< Server:

< Date: Fri, 26 Jun 2015 20:43:32 GMT

< Allow: GET, POST, OPTIONS, HEAD

< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate

< Content-Length: 82

< Content-Type: application/vnd.yang.operation+xml

< Vary: Accept-Encoding

< Pragma: no-cache

<

<output xmlns='http://com/att/csbh/upspeed'>

  <status>Success</status>

</output>

* Connection #0 to host 127.0.0.1 left intact

Cisco Employee

Re: Where in the /logs to look for information on REST API calls

I would say devel.log.

Simplest test is to do a “ls –lat” after a call….the latest file will have some information.

View solution in original post

Cisco Employee

Re: Where in the /logs to look for information on REST API calls

Please check what is in the xml file being sent.

Is the customer sending the device selection correctly. I had this happen once and was not properly sending the device selection (and had not marked the device selection in my Yang model as a mandatory item).

p.s. is this s device template or a service template ?

Cisco Employee

Re: Where in the /logs to look for information on REST API calls

another option would be creating a .pcap using tcpdump on the server.

Content for Community-Ad
FusionCharts will render here
This widget could not be displayed.