AIOS Métricas - First Detection

AIOS Métricas - First Detection

Screenshot 2025-07-07 125553.png
Swagger AIOS Metrics - https://gateway.dt-app.com/docs#/

GET /first_detection

Retorna a primeira data/hora que ocorreu alguma detecção

Query Params

Name

Type

Desc

Default

Accepted Values

Name

Type

Desc

Default

Accepted Values

pipeline_id

string

ID of the pipeline to which the metric belongs

--

Any string

component_name

string

Type of component in the pipeline to which the metric belongs

--

PolylineWithDirection | DetectionInPolygon | Polyline | ALPRComponent | Loitering

component_id

string

ID of the component in the pipeline to which the metric belongs

--

Any string

start_timestamp

int

Minimal timestamp in window-time

0

Any non-negative integer

end_timestamp

int

Maximum timestamp in window-time

2556143999000

Any non-negative integer

window_time_mode

string

Window time filter mode

absolute

absolute | schedule

classes

string

List of classes to filter

[] (empty list)

Any string list

Body

Nenhum body requerido.

Resposta

  • Response: 200 OK

{ "result": "2025-02-28T14:26:01+00:00", "metric_type": "literal" }
  • Exceptions:

    • 500 Internal Server Error


Exemplos

Python:

import requests url = "https://metrics.dt-app.com/first_detection" params = { "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", # Available values : PolylineWithDirection, DetectionInPolygon, Polyline, ObjectDetectionComponent, ALPRComponent, Loitering "component_id": "component_123", "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute", # "classes": ["vehicle", "person"] # Optional } headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" } body = {} response = requests.get(url, headers=headers, params=params, json=body) print("Status code:", response.status_code) try: print("Response JSON:", response.json()) except Exception as e: print("Error parsing JSON:", e) print("Raw response text:", response.text)

JavaScript:

const url = "https://metrics.dt-app.com/first_detection"; const params = { "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", // Available values : PolylineWithDirection, DetectionInPolygon, Polyline, ObjectDetectionComponent, ALPRComponent, Loitering "component_id": "component_123", "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute" // "classes": [] Optional }; const queryString = new URLSearchParams(params).toString(); const fullUrl = `${url}?${queryString}`; const headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" }; const body = {}; console.log(`Sending request to: ${fullUrl}`); fetch(fullUrl, { method: 'GET', headers: headers, body: JSON.stringify(body) }) .then(response => { console.log("Status code:", response.status); if (!response.ok) { return response.text().then(text => { throw new Error(`HTTP error! status: ${response.status}, body: ${text}`); }); } return response.json(); }) .then(data => { console.log("Response JSON:", data); }) .catch(error => { console.error("Error:", error); });

Curl

curl -X GET \ 'https://metrics.dt-app.com/first_detection?pipeline_id=PIPELINE_ID&component_name=DetectionInPolygon&component_id=COMPONENT_ID&start_timestamp=0&end_timestamp=2556143999000&window_time_mode=absolute' \ -H 'x-api-key: your-api-key-here' \ -H 'Content-Type: application/json' \ -d '{}'