Manage Base table query
Path: /api/chf/graph/base
Method: POST
Request body:
{
[mandatory] "filter_clause": "<filter bar expression> (e.g. ip_client = '192.168.1.101')",
[mandatory] "selected_columns": [
"update_client_server_packets",
"update_server_client_packets"
],
[mandatory] "group_by_field": "application",
[mandatory] "group_by_values": ["gitlab", "skype", ...],
[mandatory] "entries_num": 1..300,
[optional] "from_timestamp": 1748287261,
[optional] "to_timestamp": 1748546461,
[optional] "settings":
{
"max_execution_time": 5.0,
"timeout_overflow_mode": "throw"
}
}Response:
{
"message": "Success",
"data": {
"uuid": "c8144dc6-8aa0-ae89-1550-542cff5c3bab"
}
}if from_timestamp is not provided or is null, the minimum value is used.
if to_timestamp is not provided or is null, the maximum value is used.
entries_num must not be 0.
filter_clause is the part which is supposed to be inserted after a WHERE keyword of an SQL query. The query time range will be added to this statement based on from_timestamp and to_timestamp. If filter_clause is an empty string, null, the time range and group_by_values will be the only condition in the WHERE statement.
group_by_field is the part which is supposed to be inserted after a GROUP BY keyword of an SQL query.
group_by_values represent the set of values that the group_by_field should match and these values are included in the WHERE clause of the query.
selected_columns - specified list of columns, which FE wants to receive in the response and these columns are required to have one of the following types: number_ns, number_units, number_bytes, number_bps or number_ratio.
settings defines an query excution time policy. If a query exceeds the specified maximum execution time, it is interrupted, and an error is returned to the FE. Otherwise, the query will be executed again, and the results will be available as usual.
max_execution_time: specifies the maximum allowed time in seconds before a query is interrupted.timeout_overflow_mode: controls the behavior when a query exceeds the specified max_execution_time during execution. It supports the following options:
throw: The query is terminated and a 412 Precondition Failed error is returned.break: The query is terminated but no error is returned. When the FE requests data, the BE returns no data.Path: /api/chf/graph/base/{uuid}
Method: GET
Path parameter:
uuid - received from the previous requestResponse:
{
"message": "Success",
"data": {
"state": "no_page_no_processing",
"custom_data":{
"interval_sec": 1,
"group_by_values": ["TCP", "UDP"]
},
"page": [
{
"timestamp": 1755504000,
"result": [
{
"value": "TCP",
"update_client_server_packets": 36907156908,
"update_server_client_packets": 46577103537
},
{
"value": "UDP",
"update_client_server_packets": 8163189092,
"update_server_client_packets": 13146596960
}
]
},
{
"timestamp": 1755511200,
"result": [
{
"value": "UDP",
"update_client_server_packets": 8062601819,
"update_server_client_packets": 11459216526
},
{
"value": "TCP",
"update_client_server_packets": 34108478082,
"update_server_client_packets": 42567075002
}
]
},
{
"timestamp": 1755518400,
"result": [
{
"value": "UDP",
"update_client_server_packets": 0,
"update_server_client_packets": 0
},
{
"value": "TCP",
"update_client_server_packets": 0,
"update_server_client_packets": 0
}
]
},
{
"timestamp": 1755540000,
"result": [
{
"value": "UDP",
"update_client_server_packets": 10060488802,
"update_server_client_packets": 14176114443
},
{
"value": "TCP",
"update_client_server_packets": 42956148851,
"update_server_client_packets": 52929756358
}
]
},
{
"timestamp": 1755547200,
"result": [
{
"value": "TCP",
"update_client_server_packets": 45755392581,
"update_server_client_packets": 56382336288
},
{
"value": "UDP",
"update_client_server_packets": 10692166497,
"update_server_client_packets": 15068684477
}
]
},
{
"timestamp": 1755554400,
"result": [
{
"value": "UDP",
"update_client_server_packets": 10703398505,
"update_server_client_packets": 15084046793
},
{
"value": "TCP",
"update_client_server_packets": 45773889216,
"update_server_client_packets": 56375811478
}
]
},
{
"timestamp": 1755561600,
"result": [
{
"value": "UDP",
"update_client_server_packets": 10709241027,
"update_server_client_packets": 15087860148
},
{
"value": "TCP",
"update_client_server_packets": 45718687426,
"update_server_client_packets": 56439414539
}
]
},
{
"timestamp": 1755568800,
"result": [
{
"value": "TCP",
"update_client_server_packets": 45715210524,
"update_server_client_packets": 56366378640
},
{
"value": "UDP",
"update_client_server_packets": 10686183748,
"update_server_client_packets": 15046917616
}
]
},
{
"timestamp": 1755576000,
"result": [
{
"value": "UDP",
"update_client_server_packets": 10731050211,
"update_server_client_packets": 15073706236
},
{
"value": "TCP",
"update_client_server_packets": 45727386813,
"update_server_client_packets": 56434039230
}
]
},
{
"timestamp": 1755583200,
"result": [
{
"value": "TCP",
"update_client_server_packets": 18798155201,
"update_server_client_packets": 23240743180
},
{
"value": "UDP",
"update_client_server_packets": 4455462121,
"update_server_client_packets": 6263487694
}
]
}
...
]
}
}state one of:
has_next - there is the next page, it can asked for immediatelyno_page_processing - there is no next page yet, but the query it still being processed, maybe it will appear later; sleep for a bit and try againno_page_no_processing - the query processing has finished and there’s no next page; stopcustom_data - additional information that needs to be included with the result:
page contains data for selected_columns.
Path: /api/chf/graph/base/{uuid}
Method: DELETE
Path parameter:
uuid - received from the previous requestResponse:
{
"message": "Successfully interrupted processing the query (5f966c56-6acb-d5c5-7832-eb29b000f333)",
"data": null
}