SitesStatsPorts

countSiteSwOrGwPorts

GET
/api/v1/sites/{site_id}/stats/ports/count

Count switch and gateway port statistics for a site, optionally grouped by the distinct field and filtered by port, neighbor, PoE, STP, traffic, and time attributes. Use Count Org Switch/Gateway Ports to count switch and gateway port statistics across the organization.

Authorization

Authorization<token>

Preferred authentication method for automation and integrations. Send the API token in the HTTP Authorization header.

Format: Authorization: Token {apitoken}

Notes:

  • An API token generated for a specific admin has the same privileges as that admin
  • An API token is automatically removed if it is not used for more than 90 days
  • SSO admins cannot generate admin API tokens. Use organization API tokens when scoped Org/Site privileges are needed.

In: header

Path Parameters

site_id*string
Formatuuid

Query Parameters

distinct?string

Field used to group this count response. enum: full_duplex, mac, neighbor_mac, neighbor_port_desc, neighbor_system_name, poe_disabled, poe_mode, poe_on, port_id, port_mac, speed, up

Default"mac"

Value in

  • "full_duplex"
  • "mac"
  • "neighbor_mac"
  • "neighbor_port_desc"
  • "neighbor_system_name"
  • "poe_disabled"
  • "poe_mode"
  • "poe_on"
  • "port_id"
  • "port_mac"
  • "speed"
  • "up"
full_duplex?boolean

Indicates full or half duplex

mac?string

Filter results by MAC address

neighbor_mac?string

Chassis identifier of the chassis type listed

neighbor_port_desc?string

Description supplied by the system on the interface E.g. "GigabitEthernet2/0/39"

neighbor_system_name?string

Name supplied by the system on the interface E.g. neighbor system name E.g. "Kumar-Acc-SW.mist.local"

poe_disabled?boolean

Is the POE configured not be disabled.

poe_mode?string

POE mode depending on class E.g. "802.3at"

poe_on?boolean

Is the device attached to POE

port_id?string

Filter results by port identifier

port_mac?string

Filter results by port MAC address

power_draw?number

Amount of power being used by the interface at the time the command is executed. Unit in watts.

tx_pkts?integer

Filter results by transmitted packet count

rx_pkts?integer

Filter results by received packet count

rx_bytes?integer

Filter results by received byte count

tx_bps?integer

Filter results by transmit rate

rx_bps?integer

Filter results by receive rate

tx_mcast_pkts?integer

Filter results by transmitted multicast packet count

tx_bcast_pkts?integer

Filter results by transmitted broadcast packet count

rx_mcast_pkts?integer

Filter results by received multicast packet count

rx_bcast_pkts?integer

Filter results by received broadcast packet count

speed?integer

Filter results by port speed

stp_state?string

STP state used to filter port results when up==true. enum: "", blocking, disabled, forwarding, learning, listening

Value in

  • ""
  • "blocking"
  • "disabled"
  • "forwarding"
  • "learning"
  • "listening"
stp_role?string

STP role used to filter port results when up==true. enum: "", alternate, backup, designated, disabled, root, root-prevented

Value in

  • ""
  • "alternate"
  • "backup"
  • "designated"
  • "disabled"
  • "root"
  • "root-prevented"
auth_state?string

Authentication state used to filter port results when up==true and the port has an authenticator role. enum: "", authenticated, authenticating, held, init

Value in

  • ""
  • "authenticated"
  • "authenticating"
  • "held"
  • "init"
up?boolean

Indicates if interface is up

start?string

Lower bound of the time range, as an epoch timestamp in seconds or a relative value such as -1d or -1w

end?string

Upper bound of the time range, as an epoch timestamp in seconds or a relative value such as -1d, -2h, or now

duration?string

Time range duration for the query, using relative units such as 10m, 7d, or 2w

Default"1d"
limit?integer

Maximum number of results to return per page

Range0 <= value
Default100

Response Body

curl -X GET "https://example.com/api/v1/sites/000000ab-00ab-00ab-00ab-0000000000ab/stats/ports/count"
{  "distinct": "string",  "end": 0,  "limit": 0,  "results": [    {      "count": 0,      "property": "string"    }  ],  "start": 0,  "total": 0}