cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
771
Views
0
Helpful
1
Replies

Unable to get Flow data from NDI

Petar Rusev
Level 1
Level 1

Hello all,

I am trying from some time to export Flow Telemetry data from our NDI installation. Running the NDI and accessing the information through the GUI is working fine, but the APIs seems to not working.

What is the background? I would like to export the Flow data, so I can do further analysis with the data, like migration planning and etc.

Version that we use is: ND: 2.2(2d) with NDI 6.1.3.94

The issue that I have is when I try to get Flow data I get nothing. 

Example 1: Top Flows:

import requests
import json
url = "https://{{host}}/sedgeapi/v1/cisco-nir/api/api/telemetry/flows/topFlows.json"
payload = ""
headers = {
  'Content-Type': 'application/json',
  'Cookie': 'AuthCookie=<Token>'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
 
The only output that I get is an empty: 
{
    "nodeName": null,
    "description": "",
    "statName": null,
    "entries": [],
    "totalResultsCount": 0,
    "totalItemsCount": 0,
    "offset": 0
}
 
Example 2: Flow Details:
import requests
import json

url = "https://{{host}}/sedgeapi/v1/cisco-nir/api/api/telemetry/flows/details.json"
payload = json.dumps({
  "siteGroupName": "BB-ACI",
  "startDate": "2023-04-03T12:00:21-01:00",
  "endDate": "2023-04-03T13:00:21-01:00"
})
headers = {
  'Content-Type': 'application/json',
  'Cookie': 'AuthCookie=<Token>'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
 
The only response which I get here is: 
Missing mandatory parameters in the query. Please check API documentation.
 
I have checked the documentation, but there is no reference for a way to send the mandatory parameters towards the NDI. I think I am doing it correctly, but I cannot succeed. 
The above examples are from Postman, but I get the same results when I use the code and push it directly via Python. 
Any idea how can I get a meaningful result?
1 Reply 1

Hong Hyun-pyu
Level 1
Level 1

Hi, Petar Rusev 

1. Requirement: The user must provide either 'siteGroupName' or 'siteName'. One of these two parameters is mandatory.

2. Date Format(ISO 8601): The formats for 'endDate' and 'startDate' must be adhered to strictly. This implies that there's a specific date format that needs to be used, and deviating from this format will likely result in an error.

params = {'siteGroupName': 'ACI-Fabric1',
                 'siteName': 'ACI-Fabric1',
                 'count': '10',
                 'offset': 0,
                 'endDate': '2024-11-08T00:36:21+0900',
                 'startDate': '2024-11-07T00:36:21+0900',
                 'filter': ''}
response = requests.get(your_url, headers=headers, params=params, verify=False)