Return the uplink loss and latency for a group of networks

Solved
nickydd9
Getting noticed

Return the uplink loss and latency for a group of networks

Hey all,

 

Looking to see if there is any way to modifying the API endpoint "Return the uplink loss and latency for every MX in the organization from 2-7 minutes ago" so that it will only return results from a small group of networks in my org. The issue is my org has over 4000+ networks and I really only need to filter on about 50 of those networks. 

 

I can scrub through and grab the networkID's for the respective networks I want to list, but not sure what else is required.

 

If anyone has any input it would be very much appreciated. 

1 Accepted Solution
BrechtSchamp
Kind of a big deal

Well the returned result looks like this in JSON format:

[
  {
    "networkId": "N_123456789012345678",
    "serial": "Q2**-****-****",
    "uplink": "wan1",
    "ip": "10.9.6.1",
    "timeSeries": [
      {
        "ts": "2019-02-06T17:54:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:55:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:56:53Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:57:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:58:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      }
    ]
  },
  {
    "networkId": "N_987656789012345678",
    "serial": "Q3**-****-****",
    "uplink": "wan1",
    "ip": "10.9.6.1",
    "timeSeries": [
      {
        "ts": "2019-02-06T17:54:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:55:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:56:53Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:57:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:58:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      }
    ]
  }
]

Ideally in a script you loop over those results, compare the "networkId" value of each entry to a list/array of networkId's you're interested in and either keep or discard that entry.

 

It's not really needed to have the intermediary csv.

View solution in original post

3 Replies 3
BrechtSchamp
Kind of a big deal

The networkId's are static. So it's just a matter of maintaining a list of networkId's for the networks you're interested in and then looping over the results.

 

But if the problem is that the call takes too long to return due to the high number of networks in the org I'm afraid there is no solution at this point. You can't filter server side for that call.

nickydd9
Getting noticed

The call for the whole org returns in a reasonable amount of time, that is not the issue. 

 

So to confirm, as you said I keep a list of the NetworkID's, I export the results of the log to a .csv or something similar and filter on those results? 

BrechtSchamp
Kind of a big deal

Well the returned result looks like this in JSON format:

[
  {
    "networkId": "N_123456789012345678",
    "serial": "Q2**-****-****",
    "uplink": "wan1",
    "ip": "10.9.6.1",
    "timeSeries": [
      {
        "ts": "2019-02-06T17:54:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:55:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:56:53Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:57:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:58:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      }
    ]
  },
  {
    "networkId": "N_987656789012345678",
    "serial": "Q3**-****-****",
    "uplink": "wan1",
    "ip": "10.9.6.1",
    "timeSeries": [
      {
        "ts": "2019-02-06T17:54:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:55:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:56:53Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:57:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      },
      {
        "ts": "2019-02-06T17:58:52Z",
        "lossPercent": 0,
        "latencyMs": 0.5
      }
    ]
  }
]

Ideally in a script you loop over those results, compare the "networkId" value of each entry to a list/array of networkId's you're interested in and either keep or discard that entry.

 

It's not really needed to have the intermediary csv.

Get notified when there are additional replies to this discussion.