{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-catalyst-center/json-schema/cisco-catalyst-center-network-devices-top-nrequest-schema.json",
  "title": "NetworkDevicesTopNRequest",
  "description": "The input payload schema to query Top-N Analytics Network Device data.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-catalyst-center-network-devices-api-openapi.yml#/components/schemas/NetworkDevicesTopNRequest",
  "required": [
    "groupBy",
    "topN"
  ],
  "type": "object",
  "properties": {
    "topN": {
      "maximum": 100,
      "minimum": 10,
      "type": "integer",
      "description": "Number of top network devices to retrieve.",
      "enum": [
        10,
        50,
        100
      ]
    },
    "groupBy": {
      "$ref": "#/$defs/NetworkDevicesAnalyticsGroupBy"
    },
    "attributes": {
      "$ref": "#/$defs/NetworkDevicesAnalyticsAttributes"
    },
    "filters": {
      "$ref": "#/$defs/NetworkDevicesAnalyticsFilters"
    },
    "aggregateAttributes": {
      "type": "array",
      "description": "Successfully returned list of aggregate Attributes\n",
      "items": {
        "$ref": "#/$defs/NetworkDevicesAnalyticsAggregateAttributes"
      }
    },
    "page": {
      "$ref": "#/$defs/PaginationWithAggregateSortBy"
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/startAndEndTime"
    }
  ],
  "$defs": {
    "AggregateSortBy": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Field name by which sort is requested"
        },
        "order": {
          "type": "string",
          "description": "The sort order of the field ascending or descending.",
          "enum": [
            "asc",
            "desc"
          ]
        },
        "function": {
          "$ref": "#/$defs/Function"
        }
      },
      "description": "Records are sorted based on the fields specified in the array.\n"
    },
    "Function": {
      "type": "string",
      "description": "The name of the aggregate function",
      "enum": [
        "min",
        "max",
        "avg",
        "count",
        "latest",
        "sum",
        "distinct"
      ]
    },
    "LogicalOperator": {
      "type": "string",
      "description": "Operator to use when attempting to apply a logical conjunction of more   than 1 filter\n\nLogical operations include: 'and', 'or'.\n",
      "enum": [
        "and",
        "or"
      ]
    },
    "NetworkDevicesAnalyticsAggregateAttributes": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/NetworkDevicesAnalyticsAggregateName"
        },
        "function": {
          "$ref": "#/$defs/Function"
        }
      }
    },
    "NetworkDevicesAnalyticsAggregateName": {
      "type": "string",
      "description": "Field name on which the aggregate function should be applied when querying the data. The supported field details are available in the enum definition.",
      "enum": [
        "apCount",
        "clientCount",
        "cpuScore",
        "cpuUtilization",
        "memoryUtilization",
        "memoryScore",
        "overallHealthScore",
        "fabricOverallScore",
        "freeMemoryBufferScore",
        "freeTimerScore",
        "interDeviceLinkScore",
        "linkUtilizationScore",
        "discardScore",
        "wqePoolScore",
        "errorScore",
        "packetPoolScore",
        "noise",
        "interferenceScore",
        "airQuality",
        "fabricTransitScore",
        "fabricSiteScore",
        "fabricVnScore",
        "fabsiteFcpScore",
        "fabsiteInfraScore",
        "fabsiteFsconnScore",
        "vnExitScore",
        "vnFcpScore",
        "vnStatusScore",
        "vnServiceScore",
        "transitControlPlaneScore",
        "transitServicesScore",
        "tcpConnScore",
        "bgpBgpSiteScore",
        "vniStatusScore",
        "pubsubTransitConnScore",
        "bgpPeerInfraVnScore",
        "internetAvailScore",
        "bgpEvpnScore",
        "lispTransitConnScore",
        "ctsEnvDataDownloadScore",
        "pubsubInfraVnScore",
        "peerScore",
        "bgpPeerScore",
        "remoteInternetAvailScore",
        "bgpTcpScore",
        "pubsubSessionScore",
        "aaaStatusScore",
        "lispCpConnScore",
        "bgpPubsubSiteScore",
        "mcastScore",
        "portChannelScore",
        "firewallConnScore",
        "deviceUuid"
      ]
    },
    "NetworkDevicesAnalyticsAttributes": {
      "type": "array",
      "description": "List of field names on which the aggregate function should be applied",
      "items": {
        "$ref": "#/$defs/NetworkDevicesSummaryAttribute"
      }
    },
    "NetworkDevicesAnalyticsFilters": {
      "type": "array",
      "description": "List of filters to apply when querying the Network devices data. \n\nSupported operators are [in, eq, neq, notIn, like]\n\nWhen using filters, the request must contain only fields from the same grouping (across all request fields)\n\n | Group | Valid Fields |\n | --- | --- |\n| HealthScore  |   pubsubSessionScoreRange, bgpPeerInfraVnScoreRange, aaaStatusScoreRange, fabricRole, ctsEnvDataDownloadScore, deviceType, ctsEnvDataDownloadScoreRange, tcpConnScoreRange, fabsiteFcpScore,tcpConnScore, discardScoreRange, bgpEvpnScoreRange, bgpBgpSiteScore, apCount, transitControlPlaneScore, vnExitScore, pubsubTransitConnScore, aaaStatusScore, deviceFamily, portChannelScore, poorDeviceCount, wqePoolScore, siteHierarchyGraphId, bgpPubsubSiteScoreRange, bgpPeerInfraVnScore, memoryScoreRange, bgpBgpSiteScoreRange, portChannelScoreRange, softwareVersion, deviceRole, upLinkScoreRange, vniStatusScoreRange, internetAvailScore, bgpEvpnScore, remoteInternetAvailScoreRange, fabricOverallScore, fabsiteFcpScoreRange, freeMbufScoreRange, lispTransitConnScore, memoryUtilization, deviceRole, wlcClientCount, vnServiceScoreRange, bgpPeerScoreRange, fabsiteInfraScoreRange, vnFcpScore, siteHierarchy, noHealthDeviceCount, packetPoolScoreRange, siteHierarchy, discardScore, packetPoolScore, fabricSiteScoreRange, transitServicesScore, transitServicesScore, lispCpConnScoreRange, fabricSiteScore, transitServicesScoreRange, fabricTransitScoreRange, utilizationScoreRange, internetAvailScoreRange, freeMemoryBufferScore, interDeviceLinkScore, fabricTransitScore, pubsubInfraVnScoreRange, connectedWlcName, lispTransitConnScoreRange, l2Vns, fairDeviceCount, deviceUuid, pubsubInfraVnScore, mcastScoreRange, overallHealthScoreRange, vnServiceScore, channelAirQualityScoreRange, pubsubTransitConnScoreRange, vniStatusScore, macAddress, peerScore, wqePoolScoreRange, name, connectedWlcName, bgpPeerScore, vnStatusScore, errorScore, fabsiteFsconnScore, bgpTcpScore, pubsubSessionScore, firewallConnScore, fabricSiteId, vnExitScoreRange, interferenceScoreRange, goodDeviceCount, vnFcpScoreRange, lispCpConnScore, reachability, overallHealthScore, bgpPubsubSiteScore, overallFabricScoreRange, fabsiteFsconnScoreRange, cpuUtilization, bgpTcpScoreRange, channelNoiseScoreRange, transitControlPlaneScoreRange, freeTimerScore, managementIpAddress, platformId, mcastScore, peerScoreRange, fabricVnScore, linkUtilizationScore, cpuScoreRange, fabricVnScoreRange, memoryScore, remoteInternetAvailScore, errorScoreRange, vnStatusScoreRange, fabsiteInfraScore, l3Vns, cpuScore |\n    | PoE Switch | remainingPower, allocatedPowerSystem, powerAllocationLoadRange, usedPower, usedPower, allocatedPowerPoe, siteHierarchyGraphId, freePorts, usedPorts, name, powerBudget, powerUsagePercentage, numPorts | \n    | PoE Module | remainingPower, allocatedPower, interfacePowerMax, reservedPower, consumedPowerPoe, usedPower, freePorts, switchAvailablePower, usedPorts, powerBudget, powerUsagePercentage, numPorts, totalPower, consumedPowerSystem |\n    | Radio Metrics | airQuality, channelUtilization, apRadioChannel, apRadioClientCount, apMode, apEthernetMacAddress, interferenceScore, apRadioId, apOperationalState, apRadioOperState, noise, apAdminState, clientCount,apRadioBand\n    | Access Point Metrics | connectedToWlcUuid, ap6GhzPowerMode\n",
      "items": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/$defs/NetworkDevicesSummaryFilter"
          }
        ]
      }
    },
    "NetworkDevicesAnalyticsGroupBy": {
      "type": "array",
      "description": "List of field names on which the Group By function should be applied",
      "items": {
        "type": "string",
        "description": "List of field names to group by.",
        "enum": [
          "deviceFamily",
          "deviceRole",
          "deviceType",
          "softwareVersion",
          "reachability",
          "serialNumber",
          "platformId",
          "deviceSeries",
          "productVendor",
          "siteHierarchy",
          "siteHierarchyId",
          "overallHealthScoreRange",
          "cpuScoreRange",
          "memoryScoreRange",
          "wqePoolScoreRange",
          "errorScoreRange",
          "discardScoreRange",
          "upLinkScoreRange",
          "freeMbufScoreRange",
          "packetPoolScoreRange",
          "channelAirQualityScoreRange",
          "channelNoiseScoreRange",
          "utilizationScoreRange",
          "interferenceScoreRange",
          "firewallConnScoreRange",
          "apEthernetMacAddress",
          "connectedWlcName",
          "apFlexGroup",
          "apGroup",
          "apLocation",
          "apSiteTagName",
          "apPolicyTagName",
          "apRfTagName",
          "apRadioBand",
          "apRadioId",
          "apMode",
          "apAdminState",
          "apOperationalState",
          "deviceUuid",
          "name",
          "macAddress",
          "managementIpAddress",
          "powerAllocationLoadRange",
          "apAfcStatus"
        ]
      }
    },
    "NetworkDevicesSummaryAttribute": {
      "type": "string",
      "description": "The network device summary attributes",
      "enum": [
        "managementIpAddress",
        "name",
        "macAddress",
        "deviceUuid",
        "deviceFamily",
        "deviceRole",
        "deviceType",
        "softwareVersion",
        "serialNumber",
        "platformId",
        "deviceSeries",
        "productVendor",
        "upTime",
        "siteHierarchy",
        "siteHierarchyId",
        "overallHealthScore",
        "fabricOverallScore",
        "cpuScore",
        "cpuUtilization",
        "memoryUtilization",
        "memoryScore",
        "interDeviceLinkScore",
        "linkUtilization",
        "linkUtilizationScore",
        "discardScore",
        "errorScore",
        "freeMemoryBuffer",
        "freeMemoryBufferScore",
        "freeTimer",
        "freeTimerScore",
        "packetPool",
        "packetPoolScore",
        "wanLinkUtilization",
        "wqePool",
        "wqePoolScore",
        "apCount",
        "wlcClientCount",
        "noiseScore",
        "utilizationScore",
        "interferenceScore",
        "airQualityScore",
        "apRadioId",
        "noise",
        "utilization",
        "channelUtilization",
        "interference",
        "airQuality",
        "apRadioBand",
        "apRadioChannel",
        "apRadioClientCount",
        "apRadioOperState",
        "connectedWlcName",
        "goodDeviceCount",
        "fairDeviceCount",
        "poorDeviceCount",
        "noHealthDeviceCount",
        "fabricRole",
        "transitFabrics",
        "fabricSiteName",
        "l2Vns",
        "fabricSiteId",
        "networkProtocol",
        "l3Vns",
        "fabricTransitScore",
        "fabricSiteScore",
        "fabricVnScore",
        "fabsiteFcpScore",
        "fabsiteInfraScore",
        "fabsiteFsconnScore",
        "vnExitScore",
        "vnFcpScore",
        "vnStatusScore",
        "vnServiceScore",
        "transitControlPlaneScore",
        "transitServicesScore",
        "tcpConnScore",
        "bgpBgpSiteScore",
        "vniStatusScore",
        "pubsubTransitConnScore",
        "bgpPeerInfraVnScore",
        "internetAvailScore",
        "bgpEvpnScore",
        "lispTransitConnScore",
        "ctsEnvDataDownloadScore",
        "pubsubInfraVnScore",
        "peerScore",
        "bgpPeerScore",
        "remoteInternetAvailScore",
        "bgpTcpScore",
        "pubsubSessionScore",
        "aaaStatusScore",
        "lispCpConnScore",
        "bgpPubsubSiteScore",
        "mcastScore",
        "portChannelScore",
        "firewallConnScore",
        "powerBudget",
        "usedPower",
        "remainingPower",
        "powerUsagePercentage",
        "interfacePowerMax",
        "numPorts",
        "usedPorts",
        "freePorts",
        "totalPower",
        "reservedPower",
        "allocatedPower",
        "allocatedPowerPoe",
        "allocatedPowerSystem",
        "switchAvailablePower",
        "consumedPowerSystem",
        "consumedPowerPoe",
        "consumedPower",
        "apAfcStatus",
        "connectedToWlcUuid",
        "ap6GhzPowerMode"
      ]
    },
    "NetworkDevicesSummaryFilter": {
      "type": "object",
      "properties": {
        "key": {
          "$ref": "#/$defs/NetworkDevicesSummaryFilterKey"
        },
        "operator": {
          "$ref": "#/$defs/Operator"
        },
        "logicalOperator": {
          "$ref": "#/$defs/LogicalOperator"
        },
        "value": {
          "type": "object",
          "description": "Field value(s) to filter the data set. Array of values is used for   \"in\" or \"out\" operator. Values will be of whatever type the   specific field being filtered is defined with.\n\nFor other operators, filter value is of whatever type the specific   field being filtered is defined with.\n\nIn the case of an \"and\" or \"or\" operator, this values array will be   ignored, and the values arrays in each of the *nested filters*   will be used.\n"
        },
        "filters": {
          "type": "array",
          "description": "Nested array of filters in case of AND/OR based filters. Only one   level of nesting will be supported.\n\nStructure of nested filter is the same as parent with all operators   supported except AND or OR.\n",
          "items": {
            "$ref": "#/$defs/NetworkDevicesSummaryFilter"
          }
        }
      },
      "description": "In case of single filter, please use `key`, `operator` and `value` combination. If multiple filters need to be applied using a logical   operation, please use `logicalOperator` and populate the list of 'filters' with a   combination of FilterObj. Filters can be nested to build complex   queries.\n"
    },
    "NetworkDevicesSummaryFilterKey": {
      "type": "string",
      "description": "Summary filter support key name",
      "enum": [
        "managementIpAddress",
        "name",
        "macAddress",
        "deviceUuid",
        "deviceFamily",
        "deviceRole",
        "type",
        "softwareVersion",
        "platformId",
        "siteHierarchy",
        "siteHierarchyId",
        "overallHealthScore",
        "cpuScore",
        "cpuUtilization",
        "memoryUtilization",
        "memoryScore",
        "interDeviceLinkScore",
        "linkUtilizationScore",
        "discardScore",
        "errorScore",
        "freeMemoryBufferScore",
        "freeTimerScore",
        "packetPoolScore",
        "wqePoolScore",
        "apCount",
        "wlcClientCount",
        "interferenceScore",
        "airQualityScore",
        "apRadioId",
        "noise",
        "channelUtilization",
        "interference",
        "airQuality",
        "apRadioBand",
        "apRadioChannel",
        "apRadioClientCount",
        "apRadioOperState",
        "connectedWlcName",
        "fabricRole",
        "transitFabrics",
        "fabricSiteName",
        "l2Vns",
        "fabricSiteId",
        "networkProtocol",
        "l3Vns",
        "overallFabricScore",
        "fabricTransitScore",
        "fabricSiteScore",
        "fabricVnScore",
        "fabsiteFcpScore",
        "fabsiteInfraScore",
        "fabsiteFsconnScore",
        "vnExitScore",
        "vnFcpScore",
        "vnStatusScore",
        "vnServiceScore",
        "transitControlPlaneScore",
        "transitServicesScore",
        "tcpConnScore",
        "bgpBgpSiteScore",
        "vniStatusScore",
        "pubsubTransitConnScore",
        "bgpPeerInfraVnScore",
        "internetAvailScore",
        "bgpEvpnScore",
        "lispTransitConnScore",
        "ctsEnvDataDownloadScore",
        "pubsubInfraVnScore",
        "peerScore",
        "bgpPeerScore",
        "firewallConnScore",
        "remoteInternetAvailScore",
        "bgpTcpScore",
        "pubsubSessionScore",
        "aaaStatusScore",
        "lispCpConnScore",
        "bgpPubsubSiteScore",
        "mcastScore",
        "portChannelScore",
        "connectedToWlcUuid",
        "ap6GhzPowerMode"
      ]
    },
    "Operator": {
      "type": "string",
      "description": "Type of filter operator to use for querying data | in and out operator takes multiple values and applies the filters",
      "enum": [
        "in",
        "neq",
        "lt",
        "gt",
        "lte",
        "gte",
        "eq",
        "notIn",
        "like"
      ]
    },
    "PaginationWithAggregateSortBy": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "description": "The reference to the limit applied in the Pagination Request."
        },
        "offset": {
          "type": "integer",
          "description": "The reference to the record offset applied in the Pagination Request."
        },
        "count": {
          "type": "integer",
          "description": "Total number of records related to the resource after applying applicable filtering"
        },
        "sortBy": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AggregateSortBy"
          }
        }
      },
      "description": "Reference to pagination properties\n"
    },
    "startAndEndTime": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "integer",
          "description": "Start time from which API queries the data set related to the resource  . It must be specified in UNIX epochtime in milliseconds. Value is   inclusive.\n  \nIf no startTime is provided, API will default to currentTime\n",
          "format": "int64"
        },
        "endTime": {
          "type": "integer",
          "description": "End time to which API queries the data set related to the resource. It   must be specified in UNIX epochtime in milliseconds. Value is   inclusive. \n  \nIf no endTime is provided, API will default to currentTime\n",
          "format": "int64"
        }
      },
      "description": "start and end time of data set to query. Data is aggregated   based on time window and timestamped with window start time. |\nFor example -\n  1. When data events falls in a 5 minute window from 12-13-2023 11:25 PM to   12-13-2023 11:30 PM the timestamp of the aggregated data is 12-13-2023   11:25 PM - 1702509900000 (Unix epochtime). If user needs data from 12-13  -2023 11:25 PM to 12-13-2023 11:30 PM  user must use below timestamps |\n  startTime = 1702509900000 (12-13-2023 11:25 PM) |\n  endTime = 1702510199000 (12-13-2023 11:29:59 PM) |\n  2. When data to be queried is for 3 hours period from 12-13-2023 08:30 PM   to 12-13-2023 11:30 PM. User must use below timestamps |\n  startTime = 1702528200000 (12-13-2023 08:30 PM) |\n  endTime = 1702510199000 (12-13-2023 11:29:59 PM) |\n  2. When data to be queried is for 24 hours period from 12-12-2023 11:30 PM   to 12-13-2023 11:30 PM. User must use below timestamps |\n  startTime = 1702423800000 (12-12-2023 11:30 PM) |\n  endTime = 1702510199000 (12-13-2023 11:29:59 PM) |\n  3. When data to be queried is for 7 days period from 12-06-2023 11:30 PM   to 12-13-2023 11:30 PM. User must use below timestamps |\n  startTime = 1701905400000 (12-06-2023 11:30 PM) |\n  endTime = 1702510199000 (12-13-2023 11:29:59 PM)\n"
    }
  }
}