Admin Endpoints¶
Administrative tools, KPIs, debugging, and system utilities.
Overview¶
KPIs¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/kpis |
Get all KPIs |
| GET | /admin/kpis/available |
List available KPIs |
| GET | /admin/kpis/{name} |
Get specific KPI |
| GET | /admin/kpis/{name}/aggregated |
Get aggregated KPI |
Debug¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /debug/profiling |
Profiling overview |
| GET | /debug/profiling/endpoints |
Endpoint profiling |
| GET | /debug/profiling/slow-queries |
Slow query analysis |
| GET | /debug/profiling/status |
System status |
Utils¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /utils/health |
Health check |
| GET | /utils/version |
API version |
API Reference¶
Sartiq Backend Server - Admin 0.1.0¶
utils¶
POST /api/v1/utils/test-email/¶
Test Email
Description
Test emails.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
email_to |
query | string | No |
Responses
GET /api/v1/utils/health-check/¶
Health Check
Responses
GET /api/v1/utils/system-health-check¶
System Health Check
Description
Comprehensive system health check that verifies all service connections. Ensures a response is always returned, even if some services fail to respond.
Responses
GET /api/v1/utils/db-check/¶
Db Health
Responses
gce¶
GET /api/v1/gce/instances¶
Get Instances
Description
Get all Google Compute Engine instances.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
GET /api/v1/gce/instance-status/{instance_id}¶
Get Instance Status
Description
Get the status of a specific instance by ID.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
instance_id |
path | string | No |
Responses
POST /api/v1/gce/start-instance/{instance_id}¶
Start Instance
Description
Start a Google Compute Engine instance.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
instance_id |
path | string | No |
Responses
POST /api/v1/gce/stop-instance/{instance_id}¶
Stop Instance
Description
Stop a Google Compute Engine instance.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
instance_id |
path | string | No |
Responses
admin-kpis¶
GET /api/v1/admin/kpis¶
Get All Kpis
Description
Get all KPI values for a time range.
Requires admin privileges.
Returns counts for: - approved_shots: Revisions with APPROVED status - proposal_shots: Revisions with PROPOSAL status - autogen_post_prod: Autogenerated proposals whose immediate next revision is POST_PROD - autogen_rejected: Autogenerated proposals whose immediate next revision is REJECTED - autogen_pending: Autogenerated proposals whose immediate next revision is PENDING
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
end_date |
query | string | No | End of time range (exclusive) | |
start_date |
query | string | No | Start of time range (inclusive) |
Responses
{
"approved_shots": {
"kpi_name": "string",
"value": 0,
"start_date": "2022-04-13T15:42:05.901Z",
"end_date": "2022-04-13T15:42:05.901Z"
},
"proposal_shots": null,
"autogen_post_prod": null,
"autogen_rejected": null,
"autogen_pending": null
}
Schema of the response body
{
"properties": {
"approved_shots": {
"$ref": "#/components/schemas/KPIResultPublic"
},
"proposal_shots": {
"$ref": "#/components/schemas/KPIResultPublic"
},
"autogen_post_prod": {
"$ref": "#/components/schemas/KPIResultPublic"
},
"autogen_rejected": {
"$ref": "#/components/schemas/KPIResultPublic"
},
"autogen_pending": {
"$ref": "#/components/schemas/KPIResultPublic"
}
},
"type": "object",
"required": [
"approved_shots",
"proposal_shots",
"autogen_post_prod",
"autogen_rejected",
"autogen_pending"
],
"title": "AllKPIsResponse",
"description": "Response containing all KPI values for a time range"
}
GET /api/v1/admin/kpis/available¶
Get Available Kpis
Description
Get list of available KPI names.
Requires admin privileges.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
GET /api/v1/admin/kpis/{kpi_name}¶
Get Kpi
Description
Get a single KPI value for a time range.
Requires admin privileges.
Available KPIs: - approved_shots - proposal_shots - autogen_post_prod - autogen_rejected - autogen_pending
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
end_date |
query | string | No | End of time range (exclusive) | |
kpi_name |
path | string | No | ||
start_date |
query | string | No | Start of time range (inclusive) |
Responses
{
"kpi_name": "string",
"value": 0,
"start_date": "2022-04-13T15:42:05.901Z",
"end_date": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"kpi_name": {
"type": "string",
"title": "Kpi Name"
},
"value": {
"type": "integer",
"title": "Value"
},
"start_date": {
"type": "string",
"format": "date-time",
"title": "Start Date"
},
"end_date": {
"type": "string",
"format": "date-time",
"title": "End Date"
}
},
"type": "object",
"required": [
"kpi_name",
"value",
"start_date",
"end_date"
],
"title": "KPIResultPublic",
"description": "Result for a single KPI query"
}
GET /api/v1/admin/kpis/{kpi_name}/aggregated¶
Get Aggregated Kpi
Description
Get aggregated KPI values with time-series data and mean.
Requires admin privileges.
Returns a list of data points, one per interval period (day/week/month), along with the mean value across all periods.
This is useful for monitoring KPI trends over time.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
end_date |
query | string | No | End of time range (exclusive) | |
interval |
query | No | Aggregation interval (day, week, month) | ||
kpi_name |
path | string | No | ||
start_date |
query | string | No | Start of time range (inclusive) |
Responses
{
"kpi_name": "string",
"interval": "day",
"data_points": [
{
"period_start": "2022-04-13T15:42:05.901Z",
"period_end": "2022-04-13T15:42:05.901Z",
"value": 0
}
],
"mean": 10.12,
"start_date": "2022-04-13T15:42:05.901Z",
"end_date": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"kpi_name": {
"type": "string",
"title": "Kpi Name"
},
"interval": {
"$ref": "#/components/schemas/AggregationInterval"
},
"data_points": {
"items": {
"$ref": "#/components/schemas/KPIDataPointPublic"
},
"type": "array",
"title": "Data Points"
},
"mean": {
"type": "number",
"title": "Mean"
},
"start_date": {
"type": "string",
"format": "date-time",
"title": "Start Date"
},
"end_date": {
"type": "string",
"format": "date-time",
"title": "End Date"
}
},
"type": "object",
"required": [
"kpi_name",
"interval",
"data_points",
"mean",
"start_date",
"end_date"
],
"title": "AggregatedKPIResponse",
"description": "Response for aggregated KPI query with time-series data"
}
GET /api/v1/admin/kpis/revisions-by-status¶
Get Revisions By Status Kpi
Description
Get count of revisions with specified status in time range.
Requires admin privileges.
This is a parameterized KPI that counts shot revisions created in the given time period that have the specified status.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
end_date |
query | string | No | End of time range (exclusive) | |
start_date |
query | string | No | Start of time range (inclusive) | |
status |
query | No | Shot status to count revisions for |
Responses
{
"status": "string",
"kpi_name": "string",
"value": 0,
"start_date": "2022-04-13T15:42:05.901Z",
"end_date": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"status": {
"type": "string",
"title": "Status"
},
"kpi_name": {
"type": "string",
"title": "Kpi Name"
},
"value": {
"type": "integer",
"title": "Value"
},
"start_date": {
"type": "string",
"format": "date-time",
"title": "Start Date"
},
"end_date": {
"type": "string",
"format": "date-time",
"title": "End Date"
}
},
"type": "object",
"required": [
"status",
"kpi_name",
"value",
"start_date",
"end_date"
],
"title": "RevisionsByStatusKPIResponse",
"description": "Response for revisions-by-status KPI query"
}
GET /api/v1/admin/kpis/revisions-by-status/aggregated¶
Get Revisions By Status Aggregated Kpi
Description
Get aggregated revisions-by-status KPI with time-series data and mean.
Requires admin privileges.
Returns a list of data points, one per interval period (day/week/month), along with the mean value across all periods. This is useful for monitoring revision status trends over time.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
end_date |
query | string | No | End of time range (exclusive) | |
interval |
query | No | Aggregation interval (day, week, month) | ||
start_date |
query | string | No | Start of time range (inclusive) | |
status |
query | No | Shot status to count revisions for |
Responses
{
"kpi_name": "string",
"interval": "day",
"data_points": [
{
"period_start": "2022-04-13T15:42:05.901Z",
"period_end": "2022-04-13T15:42:05.901Z",
"value": 0
}
],
"mean": 10.12,
"start_date": "2022-04-13T15:42:05.901Z",
"end_date": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"kpi_name": {
"type": "string",
"title": "Kpi Name"
},
"interval": {
"$ref": "#/components/schemas/AggregationInterval"
},
"data_points": {
"items": {
"$ref": "#/components/schemas/KPIDataPointPublic"
},
"type": "array",
"title": "Data Points"
},
"mean": {
"type": "number",
"title": "Mean"
},
"start_date": {
"type": "string",
"format": "date-time",
"title": "Start Date"
},
"end_date": {
"type": "string",
"format": "date-time",
"title": "End Date"
}
},
"type": "object",
"required": [
"kpi_name",
"interval",
"data_points",
"mean",
"start_date",
"end_date"
],
"title": "AggregatedKPIResponse",
"description": "Response for aggregated KPI query with time-series data"
}
Schemas¶
AggregatedKPIResponse¶
| Name | Type | Description |
|---|---|---|
data_points |
Array<KPIDataPointPublic> | |
end_date |
string(date-time) | |
interval |
AggregationInterval | |
kpi_name |
string | |
mean |
number | |
start_date |
string(date-time) |
AggregationInterval¶
Type: string
AllKPIsResponse¶
| Name | Type | Description |
|---|---|---|
approved_shots |
KPIResultPublic | |
autogen_pending |
KPIResultPublic | |
autogen_post_prod |
KPIResultPublic | |
autogen_rejected |
KPIResultPublic | |
proposal_shots |
KPIResultPublic |
AvailableKPIsResponse¶
| Name | Type | Description |
|---|---|---|
kpis |
Array<string> |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
KPIDataPointPublic¶
| Name | Type | Description |
|---|---|---|
period_end |
string(date-time) | |
period_start |
string(date-time) | |
value |
integer |
KPIResultPublic¶
| Name | Type | Description |
|---|---|---|
end_date |
string(date-time) | |
kpi_name |
string | |
start_date |
string(date-time) | |
value |
integer |
Message¶
| Name | Type | Description |
|---|---|---|
message |
string |
RevisionsByStatusKPIResponse¶
| Name | Type | Description |
|---|---|---|
end_date |
string(date-time) | |
kpi_name |
string | |
start_date |
string(date-time) | |
status |
string | |
value |
integer |
ShotStatus¶
Type: string
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |