Skip to main content

Counter Group Info API

Retrieve metadata about enabled counter groups in a Trisul context, including group names, GUIDs, bucket sizes, and optionally detailed meter definitions. This API is the REST/JSON equivalent of the TRP COUNTER_GROUP_INFO_REQUEST command.

Use this API as a discovery step before calling the Topper API or other counter-group-based endpoints.


Endpoint​

PropertyValue
URL/api/counter_group_info/counter_group_info_request
MethodsGET, POST
Content-Typeapplication/json (response)
AuthenticationAPI token required

Authentication​

All requests must include a valid API token and username. The token is the user's auto_login_token configured in WebTrisul.

To generate an API token, see Generate API Token.

ParameterRequiredDescription
api_tokenYesUser's API authentication token
usernameYesUsername of the authenticated user

Request Parameters​

Required​

ParameterTypeDescription
contextstringWebTrisul context name (e.g. default, netflow)

Optional​

ParameterTypeDefaultDescription
counter_groupstring—GUID of a specific counter group. When omitted, returns information for all enabled counter groups in the context
get_meter_infobooleanfalseWhen true, includes detailed meter definitions (id, type, name, description, units) for each counter group
probe_idstring—Restrict query to a specific probe
destination_nodestring—Route the request to a specific Trisul node
timeoutinteger-1TRP query timeout in seconds (-1 = use system default)

Sample Requests​

cURL — List all counter groups​

curl -G "http://<webtrisul-host>/api/counter_group_info/counter_group_info_request" \
--data-urlencode "api_token=YOUR_API_TOKEN" \
--data-urlencode "username=your_username" \
--data-urlencode "context=netflow"

cURL — Get a specific counter group with meter details​

curl -G "http://<webtrisul-host>/api/counter_group_info/counter_group_info_request" \
--data-urlencode "api_token=YOUR_API_TOKEN" \
--data-urlencode "username=your_username" \
--data-urlencode "context=netflow" \
--data-urlencode "counter_group={C0B04CA7-95FA-44EF-8475-3835F3314761}" \
--data-urlencode "get_meter_info=true"

Success Response​

HTTP Status: 200 OK

All counter groups (without meter info)​

{
"group_details": [
{
"guid": "{C0B04CA7-95FA-44EF-8475-3835F3314761}",
"name": "Hosts",
"bucket_size": 60,
"topper_bucket_size": 300,
"time_interval": {
"from": 1721001600,
"to": 1721088000
},
"crosskey": {
"parentguid": "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}",
"crosskeyguid_1": "{B2C3D4E5-F6A7-8901-BCDE-F12345678901}",
"crosskeyguid_2": "{C3D4E5F6-A7B8-9012-CDEF-123456789012}"
}
},
{
"guid": "{D4E5F6A7-B8C9-0123-DEF0-234567890123}",
"name": "Internal Hosts",
"bucket_size": 60,
"topper_bucket_size": 300,
"time_interval": {
"from": 1721001600,
"to": 1721088000
}
},
{
"guid": "{E5F6A7B8-C9D0-1234-EF01-345678901234}",
"name": "Protocol Tree",
"bucket_size": 60,
"topper_bucket_size": 300,
"time_interval": {
"from": 1721001600,
"to": 1721088000
}
}
]
}

Single counter group with meter info (get_meter_info=true)​

{
"group_details": [
{
"guid": "{C0B04CA7-95FA-44EF-8475-3835F3314761}",
"name": "Hosts",
"bucket_size": 60,
"topper_bucket_size": 300,
"time_interval": {
"from": 1721001600,
"to": 1721088000
},
"meters": [
{
"id": 0,
"type": 2,
"topcount": 100,
"name": "TotalBytes",
"description": "Total bytes (A>Z + Z>A)",
"units": "bytes"
},
{
"id": 1,
"type": 2,
"topcount": 100,
"name": "TotalPackets",
"description": "Total packets",
"units": "packets"
},
{
"id": 6,
"type": 3,
"topcount": 100,
"name": "TotalConnections",
"description": "Total connections",
"units": "connections"
}
]
}
]
}

Response Fields​

Root Object​

FieldTypeDescription
group_detailsarrayList of counter group metadata objects

Counter Group Object (group_details[])​

FieldTypeDescription
guidstringUnique identifier for the counter group. Use this value as counter_group in the Topper API
namestringHuman-readable counter group name (e.g. Hosts, Internal Hosts, Protocol Tree)
bucket_sizeintegerTime bucket size in seconds for all meters in this group
topper_bucket_sizeintegerStreaming analytics window size in seconds used for top-N calculations
time_intervalobjectTotal time range available in the database for this counter group
time_interval.fromintegerStart timestamp (Unix epoch seconds)
time_interval.tointegerEnd timestamp (Unix epoch seconds)
metersarrayMeter definitions (only present when get_meter_info=true)
crosskeyobjectCross-key relationship metadata (only present for cross-key counter groups)

Meter Object (meters[])​

FieldTypeDescription
idintegerMeter index. Use this as the meter parameter in the Topper API
typeintegerMeter type enum (see table below)
topcountintegerDefault top-N count for this meter
namestringShort meter name (e.g. TotalBytes, TotalConnections)
descriptionstringHuman-readable meter description
unitsstringUnit of measurement (e.g. bytes, packets, connections)

Meter Type Values​

ValueTypeDescription
0VT_INVALIDInvalid meter
1VT_RATE_COUNTER_WITH_SLIDING_WINDOWRate counter with sliding window (top-N)
2VT_COUNTERBasic counter
3VT_COUNTER_WITH_SLIDING_WINDOWCounter with sliding window (top-N)
4VT_RATE_COUNTERRate counter (value per second)
5VT_GAUGEBasic gauge
6VT_GAUGE_MIN_MAX_AVGGauge with min/avg/max columns
7VT_AUTOAutomatic (min/max/avg/stddev)
8VT_RUNNING_COUNTERRunning counter, no delta calculation
9VT_AVERAGEAverage of samples
10VT_DELTA_RATE_COUNTERDelta rate counter (SNMP-style)
11VT_MAXMaximum of samples
12VT_MINMinimum of samples

Crosskey Object (crosskey)​

FieldTypeDescription
parentguidstringParent counter group GUID
crosskeyguid_1stringFirst cross-key counter group GUID
crosskeyguid_2stringSecond cross-key counter group GUID (optional)

Error Responses​

HTTP StatusConditionExample Response
400 Bad RequestMissing context{"status":"ERROR","message":"context is required"}
401 UnauthorizedInvalid API token{"status":"ERROR","message":"Invalid API token"}
403 ForbiddenUser lacks context access{"status":"ERROR","message":"User your_username is not allowed to access context netflow"}
422 Unprocessable EntityInvalid context name{"status":"ERROR","message":"Invalid context name - netflow"}
500 Internal Server ErrorBackend TRP failure{"status":"ERROR","message":"<error details>"}

Typical Workflow​

1. Call Counter Group Info API
→ Obtain counter group GUIDs and meter indices

2. Call Time Slices API (optional)
→ Determine available historical data ranges

3. Call Counter Group Topper API
→ Query top-K keys using the GUID and meter from step 1

Example: Find top hosts by connections​

# Step 1: Discover the "Hosts" counter group and its meters
curl -G ".../api/counter_group_info/counter_group_info_request" \
--data-urlencode "context=netflow" \
--data-urlencode "get_meter_info=true" \
...

# Response shows: Hosts GUID = {C0B04CA7-...}, meter id 6 = TotalConnections

# Step 2: Query top 10 hosts by connections
curl -G ".../api/topper/topper_request" \
--data-urlencode "context=netflow" \
--data-urlencode "counter_group={C0B04CA7-95FA-44EF-8475-3835F3314761}" \
--data-urlencode "meter=6" \
--data-urlencode "maxitems=10" \
...

Usage Notes​

  1. Discovery endpoint — This API does not return actual metric data. It returns structural metadata about counter groups. Use the Topper API for actual top-N data.
  2. Filter by GUID — Pass counter_group to retrieve metadata for a single group instead of the full list.
  3. Meter info overhead — Setting get_meter_info=true returns more data per group. Request it only when you need meter definitions.
  4. Cross-key groups — Counter groups with a crosskey object are cross-key groups used for multi-dimensional drill-down analytics. The crosskeyguid_1 and crosskeyguid_2 values reference related counter groups.