mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
docs(swagger): update API documentation for log endpoints
Add new response types and parameters for logs API: - Add GroupedStatsItem and GroupedStatsResponse definitions - Add ListLogsResponse and LogView definitions for detailed log records - Add group_by enum parameter (model/day/month) to stats endpoint - Update endpoint descriptions to clarify response types and request_body inclusion - Update response schema references to use correct types
This commit is contained in:
@@ -855,7 +855,7 @@
|
||||
"AdminAuth": []
|
||||
}
|
||||
],
|
||||
"description": "List request logs with basic filtering/pagination",
|
||||
"description": "List request logs with basic filtering/pagination. Returns full log records including request_body.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -917,7 +917,7 @@
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_api.ListMasterLogsResponse"
|
||||
"$ref": "#/definitions/internal_api.ListLogsResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
@@ -985,7 +985,7 @@
|
||||
"AdminAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Aggregate log stats with basic filtering",
|
||||
"description": "Aggregate log stats with basic filtering. Use group_by param for grouped statistics (model/day/month). Without group_by returns LogStatsResponse; with group_by returns GroupedStatsResponse.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -1005,13 +1005,24 @@
|
||||
"description": "unix seconds",
|
||||
"name": "until",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"model",
|
||||
"day",
|
||||
"month"
|
||||
],
|
||||
"type": "string",
|
||||
"description": "group by dimension: model, day, month. Returns GroupedStatsResponse when specified.",
|
||||
"name": "group_by",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"description": "Grouped stats (when group_by is specified)",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_api.LogStatsResponse"
|
||||
"$ref": "#/definitions/internal_api.GroupedStatsResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
@@ -4169,6 +4180,46 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.GroupedStatsItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"avg_latency_ms": {
|
||||
"type": "number"
|
||||
},
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"date": {
|
||||
"description": "For group_by=day",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.GroupedStatsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/internal_api.GroupedStatsItem"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.IssueChildKeyRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4209,6 +4260,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.ListLogsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/internal_api.LogView"
|
||||
}
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.ListMasterLogsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4253,6 +4324,65 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_api.ManageMasterRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user