Subnets
internal

List subnet field values

Changed on

Every distinct value of one Subnet field across the Subnets the caller can list, with how many hold each. Takes the list's filters; ignores pagination, search and ordering.

get/api/v1/subnets/field-values/{field}

Request

  • Base URL
    https://app.scanopy.net
  • URL
    https://app.scanopy.net/api/v1/subnets/field-values/{field}
  • Auth
    • API key in header Authorization
    • or API key in cookie session_id

Path parameters

field'created_at' | 'name' | 'cidr' | 'subnet_type' | 'updated_at' | 'site_id' | 'last_seen_at' | 'source' | 'managed_by' | 'utilization' required

Fields that subnets can be ordered/grouped by.

The field whose values to count

Query parameters

idsstring[] nullable

Filter by specific entity IDs (for selective loading)

site_idsstring[] nullable

Filter by site ID. Repeat the parameter to pass several.

subnet_typesstring[] nullable

Only subnets of one of these types. Repeat for several.

sourcesEntitySourceDiscriminants[] nullable

Only subnets that came to exist one of these ways (source.type). Repeat for several.

managed_bystring[] nullable

Only bridge subnets created by one of these container runtimes. Repeat for several.

user_managedboolean nullable

true returns only the subnets the user curates, leaving out the ones Scanopy fabricates (Subnet::is_user_managed).

include_shared_rangesboolean nullable

With user_managed=true, also returns the Internet and Remote Network ranges every site is seeded with, once each: one site's copy, from the lowest site id among the sites listed.

tag_idsstring[] nullable

Filter by tag IDs (returns subnets that have ANY of the specified tags)

tag_setsstring[] nullable

Tag sets the subnet must hold one tag from each of. Each entry is a comma-separated list of tag ids. One entry per tag group the list is filtered by.

group_by'created_at' | 'name' | 'cidr' | 'subnet_type' | 'updated_at' | 'site_id' | 'last_seen_at' | 'source' | 'managed_by' | 'utilization'

Fields that subnets can be ordered/grouped by.

Primary ordering field (used for grouping). Always sorts ASC to keep groups together.

order_by'created_at' | 'name' | 'cidr' | 'subnet_type' | 'updated_at' | 'site_id' | 'last_seen_at' | 'source' | 'managed_by' | 'utilization'

Fields that subnets can be ordered/grouped by.

Secondary ordering field (sorting within groups or standalone sort).

group_by_tag_groupstring uuid nullable

Group by the tag each row holds from this tag group. Takes the place of group_by.

order_by_tag_groupstring uuid nullable

Sort by the position of the tag each row holds from this tag group. Takes the place of order_by.

order_direction'asc' | 'desc'

Direction for ORDER BY clauses.

Direction for order_by field (group_by always uses ASC).

limitinteger nullable

Maximum number of results to return (1-1000, default: 50). Use 0 for no limit.

offsetinteger nullable

Number of results to skip. Default: 0.

atstring date-time nullable

As-of timestamp (ISO 8601). When set, returns SCD2 state as of this instant (snapshot view) instead of live state.

staleboolean nullable

true returns only subnets discovery hasn't observed within their site's staleness window; false returns only those it has. Omit for both. Evaluated per row against the subnet's own site's window.

searchstring nullable

Free-text search. Case-insensitive substring match against the subnet's name, CIDR and description.

Response

Distinct values and their Subnet counts

errorstring nullable

Not sent on a successful response. Failure messages arrive in an ApiErrorResponse.

successboolean required

Always true on a successful response.

Example response

{
  "meta": {
    "api_version": 1,
    "server_version": "0.19.4"
  }
}

Changes