08-12-2019 10:27 AM
I would like to know the Health of my Clients, and so I do send to the sandbox DNAC
https://{{dnac}}:{{port}}/dna/intent/api/v1/client-health?startTime=1565449472000&endTime=1565622272000
The reply gives me the ecutionId : "7f858cfa-a93e-405e-b83c-66bb34a5308e",
With the get https://sandboxdnac.cisco.com/api/dnacaap/v1/dnacaap/management/execution-status/7f858cfa-a93e-405e-b83c-66bb34a5308e
I get following Reply:
{
"bapiKey" : "149a-a93b-4ddb-80dd",
"bapiName" : "Get Overall Client Health",
"bapiExecutionId" : "7f858cfa-a93e-405e-b83c-66bb34a5308e",
"startTime" : "Mon Aug 12 15:13:54 UTC 2019",
"startTimeEpoch" : 1565622834974,
"endTime" : "Mon Aug 12 15:14:01 UTC 2019",
"endTimeEpoch" : 1565622841670,
"timeDuration" : 6696,
"status" : "FAILURE",
"bapiError" : "{\n \"bapiErrorResponse\" : {\n \"bapiKey\" : \"149a-a93b-4ddb-80dd\",\n \"bapiName\" : \"Get Overall Client Health\",\n \"bapiErrorCode\" : \"\",\n \"bapiErrorMessage\" : \"\"\n },\n \"componentErrorResponse\" : [ {\n \"compId\" : \"uuidf8ee428c\",\n \"compName\" : \"Combine Output\",\n \"compErrorCode\" : \"500\",\n \"compErrorMessage\" : \"7f858cfa-a93e-405e-b83c-66bb34a5308e | 0521cce9-f925-4905-9675-dd1d527b3cba | 149a-a93b-4ddb-80dd : JavascriptTransformProcessor Failed with error: SyntaxError: Invalid JSON: <json>:1:0 Expected json literal but found H\\nHttp Error Code:500\\n^ in <eval> at line number 3063\",\n \"componentType\" : \"JAVASCRIPT_TRANSFORM\"\n } ]\n}"
}
Questions:
1. Why has the response other start/end time as in the request??
2. Why I receive an error??
Thanks in advance
Wim
03-03-2021 11:24 AM
I will start investigating from the second question. Looks like there is a "SyntaxError: Invalid JSON:", valid the JSON format first.
Regarding the epoch time is off. If I remember correctly, DNAC takes a snapshot every X min and save to DB. When the API make a query, it's not taking the "real time" snapshot as you requested, but taking from the DB with the time close to your requested time.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide