mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
Decouple API contract from internal models by introducing dedicated DTOs for requests and responses. - Add Response DTOs for all resources (API Keys, Bindings, Models, Namespaces, etc.) - Update Swagger annotations to use DTOs with field examples instead of internal models - Refactor handlers to bind and return DTO structures - Consolidate request/response definitions in the dto package
10532 lines
383 KiB
JSON
10532 lines
383 KiB
JSON
{
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"description": "Management API for EZ-API Gateway system.",
|
||
"title": "EZ-API Control Plane",
|
||
"termsOfService": "http://swagger.io/terms/",
|
||
"contact": {
|
||
"name": "API Support",
|
||
"url": "http://www.swagger.io/support",
|
||
"email": "support@swagger.io"
|
||
},
|
||
"license": {
|
||
"name": "Apache 2.0",
|
||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||
},
|
||
"version": "0.0.1"
|
||
},
|
||
"host": "localhost:8080",
|
||
"basePath": "/",
|
||
"paths": {
|
||
"/about": {
|
||
"get": {
|
||
"description": "Returns system metadata for display on an about page",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Public"
|
||
],
|
||
"summary": "Get system information",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AboutResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List system alerts with optional filters",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List alerts",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "offset",
|
||
"name": "offset",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "filter by status (active, acknowledged, resolved, dismissed)",
|
||
"name": "status",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "filter by severity (info, warning, critical)",
|
||
"name": "severity",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "filter by type (rate_limit, error_spike, quota_exceeded, key_disabled, key_expired, provider_down, traffic_spike)",
|
||
"name": "type",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.ListAlertsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a new system alert",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create alert",
|
||
"parameters": [
|
||
{
|
||
"description": "Alert data",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.CreateAlertRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts/stats": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get alert count statistics by status and severity",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Alert statistics",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertStats"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts/thresholds": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get current alert threshold configuration for traffic spike detection",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get alert thresholds",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertThresholdView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update alert threshold configuration for traffic spike detection",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update alert thresholds",
|
||
"parameters": [
|
||
{
|
||
"description": "Threshold configuration",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateAlertThresholdsRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertThresholdView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a single alert by ID",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get alert",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Alert ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Dismiss an alert (soft delete)",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Dismiss alert",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Alert ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts/{id}/ack": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Mark an alert as acknowledged",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Acknowledge alert",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Alert ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Ack data",
|
||
"name": "request",
|
||
"in": "body",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.AckAlertRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/alerts/{id}/resolve": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Mark an alert as resolved",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Resolve alert",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Alert ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AlertView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/api-keys": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List API keys with optional filters",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List API keys",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "filter by group_id",
|
||
"name": "group_id",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "filter by status (active, suspended, auto_disabled, manual_disabled)",
|
||
"name": "status",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.APIKeyResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create an API key for a provider group",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create an API key",
|
||
"parameters": [
|
||
{
|
||
"description": "API key payload",
|
||
"name": "key",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.APIKeyDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.APIKeyResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/api-keys/batch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Batch delete or status update for api keys",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Batch api keys",
|
||
"parameters": [
|
||
{
|
||
"description": "Batch payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.BatchActionRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.BatchResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/api-keys/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get an API key by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get API key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "APIKey ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.APIKeyResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update an API key",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update API key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "APIKey ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "API key payload",
|
||
"name": "key",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.APIKeyDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.APIKeyResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete an API key",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete API key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "APIKey ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/apikey-stats/summary": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Aggregate APIKey success/failure stats across all provider groups",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "APIKey stats summary (admin)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Start time (unix seconds)",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "End time (unix seconds)",
|
||
"name": "until",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.APIKeyStatsSummaryResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/bindings": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List all configured bindings",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List bindings",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by namespace/public_model",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.BindingResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a new (namespace, public_model) binding to a provider group and selector",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create a new binding",
|
||
"parameters": [
|
||
{
|
||
"description": "Binding Info",
|
||
"name": "binding",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.BindingDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.BindingResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/bindings/batch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Batch delete or status update for bindings",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Batch bindings",
|
||
"parameters": [
|
||
{
|
||
"description": "Batch payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.BatchActionRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.BatchResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/bindings/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a binding by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get a binding",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Binding ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.BindingResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update an existing binding",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update a binding",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Binding ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Binding Info",
|
||
"name": "binding",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.BindingDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.BindingResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete a binding by id and rebuild bindings snapshot",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete a binding",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Binding ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/dashboard/summary": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns aggregated metrics for dashboard display including requests, tokens, latency, masters, keys, and provider keys statistics",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Dashboard summary",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "time period: today, week, month, last7d, last30d, all",
|
||
"name": "period",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"description": "include trend data comparing to previous period",
|
||
"name": "include_trends",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.DashboardSummaryResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/features": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns all feature flags stored in Redis (meta:features)",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List feature flags",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Updates selected feature flags (meta:features). Values are stored as strings.",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update feature flags",
|
||
"parameters": [
|
||
{
|
||
"description": "Feature map",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/ip-bans": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List all global IP/CIDR ban rules",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin",
|
||
"ip-bans"
|
||
],
|
||
"summary": "List IP bans",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "Filter by status (active, expired)",
|
||
"name": "status",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.IPBanView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a new global IP/CIDR ban rule",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin",
|
||
"ip-bans"
|
||
],
|
||
"summary": "Create an IP ban",
|
||
"parameters": [
|
||
{
|
||
"description": "IP Ban Info",
|
||
"name": "ban",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.CreateIPBanRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.IPBanView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"409": {
|
||
"description": "Conflict",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/ip-bans/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a single global IP/CIDR ban rule by ID",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin",
|
||
"ip-bans"
|
||
],
|
||
"summary": "Get an IP ban",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "IP Ban ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.IPBanView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update a global IP/CIDR ban rule",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin",
|
||
"ip-bans"
|
||
],
|
||
"summary": "Update an IP ban",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "IP Ban ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "IP Ban Update",
|
||
"name": "ban",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateIPBanRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.IPBanView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"409": {
|
||
"description": "Conflict",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete a global IP/CIDR ban rule",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin",
|
||
"ip-bans"
|
||
],
|
||
"summary": "Delete an IP ban",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "IP Ban ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "No Content"
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/keys/{id}/access": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns key default_namespace and namespaces",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get key access settings",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Key ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AccessResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Updates key default_namespace and namespaces and syncs to Redis",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update key access settings",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Key ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Access settings",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateAccessRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AccessResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/logs": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List request logs with basic filtering/pagination. Returns full log records including request_body.",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List logs (admin)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "offset",
|
||
"name": "offset",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "key id",
|
||
"name": "key_id",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "route group",
|
||
"name": "group",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "model",
|
||
"name": "model",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "status code",
|
||
"name": "status_code",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.ListLogsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete logs before a given timestamp with optional filters",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete logs (admin)",
|
||
"parameters": [
|
||
{
|
||
"description": "Delete filters",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.DeleteLogsRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.DeleteLogsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/logs/stats": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Aggregate log stats with basic filtering. Use group_by param for grouped statistics (model/day/month/hour/minute). Without group_by returns LogStatsResponse; with group_by returns GroupedStatsResponse. Note: minute-level aggregation is limited to 6-hour time ranges.",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Log stats (admin)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"enum": [
|
||
"model",
|
||
"day",
|
||
"month",
|
||
"hour",
|
||
"minute"
|
||
],
|
||
"type": "string",
|
||
"description": "group by dimension: model, day, month, hour, minute. Returns GroupedStatsResponse when specified.",
|
||
"name": "group_by",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "Grouped stats (when group_by is specified)",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.GroupedStatsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/logs/stats/traffic-chart": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get time × model aggregated data for stacked traffic charts. Returns a shared time axis under `x` and per-model series arrays aligned to that axis. Models outside top_n are aggregated under the series name \"other\".",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Traffic chart data (admin)",
|
||
"parameters": [
|
||
{
|
||
"enum": [
|
||
"hour",
|
||
"minute"
|
||
],
|
||
"type": "string",
|
||
"description": "Time granularity: hour (default) or minute",
|
||
"name": "granularity",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Start time (unix seconds), defaults to 24h ago",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "End time (unix seconds), defaults to now",
|
||
"name": "until",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Number of top models to return (1-20), defaults to 5",
|
||
"name": "top_n",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.TrafficChartResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/logs/webhook": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns current webhook notification config",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get log webhook config",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.LogWebhookConfigResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Updates webhook notification config",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update log webhook config",
|
||
"parameters": [
|
||
{
|
||
"description": "Webhook config",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.UpdateLogWebhookConfigRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.LogWebhookConfigResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List all master tenants",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List masters",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by name/group",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.MasterView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a new master account (tenant)",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create a new master tenant",
|
||
"parameters": [
|
||
{
|
||
"description": "Master Info",
|
||
"name": "master",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.CreateMasterRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/batch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Batch delete or status update for masters",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Batch masters",
|
||
"parameters": [
|
||
{
|
||
"description": "Batch payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.BatchActionRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.BatchResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a master tenant by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get master",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update master fields; optionally propagate group to existing keys",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update master",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Update payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateMasterRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Suspends a master and revokes all existing keys by bumping epoch and syncing to Redis",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete (revoke) master",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}/access": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns master default_namespace and namespaces",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get master access settings",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AccessResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Updates master default_namespace and namespaces; optionally propagate to existing keys",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update master access settings",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Access settings",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateAccessRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AccessResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}/keys": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List child keys issued under a master (admin view)",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List child keys for a master",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by group/scopes/namespaces/status",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.TokenView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Issue a new access token (child key) for a specified master. The key still belongs to the master; issuer is recorded as admin for audit.",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Issue a child key on behalf of a master",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Key Request",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.IssueChildKeyRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "Forbidden",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}/keys/{key_id}": {
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Revokes and removes a child key under the specified master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete child key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Token ID",
|
||
"name": "key_id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.DeleteResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}/manage": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Freeze or unfreeze a master tenant",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Manage master status",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Action",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.ManageMasterRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/masters/{id}/realtime": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Return realtime counters for the specified master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Master realtime stats (admin)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Master ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterRealtimeView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/model-registry/check": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Checks models.dev commit SHA for a ref and indicates whether refresh is needed (does not apply changes)",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Check model registry upstream version",
|
||
"parameters": [
|
||
{
|
||
"description": "optional override ref",
|
||
"name": "body",
|
||
"in": "body",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.refreshModelRegistryRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ModelRegistryCheckResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/model-registry/refresh": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Fetches models.dev, computes per-binding capabilities, and updates Redis meta:models",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Refresh model registry from models.dev",
|
||
"parameters": [
|
||
{
|
||
"description": "optional override ref",
|
||
"name": "body",
|
||
"in": "body",
|
||
"schema": {
|
||
"$ref": "#/definitions/api.refreshModelRegistryRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/model-registry/rollback": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Rollback meta:models to previous cached last-good version",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Rollback model registry",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/model-registry/status": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Returns Redis meta and local last-good cache info for model capability registry",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get model registry status",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ModelRegistryStatusResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/models": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a list of all registered models",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List all models",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by name/kind",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.ModelResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Register a supported model with its capabilities",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Register a new model",
|
||
"parameters": [
|
||
{
|
||
"description": "Model Info",
|
||
"name": "model",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.ModelDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ModelResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/models/batch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Batch delete for models",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Batch models",
|
||
"parameters": [
|
||
{
|
||
"description": "Batch payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.BatchActionRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.BatchResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/models/{id}": {
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update an existing model's configuration",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update a model",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Model ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Model Info",
|
||
"name": "model",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.ModelDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ModelResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete a model by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete a model",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Model ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/namespaces": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List all namespaces",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List namespaces",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by name/description",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.NamespaceResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a namespace for bindings",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create namespace",
|
||
"parameters": [
|
||
{
|
||
"description": "Namespace payload",
|
||
"name": "namespace",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.NamespaceDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.NamespaceResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/namespaces/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a namespace by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get namespace",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Namespace ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.NamespaceResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update a namespace",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update namespace",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Namespace ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Update payload",
|
||
"name": "namespace",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateNamespaceRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.NamespaceResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete a namespace and its bindings",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete namespace",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Namespace ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/operation-logs": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List admin operation logs",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List operation logs",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by actor/method/path",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.OperationLogView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/provider-groups": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "List all provider groups",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "List provider groups",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by name/type",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/dto.ProviderGroupResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Create a provider group definition",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Create a provider group",
|
||
"parameters": [
|
||
{
|
||
"description": "Provider group payload",
|
||
"name": "group",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.ProviderGroupDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ProviderGroupResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/provider-groups/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Get a provider group by id",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Get provider group",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "ProviderGroup ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ProviderGroupResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Update a provider group",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Update provider group",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "ProviderGroup ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Provider group payload",
|
||
"name": "group",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.ProviderGroupDTO"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/dto.ProviderGroupResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Delete a provider group and its api keys/bindings",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Delete provider group",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "ProviderGroup ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/realtime": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Return aggregated realtime counters across all masters",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "System-level realtime stats (admin)",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.SystemRealtimeView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/stats": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Aggregate request stats across all masters",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Usage stats (admin)",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "today|week|month|all",
|
||
"name": "period",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.AdminUsageStatsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/sync/snapshot": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
}
|
||
],
|
||
"description": "Force full synchronization of DB state to Redis",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "Force sync snapshot",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/auth/whoami": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"AdminAuth": []
|
||
},
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Returns complete identity and realtime statistics of the authenticated user.\nSupports Admin Token, Master Key, and Child Key (API Key) authentication.\nThis endpoint is designed for frontend initialization - call once after login\nand store the response for subsequent use.\n\n**Response varies by token type:**\n\n**Admin Token:**\n- type: \"admin\"\n- role: \"admin\"\n- permissions: [\"*\"] (full access)\n\n**Master Key:**\n- type: \"master\"\n- Basic info: id, name, group, namespaces, status, epoch, max_child_keys, global_qps\n- Timestamps: created_at, updated_at\n- Realtime stats: requests, tokens, qps, qps_limit, rate_limited\n\n**Child Key (API Key):**\n- type: \"key\"\n- Basic info: id, master_id, master_name, group, scopes, namespaces, status\n- Security: issued_at_epoch, issued_by, allow_ips, deny_ips, expires_at\n- Model limits: model_limits, model_limits_enabled\n- Quota: quota_limit, quota_used, quota_reset_at, quota_reset_type\n- Usage stats: request_count, used_tokens, last_accessed_at\n- Realtime stats: requests, tokens, qps, qps_limit, rate_limited\n\n**Error responses:**\n- 401: authorization header required\n- 401: invalid authorization header format\n- 401: invalid token\n- 401: token is not active\n- 401: token has expired\n- 401: token has been revoked\n- 401: master is not active",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"auth"
|
||
],
|
||
"summary": "Get current identity",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.WhoamiResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Invalid or missing token",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/internal/alerts/report": {
|
||
"post": {
|
||
"description": "Internal endpoint for Data Plane to report alerts to Control Plane",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"internal"
|
||
],
|
||
"summary": "Report alerts from DP",
|
||
"parameters": [
|
||
{
|
||
"description": "Alerts to report",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.reportAlertsRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.reportAlertsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/internal/apikey-stats/flush": {
|
||
"post": {
|
||
"description": "Internal endpoint for flushing accumulated APIKey stats from DP to CP database",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"internal"
|
||
],
|
||
"summary": "Flush API key stats",
|
||
"parameters": [
|
||
{
|
||
"description": "Stats to flush",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.apiKeyStatsFlushRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/internal/stats/flush": {
|
||
"post": {
|
||
"description": "Internal endpoint for flushing accumulated key usage stats from DP to CP database",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"internal"
|
||
],
|
||
"summary": "Flush key stats",
|
||
"parameters": [
|
||
{
|
||
"description": "Stats to flush",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.statsFlushRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/logs": {
|
||
"post": {
|
||
"description": "Internal endpoint for ingesting logs from Balancer",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"system"
|
||
],
|
||
"summary": "Ingest logs",
|
||
"parameters": [
|
||
{
|
||
"description": "Log Record",
|
||
"name": "log",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/dto.LogRecordRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"202": {
|
||
"description": "Accepted",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/status": {
|
||
"get": {
|
||
"description": "Returns public runtime status information without sensitive data",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Public"
|
||
],
|
||
"summary": "Get system status",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.StatusResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/logs": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "List request logs for the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "List logs (master)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "offset",
|
||
"name": "offset",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "model",
|
||
"name": "model",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "status code",
|
||
"name": "status_code",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.ListMasterLogsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/logs/stats": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Aggregate request log stats for the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Log stats (master)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.LogStatsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/realtime": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Return realtime counters for the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Master realtime stats",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterRealtimeView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/self": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Returns master metadata for the authenticated master key",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Get current master info",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/stats": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Aggregate request stats for the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Usage stats (master)",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "today|week|month|all",
|
||
"name": "period",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "since",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "unix seconds",
|
||
"name": "until",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MasterUsageStatsResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/tokens": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "List child keys issued under the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "List child keys",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "page (1-based)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "limit (default 50, max 200)",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "search by group/scopes/namespaces/status",
|
||
"name": "search",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.TokenView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Issue a new access token (child key) for the authenticated master",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Issue a child key",
|
||
"parameters": [
|
||
{
|
||
"description": "Key Request",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.IssueChildKeyRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"201": {
|
||
"description": "Created",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "Forbidden",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/tokens/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Get a child key by id under the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Get child key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Token ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.TokenView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Update token scopes/status under the authenticated master",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Update child key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Token ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "Update payload",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/api.UpdateTokenRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.TokenView"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"MasterAuth": []
|
||
}
|
||
],
|
||
"description": "Suspends a child key under the authenticated master",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"master"
|
||
],
|
||
"summary": "Delete (revoke) child key",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Token ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "Bad Request",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "Not Found",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.ResponseEnvelope"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/api.MapData"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"api.APIKeyStatsSummaryResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"failure_rate": {
|
||
"type": "number"
|
||
},
|
||
"failure_requests": {
|
||
"type": "integer"
|
||
},
|
||
"success_rate": {
|
||
"type": "number"
|
||
},
|
||
"success_requests": {
|
||
"type": "integer"
|
||
},
|
||
"total_requests": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.AboutResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"description": {
|
||
"type": "string",
|
||
"example": "High-performance LLM API gateway"
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "EZ-API Gateway"
|
||
},
|
||
"repository": {
|
||
"type": "string",
|
||
"example": "https://github.com/ez-api/ez-api"
|
||
},
|
||
"version": {
|
||
"type": "string",
|
||
"example": "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
"api.AccessResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"default_namespace": {
|
||
"type": "string"
|
||
},
|
||
"namespaces": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.AckAlertRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"acked_by": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.AdminUsageStatsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"active_masters": {
|
||
"type": "integer"
|
||
},
|
||
"by_master": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.MasterUsageAgg"
|
||
}
|
||
},
|
||
"by_provider": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.ProviderUsageAgg"
|
||
}
|
||
},
|
||
"period": {
|
||
"type": "string"
|
||
},
|
||
"total_masters": {
|
||
"type": "integer"
|
||
},
|
||
"total_requests": {
|
||
"type": "integer"
|
||
},
|
||
"total_tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.AlertStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"acknowledged": {
|
||
"type": "integer"
|
||
},
|
||
"active": {
|
||
"type": "integer"
|
||
},
|
||
"critical": {
|
||
"type": "integer"
|
||
},
|
||
"info": {
|
||
"type": "integer"
|
||
},
|
||
"resolved": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
},
|
||
"warning": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.AlertThresholdView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"global_qps": {
|
||
"type": "integer"
|
||
},
|
||
"master_rpd": {
|
||
"type": "integer"
|
||
},
|
||
"master_rpm": {
|
||
"type": "integer"
|
||
},
|
||
"master_tpd": {
|
||
"type": "integer"
|
||
},
|
||
"master_tpm": {
|
||
"type": "integer"
|
||
},
|
||
"min_rpm_requests_1m": {
|
||
"type": "integer"
|
||
},
|
||
"min_tpm_tokens_1m": {
|
||
"type": "integer"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.AlertView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"acked_at": {
|
||
"type": "integer"
|
||
},
|
||
"acked_by": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"expires_at": {
|
||
"type": "integer"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
},
|
||
"metadata": {
|
||
"type": "string"
|
||
},
|
||
"related_id": {
|
||
"type": "integer"
|
||
},
|
||
"related_name": {
|
||
"type": "string"
|
||
},
|
||
"related_type": {
|
||
"type": "string"
|
||
},
|
||
"resolved_at": {
|
||
"type": "integer"
|
||
},
|
||
"severity": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.BatchActionRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"action": {
|
||
"type": "string"
|
||
},
|
||
"ids": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.BatchResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"action": {
|
||
"type": "string"
|
||
},
|
||
"failed": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.BatchResult"
|
||
}
|
||
},
|
||
"success": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.BatchResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.CountStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"active": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.CreateAlertRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"severity",
|
||
"title",
|
||
"type"
|
||
],
|
||
"properties": {
|
||
"expires_at": {
|
||
"type": "integer"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
},
|
||
"metadata": {
|
||
"type": "string"
|
||
},
|
||
"related_id": {
|
||
"type": "integer"
|
||
},
|
||
"related_name": {
|
||
"type": "string"
|
||
},
|
||
"related_type": {
|
||
"type": "string"
|
||
},
|
||
"severity": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.CreateIPBanRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"cidr"
|
||
],
|
||
"properties": {
|
||
"cidr": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "integer"
|
||
},
|
||
"reason": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.CreateMasterRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"group",
|
||
"name"
|
||
],
|
||
"properties": {
|
||
"global_qps": {
|
||
"type": "integer"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"max_child_keys": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.DashboardSummaryResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"keys": {
|
||
"$ref": "#/definitions/api.CountStats"
|
||
},
|
||
"latency": {
|
||
"$ref": "#/definitions/api.LatencyStats"
|
||
},
|
||
"masters": {
|
||
"$ref": "#/definitions/api.CountStats"
|
||
},
|
||
"period": {
|
||
"type": "string"
|
||
},
|
||
"provider_keys": {
|
||
"$ref": "#/definitions/api.ProviderKeyStats"
|
||
},
|
||
"requests": {
|
||
"$ref": "#/definitions/api.RequestStats"
|
||
},
|
||
"tokens": {
|
||
"$ref": "#/definitions/api.TokenStats"
|
||
},
|
||
"top_models": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.TopModelStat"
|
||
}
|
||
},
|
||
"trends": {
|
||
"description": "Only present when include_trends=true",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.DashboardTrends"
|
||
}
|
||
]
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.DashboardTrends": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error_rate": {
|
||
"$ref": "#/definitions/api.TrendInfo"
|
||
},
|
||
"latency": {
|
||
"$ref": "#/definitions/api.TrendInfo"
|
||
},
|
||
"requests": {
|
||
"$ref": "#/definitions/api.TrendInfo"
|
||
},
|
||
"tokens": {
|
||
"$ref": "#/definitions/api.TrendInfo"
|
||
}
|
||
}
|
||
},
|
||
"api.DeleteLogsRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"before": {
|
||
"type": "string"
|
||
},
|
||
"key_id": {
|
||
"type": "integer"
|
||
},
|
||
"model": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.DeleteLogsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"deleted_count": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.GroupedStatsItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avg_latency_ms": {
|
||
"type": "number"
|
||
},
|
||
"count": {
|
||
"type": "integer"
|
||
},
|
||
"date": {
|
||
"description": "For group_by=day",
|
||
"type": "string"
|
||
},
|
||
"hour": {
|
||
"description": "For group_by=hour",
|
||
"type": "string"
|
||
},
|
||
"minute": {
|
||
"description": "For group_by=minute",
|
||
"type": "string"
|
||
},
|
||
"model": {
|
||
"description": "For group_by=model",
|
||
"type": "string"
|
||
},
|
||
"month": {
|
||
"description": "For group_by=month",
|
||
"type": "string"
|
||
},
|
||
"tokens_in": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_out": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.GroupedStatsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.GroupedStatsItem"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.IPBanView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"cidr": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"created_by": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "integer"
|
||
},
|
||
"hit_count": {
|
||
"type": "integer"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"reason": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.IssueChildKeyRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"allow_ips": {
|
||
"type": "string"
|
||
},
|
||
"deny_ips": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "string"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"model_limits": {
|
||
"type": "string"
|
||
},
|
||
"model_limits_enabled": {
|
||
"type": "boolean"
|
||
},
|
||
"scopes": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.KeyUsageStat": {
|
||
"type": "object",
|
||
"properties": {
|
||
"key_id": {
|
||
"type": "integer"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.LatencyStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avg_ms": {
|
||
"type": "number"
|
||
}
|
||
}
|
||
},
|
||
"api.ListAlertsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.AlertView"
|
||
}
|
||
},
|
||
"limit": {
|
||
"type": "integer"
|
||
},
|
||
"offset": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ListLogsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.LogView"
|
||
}
|
||
},
|
||
"limit": {
|
||
"type": "integer"
|
||
},
|
||
"offset": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ListMasterLogsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.MasterLogView"
|
||
}
|
||
},
|
||
"limit": {
|
||
"type": "integer"
|
||
},
|
||
"offset": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.LogStatsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avg_latency_ms": {
|
||
"type": "number"
|
||
},
|
||
"by_status": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
},
|
||
"tokens_in": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_out": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.LogView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"audit_reason": {
|
||
"type": "string"
|
||
},
|
||
"client_ip": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"error_message": {
|
||
"type": "string"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"key_id": {
|
||
"type": "integer"
|
||
},
|
||
"latency_ms": {
|
||
"type": "integer"
|
||
},
|
||
"model": {
|
||
"type": "string"
|
||
},
|
||
"provider_id": {
|
||
"type": "integer"
|
||
},
|
||
"provider_name": {
|
||
"type": "string"
|
||
},
|
||
"provider_type": {
|
||
"type": "string"
|
||
},
|
||
"request_body": {
|
||
"type": "string"
|
||
},
|
||
"request_size": {
|
||
"type": "integer"
|
||
},
|
||
"response_size": {
|
||
"type": "integer"
|
||
},
|
||
"status_code": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_in": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_out": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ManageMasterRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"action"
|
||
],
|
||
"properties": {
|
||
"action": {
|
||
"description": "freeze/unfreeze",
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.MapData": {
|
||
"type": "object",
|
||
"additionalProperties": {}
|
||
},
|
||
"api.MasterLogView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"error_message": {
|
||
"type": "string"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"key_id": {
|
||
"type": "integer"
|
||
},
|
||
"latency_ms": {
|
||
"type": "integer"
|
||
},
|
||
"model": {
|
||
"type": "string"
|
||
},
|
||
"request_size": {
|
||
"type": "integer"
|
||
},
|
||
"response_size": {
|
||
"type": "integer"
|
||
},
|
||
"status_code": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_in": {
|
||
"type": "integer"
|
||
},
|
||
"tokens_out": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.MasterRealtimeSummaryView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"master_id": {
|
||
"type": "integer"
|
||
},
|
||
"qps": {
|
||
"type": "integer"
|
||
},
|
||
"rate_limited": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"api.MasterRealtimeView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"qps": {
|
||
"type": "integer"
|
||
},
|
||
"qps_limit": {
|
||
"type": "integer"
|
||
},
|
||
"rate_limited": {
|
||
"type": "boolean"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.MasterUsageAgg": {
|
||
"type": "object",
|
||
"properties": {
|
||
"master_id": {
|
||
"type": "integer"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.MasterUsageStatsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"by_key": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.KeyUsageStat"
|
||
}
|
||
},
|
||
"by_model": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.ModelUsageStat"
|
||
}
|
||
},
|
||
"period": {
|
||
"type": "string"
|
||
},
|
||
"total_requests": {
|
||
"type": "integer"
|
||
},
|
||
"total_tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.MasterView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"default_namespace": {
|
||
"type": "string"
|
||
},
|
||
"epoch": {
|
||
"type": "integer"
|
||
},
|
||
"global_qps": {
|
||
"type": "integer"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"max_child_keys": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"namespaces": {
|
||
"type": "string"
|
||
},
|
||
"realtime": {
|
||
"$ref": "#/definitions/api.MasterRealtimeView"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ModelUsageStat": {
|
||
"type": "object",
|
||
"properties": {
|
||
"model": {
|
||
"type": "string"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.OperationLogView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"actor": {
|
||
"type": "string"
|
||
},
|
||
"client_ip": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"error_message": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"latency_ms": {
|
||
"type": "integer"
|
||
},
|
||
"method": {
|
||
"type": "string"
|
||
},
|
||
"path": {
|
||
"type": "string"
|
||
},
|
||
"query": {
|
||
"type": "string"
|
||
},
|
||
"request_id": {
|
||
"type": "string"
|
||
},
|
||
"status_code": {
|
||
"type": "integer"
|
||
},
|
||
"user_agent": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.ProviderKeyStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"active": {
|
||
"type": "integer"
|
||
},
|
||
"auto_disabled": {
|
||
"type": "integer"
|
||
},
|
||
"suspended": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ProviderUsageAgg": {
|
||
"type": "object",
|
||
"properties": {
|
||
"provider_id": {
|
||
"type": "integer"
|
||
},
|
||
"provider_name": {
|
||
"type": "string"
|
||
},
|
||
"provider_type": {
|
||
"type": "string"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.RequestStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error_rate": {
|
||
"type": "number"
|
||
},
|
||
"failed": {
|
||
"type": "integer"
|
||
},
|
||
"success": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.ResponseEnvelope": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"data": {
|
||
"type": "object"
|
||
},
|
||
"details": {
|
||
"type": "object"
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "success"
|
||
},
|
||
"trace_id": {
|
||
"type": "string",
|
||
"example": "a1b2c3d4e5f6g7h8"
|
||
}
|
||
}
|
||
},
|
||
"api.StatusResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"status": {
|
||
"type": "string",
|
||
"example": "ok"
|
||
},
|
||
"uptime": {
|
||
"type": "string",
|
||
"example": "72h30m15s"
|
||
},
|
||
"version": {
|
||
"type": "string",
|
||
"example": "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
"api.SystemRealtimeView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"by_master": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.MasterRealtimeSummaryView"
|
||
}
|
||
},
|
||
"qps": {
|
||
"type": "integer"
|
||
},
|
||
"rate_limited_count": {
|
||
"type": "integer"
|
||
},
|
||
"rpm": {
|
||
"type": "integer"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.TokenStats": {
|
||
"type": "object",
|
||
"properties": {
|
||
"input": {
|
||
"type": "integer"
|
||
},
|
||
"output": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.TokenView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"allow_ips": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "integer"
|
||
},
|
||
"default_namespace": {
|
||
"type": "string"
|
||
},
|
||
"deny_ips": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "string"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"issued_at_epoch": {
|
||
"type": "integer"
|
||
},
|
||
"issued_by": {
|
||
"type": "string"
|
||
},
|
||
"last_accessed_at": {
|
||
"type": "string"
|
||
},
|
||
"model_limits": {
|
||
"type": "string"
|
||
},
|
||
"model_limits_enabled": {
|
||
"type": "boolean"
|
||
},
|
||
"namespaces": {
|
||
"type": "string"
|
||
},
|
||
"quota_limit": {
|
||
"type": "integer"
|
||
},
|
||
"quota_reset_at": {
|
||
"type": "string"
|
||
},
|
||
"quota_reset_type": {
|
||
"type": "string"
|
||
},
|
||
"quota_used": {
|
||
"type": "integer"
|
||
},
|
||
"request_count": {
|
||
"type": "integer"
|
||
},
|
||
"scopes": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer"
|
||
},
|
||
"used_tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.TopModelStat": {
|
||
"type": "object",
|
||
"properties": {
|
||
"model": {
|
||
"type": "string"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.TrafficChartAxis": {
|
||
"type": "object",
|
||
"properties": {
|
||
"labels": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"timestamps": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"totals": {
|
||
"$ref": "#/definitions/api.TrafficTotals"
|
||
}
|
||
}
|
||
},
|
||
"api.TrafficChartResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"granularity": {
|
||
"type": "string"
|
||
},
|
||
"series": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.TrafficSeries"
|
||
}
|
||
},
|
||
"since": {
|
||
"type": "integer"
|
||
},
|
||
"until": {
|
||
"type": "integer"
|
||
},
|
||
"x": {
|
||
"$ref": "#/definitions/api.TrafficChartAxis"
|
||
}
|
||
}
|
||
},
|
||
"api.TrafficSeries": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"tokens_in": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"tokens_out": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.TrafficTotals": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"tokens_in": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"tokens_out": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.TrendInfo": {
|
||
"type": "object",
|
||
"properties": {
|
||
"delta": {
|
||
"description": "Percentage change from previous period (nil if no baseline)",
|
||
"type": "number"
|
||
},
|
||
"direction": {
|
||
"description": "\"up\", \"down\", \"stable\", or \"new\" (no baseline)",
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateAccessRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"default_namespace": {
|
||
"type": "string"
|
||
},
|
||
"namespaces": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"propagate_to_keys": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateAlertThresholdsRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"global_qps": {
|
||
"type": "integer"
|
||
},
|
||
"master_rpd": {
|
||
"type": "integer"
|
||
},
|
||
"master_rpm": {
|
||
"type": "integer"
|
||
},
|
||
"master_tpd": {
|
||
"type": "integer"
|
||
},
|
||
"master_tpm": {
|
||
"type": "integer"
|
||
},
|
||
"min_rpm_requests_1m": {
|
||
"type": "integer"
|
||
},
|
||
"min_tpm_tokens_1m": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateIPBanRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"expires_at": {
|
||
"$ref": "#/definitions/api.optionalInt64"
|
||
},
|
||
"reason": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateMasterRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"global_qps": {
|
||
"type": "integer"
|
||
},
|
||
"group": {
|
||
"type": "string"
|
||
},
|
||
"max_child_keys": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"propagate_to_keys": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateNamespaceRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.UpdateTokenRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"allow_ips": {
|
||
"type": "string"
|
||
},
|
||
"deny_ips": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "string"
|
||
},
|
||
"model_limits": {
|
||
"type": "string"
|
||
},
|
||
"model_limits_enabled": {
|
||
"type": "boolean"
|
||
},
|
||
"scopes": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"description": "active/suspended",
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.WhoamiRealtimeView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"qps": {
|
||
"description": "Current QPS",
|
||
"type": "integer",
|
||
"example": 5
|
||
},
|
||
"qps_limit": {
|
||
"description": "QPS limit",
|
||
"type": "integer",
|
||
"example": 100
|
||
},
|
||
"rate_limited": {
|
||
"description": "Whether currently rate limited",
|
||
"type": "boolean",
|
||
"example": false
|
||
},
|
||
"requests": {
|
||
"description": "Total requests",
|
||
"type": "integer",
|
||
"example": 100
|
||
},
|
||
"tokens": {
|
||
"description": "Total tokens used",
|
||
"type": "integer",
|
||
"example": 50000
|
||
},
|
||
"updated_at": {
|
||
"description": "Last updated timestamp",
|
||
"type": "integer",
|
||
"example": 1703505600
|
||
}
|
||
}
|
||
},
|
||
"api.WhoamiResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"allow_ips": {
|
||
"description": "IP whitelist (for diagnostics)",
|
||
"type": "string",
|
||
"example": ""
|
||
},
|
||
"created_at": {
|
||
"type": "integer",
|
||
"example": 1703505600
|
||
},
|
||
"default_namespace": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"deny_ips": {
|
||
"description": "IP blacklist (for diagnostics)",
|
||
"type": "string",
|
||
"example": ""
|
||
},
|
||
"epoch": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"expires_at": {
|
||
"description": "Expiration timestamp (0 = never)",
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"global_qps": {
|
||
"type": "integer",
|
||
"example": 100
|
||
},
|
||
"group": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"id": {
|
||
"description": "Master fields (only present when type is \"master\")",
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"issued_at_epoch": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"issued_by": {
|
||
"type": "string",
|
||
"example": "master"
|
||
},
|
||
"last_accessed_at": {
|
||
"description": "Last access timestamp",
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"master_id": {
|
||
"description": "Key fields (only present when type is \"key\")",
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"master_name": {
|
||
"description": "Parent master name (for display)",
|
||
"type": "string",
|
||
"example": "tenant-a"
|
||
},
|
||
"max_child_keys": {
|
||
"type": "integer",
|
||
"example": 5
|
||
},
|
||
"model_limits": {
|
||
"description": "Model restrictions",
|
||
"type": "string",
|
||
"example": "gpt-4,claude"
|
||
},
|
||
"model_limits_enabled": {
|
||
"description": "Whether model limits are active",
|
||
"type": "boolean",
|
||
"example": false
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "tenant-a"
|
||
},
|
||
"namespaces": {
|
||
"type": "string",
|
||
"example": "default,ns1"
|
||
},
|
||
"permissions": {
|
||
"description": "Admin permissions (always [\"*\"])",
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"quota_limit": {
|
||
"description": "Token quota limit (-1 = unlimited)",
|
||
"type": "integer",
|
||
"example": -1
|
||
},
|
||
"quota_reset_at": {
|
||
"description": "Quota reset timestamp",
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"quota_reset_type": {
|
||
"description": "Quota reset type",
|
||
"type": "string",
|
||
"example": "monthly"
|
||
},
|
||
"quota_used": {
|
||
"description": "Token quota used",
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"realtime": {
|
||
"description": "Realtime stats (for master and key types)",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/api.WhoamiRealtimeView"
|
||
}
|
||
]
|
||
},
|
||
"request_count": {
|
||
"description": "Total request count (from DB)",
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"role": {
|
||
"description": "Admin fields (only present when type is \"admin\")",
|
||
"type": "string",
|
||
"example": "admin"
|
||
},
|
||
"scopes": {
|
||
"type": "string",
|
||
"example": "chat:write"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"type": {
|
||
"description": "Type of the authenticated identity: \"admin\", \"master\", or \"key\"",
|
||
"type": "string",
|
||
"example": "master"
|
||
},
|
||
"updated_at": {
|
||
"type": "integer",
|
||
"example": 1703505600
|
||
},
|
||
"used_tokens": {
|
||
"description": "Total tokens used (from DB)",
|
||
"type": "integer",
|
||
"example": 0
|
||
}
|
||
}
|
||
},
|
||
"api.apiKeyStatsFlushEntry": {
|
||
"type": "object",
|
||
"properties": {
|
||
"api_key_id": {
|
||
"type": "integer"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"success_requests": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.apiKeyStatsFlushRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"keys": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.apiKeyStatsFlushEntry"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.optionalInt64": {
|
||
"type": "object",
|
||
"properties": {
|
||
"set": {
|
||
"type": "boolean"
|
||
},
|
||
"value": {
|
||
"type": "integer",
|
||
"format": "int64"
|
||
}
|
||
}
|
||
},
|
||
"api.refreshModelRegistryRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"ref": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.reportAlertEntry": {
|
||
"type": "object",
|
||
"required": [
|
||
"severity",
|
||
"title",
|
||
"type"
|
||
],
|
||
"properties": {
|
||
"fingerprint": {
|
||
"type": "string"
|
||
},
|
||
"message": {
|
||
"type": "string"
|
||
},
|
||
"metadata": {
|
||
"type": "string"
|
||
},
|
||
"related_id": {
|
||
"type": "integer"
|
||
},
|
||
"related_name": {
|
||
"type": "string"
|
||
},
|
||
"related_type": {
|
||
"type": "string"
|
||
},
|
||
"severity": {
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"api.reportAlertsRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"alerts"
|
||
],
|
||
"properties": {
|
||
"alerts": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.reportAlertEntry"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.reportAlertsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"accepted": {
|
||
"type": "integer"
|
||
},
|
||
"deduplicated": {
|
||
"type": "integer"
|
||
},
|
||
"errors": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"api.statsFlushEntry": {
|
||
"type": "object",
|
||
"properties": {
|
||
"last_accessed_at": {
|
||
"type": "integer"
|
||
},
|
||
"requests": {
|
||
"type": "integer"
|
||
},
|
||
"token_hash": {
|
||
"type": "string"
|
||
},
|
||
"tokens": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"api.statsFlushRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"keys": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/api.statsFlushEntry"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"dto.APIKeyDTO": {
|
||
"description": "API key create/update request",
|
||
"type": "object",
|
||
"properties": {
|
||
"access_token": {
|
||
"type": "string"
|
||
},
|
||
"account_id": {
|
||
"type": "string"
|
||
},
|
||
"api_key": {
|
||
"type": "string",
|
||
"example": "sk-xxx..."
|
||
},
|
||
"auto_ban": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"ban_reason": {
|
||
"type": "string"
|
||
},
|
||
"ban_until": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "string"
|
||
},
|
||
"group_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"project_id": {
|
||
"type": "string"
|
||
},
|
||
"refresh_token": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"weight": {
|
||
"type": "integer",
|
||
"example": 1
|
||
}
|
||
}
|
||
},
|
||
"dto.APIKeyResponse": {
|
||
"description": "API key response",
|
||
"type": "object",
|
||
"properties": {
|
||
"access_token": {
|
||
"type": "string"
|
||
},
|
||
"account_id": {
|
||
"type": "string"
|
||
},
|
||
"api_key": {
|
||
"type": "string",
|
||
"example": "sk-xxx..."
|
||
},
|
||
"auto_ban": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"ban_reason": {
|
||
"type": "string"
|
||
},
|
||
"ban_until": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"expires_at": {
|
||
"type": "string"
|
||
},
|
||
"failure_rate": {
|
||
"type": "number",
|
||
"example": 0.05
|
||
},
|
||
"failure_requests": {
|
||
"type": "integer",
|
||
"example": 50
|
||
},
|
||
"group_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"project_id": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"success_rate": {
|
||
"type": "number",
|
||
"example": 0.95
|
||
},
|
||
"success_requests": {
|
||
"type": "integer",
|
||
"example": 950
|
||
},
|
||
"total_requests": {
|
||
"type": "integer",
|
||
"example": 1000
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"weight": {
|
||
"type": "integer",
|
||
"example": 1
|
||
}
|
||
}
|
||
},
|
||
"dto.BindingDTO": {
|
||
"description": "Binding create/update request",
|
||
"type": "object",
|
||
"properties": {
|
||
"group_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"namespace": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"public_model": {
|
||
"type": "string",
|
||
"example": "gpt-4"
|
||
},
|
||
"selector_type": {
|
||
"type": "string",
|
||
"example": "exact"
|
||
},
|
||
"selector_value": {
|
||
"type": "string",
|
||
"example": "gpt-4-turbo"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"weight": {
|
||
"type": "integer",
|
||
"example": 1
|
||
}
|
||
}
|
||
},
|
||
"dto.BindingResponse": {
|
||
"description": "Binding response",
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"group_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"namespace": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"public_model": {
|
||
"type": "string",
|
||
"example": "gpt-4"
|
||
},
|
||
"selector_type": {
|
||
"type": "string",
|
||
"example": "exact"
|
||
},
|
||
"selector_value": {
|
||
"type": "string",
|
||
"example": "gpt-4-turbo"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"weight": {
|
||
"type": "integer",
|
||
"example": 1
|
||
}
|
||
}
|
||
},
|
||
"dto.DeleteResponse": {
|
||
"description": "Delete operation response",
|
||
"type": "object",
|
||
"properties": {
|
||
"status": {
|
||
"type": "string",
|
||
"example": "deleted"
|
||
}
|
||
}
|
||
},
|
||
"dto.LogRecordRequest": {
|
||
"description": "Log record ingest request",
|
||
"type": "object",
|
||
"properties": {
|
||
"audit_reason": {
|
||
"type": "string"
|
||
},
|
||
"client_ip": {
|
||
"type": "string",
|
||
"example": "192.168.1.1"
|
||
},
|
||
"error_message": {
|
||
"type": "string"
|
||
},
|
||
"group": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"key_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"latency_ms": {
|
||
"type": "integer",
|
||
"example": 150
|
||
},
|
||
"master_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"model": {
|
||
"type": "string",
|
||
"example": "gpt-4"
|
||
},
|
||
"provider_id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"provider_name": {
|
||
"type": "string",
|
||
"example": "openai-prod"
|
||
},
|
||
"provider_type": {
|
||
"type": "string",
|
||
"example": "openai"
|
||
},
|
||
"request_body": {
|
||
"type": "string"
|
||
},
|
||
"request_size": {
|
||
"type": "integer",
|
||
"example": 1024
|
||
},
|
||
"response_body": {
|
||
"type": "string"
|
||
},
|
||
"response_size": {
|
||
"type": "integer",
|
||
"example": 2048
|
||
},
|
||
"status_code": {
|
||
"type": "integer",
|
||
"example": 200
|
||
},
|
||
"tokens_in": {
|
||
"type": "integer",
|
||
"example": 100
|
||
},
|
||
"tokens_out": {
|
||
"type": "integer",
|
||
"example": 50
|
||
}
|
||
}
|
||
},
|
||
"dto.LogWebhookConfigResponse": {
|
||
"description": "Log webhook configuration response",
|
||
"type": "object",
|
||
"properties": {
|
||
"cooldown_seconds": {
|
||
"type": "integer",
|
||
"example": 300
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"secret": {
|
||
"type": "string",
|
||
"example": "webhook-secret-key"
|
||
},
|
||
"status_code_threshold": {
|
||
"type": "integer",
|
||
"example": 500
|
||
},
|
||
"threshold": {
|
||
"type": "integer",
|
||
"example": 10
|
||
},
|
||
"url": {
|
||
"type": "string",
|
||
"example": "https://webhook.example.com/alerts"
|
||
},
|
||
"window_seconds": {
|
||
"type": "integer",
|
||
"example": 60
|
||
}
|
||
}
|
||
},
|
||
"dto.ModelCacheFile": {
|
||
"description": "Cached model registry file",
|
||
"type": "object",
|
||
"properties": {
|
||
"timestamp": {
|
||
"type": "integer"
|
||
},
|
||
"version": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"dto.ModelDTO": {
|
||
"description": "Model create/update request",
|
||
"type": "object",
|
||
"properties": {
|
||
"context_window": {
|
||
"type": "integer",
|
||
"example": 128000
|
||
},
|
||
"cost_per_token": {
|
||
"type": "number",
|
||
"example": 0.00003
|
||
},
|
||
"kind": {
|
||
"type": "string",
|
||
"example": "chat"
|
||
},
|
||
"max_output_tokens": {
|
||
"type": "integer",
|
||
"example": 4096
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "gpt-4"
|
||
},
|
||
"supports_fim": {
|
||
"type": "boolean",
|
||
"example": false
|
||
},
|
||
"supports_functions": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"supports_tool_choice": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"supports_vision": {
|
||
"type": "boolean",
|
||
"example": true
|
||
}
|
||
}
|
||
},
|
||
"dto.ModelRegistryCheckResponse": {
|
||
"description": "Model registry check result",
|
||
"type": "object",
|
||
"properties": {
|
||
"current_upstream_ref": {
|
||
"type": "string",
|
||
"example": "main"
|
||
},
|
||
"current_version": {
|
||
"type": "string",
|
||
"example": "abc123"
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"latest_version": {
|
||
"type": "string",
|
||
"example": "def456"
|
||
},
|
||
"needs_refresh": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"upstream_ref": {
|
||
"type": "string",
|
||
"example": "main"
|
||
}
|
||
}
|
||
},
|
||
"dto.ModelRegistryStatusResponse": {
|
||
"description": "Model registry status response",
|
||
"type": "object",
|
||
"properties": {
|
||
"cache_current": {
|
||
"$ref": "#/definitions/dto.ModelCacheFile"
|
||
},
|
||
"cache_prev": {
|
||
"$ref": "#/definitions/dto.ModelCacheFile"
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"last_error": {
|
||
"type": "string"
|
||
},
|
||
"last_refresh_at": {
|
||
"type": "integer",
|
||
"example": 1704067200
|
||
},
|
||
"models_dev_ref": {
|
||
"type": "string",
|
||
"example": "main"
|
||
},
|
||
"models_dev_url": {
|
||
"type": "string",
|
||
"example": "https://models.dev/v1/models.json"
|
||
},
|
||
"redis_meta": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"dto.ModelResponse": {
|
||
"description": "Model response",
|
||
"type": "object",
|
||
"properties": {
|
||
"context_window": {
|
||
"type": "integer",
|
||
"example": 128000
|
||
},
|
||
"cost_per_token": {
|
||
"type": "number",
|
||
"example": 0.00003
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"kind": {
|
||
"type": "string",
|
||
"example": "chat"
|
||
},
|
||
"max_output_tokens": {
|
||
"type": "integer",
|
||
"example": 4096
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "gpt-4"
|
||
},
|
||
"supports_fim": {
|
||
"type": "boolean",
|
||
"example": false
|
||
},
|
||
"supports_functions": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"supports_tool_choice": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"supports_vision": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"dto.NamespaceDTO": {
|
||
"description": "Namespace create/update request",
|
||
"type": "object",
|
||
"properties": {
|
||
"description": {
|
||
"type": "string",
|
||
"example": "Default namespace"
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
}
|
||
}
|
||
},
|
||
"dto.NamespaceResponse": {
|
||
"description": "Namespace response",
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"example": "Default namespace"
|
||
},
|
||
"id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "default"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"dto.ProviderGroupDTO": {
|
||
"description": "Provider group create/update request",
|
||
"type": "object",
|
||
"properties": {
|
||
"base_url": {
|
||
"type": "string",
|
||
"example": "https://api.openai.com"
|
||
},
|
||
"google_location": {
|
||
"type": "string"
|
||
},
|
||
"google_project": {
|
||
"type": "string"
|
||
},
|
||
"headers_profile": {
|
||
"type": "string"
|
||
},
|
||
"models": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"example": [
|
||
"gpt-4",
|
||
"gpt-3.5-turbo"
|
||
]
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "openai-prod"
|
||
},
|
||
"static_headers": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"example": "openai"
|
||
}
|
||
}
|
||
},
|
||
"dto.ProviderGroupResponse": {
|
||
"description": "Provider group response",
|
||
"type": "object",
|
||
"properties": {
|
||
"base_url": {
|
||
"type": "string",
|
||
"example": "https://api.openai.com"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"failure_rate": {
|
||
"type": "number",
|
||
"example": 0.05
|
||
},
|
||
"failure_requests": {
|
||
"type": "integer",
|
||
"example": 50
|
||
},
|
||
"google_location": {
|
||
"type": "string"
|
||
},
|
||
"google_project": {
|
||
"type": "string"
|
||
},
|
||
"headers_profile": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"models": {
|
||
"type": "string",
|
||
"example": "gpt-4,gpt-3.5-turbo"
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"example": "openai-prod"
|
||
},
|
||
"static_headers": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"example": "active"
|
||
},
|
||
"success_rate": {
|
||
"type": "number",
|
||
"example": 0.95
|
||
},
|
||
"success_requests": {
|
||
"type": "integer",
|
||
"example": 950
|
||
},
|
||
"total_requests": {
|
||
"type": "integer",
|
||
"example": 1000
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"example": "openai"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"dto.UpdateLogWebhookConfigRequest": {
|
||
"description": "Update log webhook configuration request",
|
||
"type": "object",
|
||
"properties": {
|
||
"cooldown_seconds": {
|
||
"type": "integer",
|
||
"example": 300
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"example": true
|
||
},
|
||
"secret": {
|
||
"type": "string",
|
||
"example": "webhook-secret-key"
|
||
},
|
||
"status_code_threshold": {
|
||
"type": "integer",
|
||
"example": 500
|
||
},
|
||
"threshold": {
|
||
"type": "integer",
|
||
"example": 10
|
||
},
|
||
"url": {
|
||
"type": "string",
|
||
"example": "https://webhook.example.com/alerts"
|
||
},
|
||
"window_seconds": {
|
||
"type": "integer",
|
||
"example": 60
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"securityDefinitions": {
|
||
"AdminAuth": {
|
||
"description": "Type \"Bearer\" followed by a space and the admin token. Example: Bearer admin123",
|
||
"type": "apiKey",
|
||
"name": "Authorization",
|
||
"in": "header"
|
||
},
|
||
"MasterAuth": {
|
||
"description": "Type \"Bearer\" followed by a space and the master key. Example: Bearer sk-xxx",
|
||
"type": "apiKey",
|
||
"name": "Authorization",
|
||
"in": "header"
|
||
}
|
||
}
|
||
} |