BlueCat Edge Python API reference - Platform - BlueCat Gateway - 24.1

Gateway Administration Guide

Product name
BlueCat Gateway

The BlueCat Edge Python API is a set of wrapper classes that abstract the functionality of several BlueCat BlueCat Edge APIs. This API provides wrapped endpoints for key Edge use-cases, including Service Point status and better filtering of top queried external domains.

To use the BlueCat Edge Python API, instantiate a client from the EdgeClient class, authenticate with the client, then perform the needed API calls.

For example:
from bluecat_libraries.edge.api import EdgeClient

start = 0   # Start of time range. Defaults to last 24 hours.
count = 10  # Number of results to return, e.g., top 10.

with EdgeClient(<edge_ci_url>) as client:
    client.authenticate(<client_id>, <client_secret>)
    result = client.get_v1_api_customer_dnsquerystats_topdomains(start, count)

    for stat in result:
        print(stat['domain'], stat['hitCount'])