docs(api): add alerts report endpoint and apikey-stats query params

- Add internal /internal/alerts/report POST endpoint documentation
- Add reportAlertEntry, reportAlertsRequest, reportAlertsResponse schemas
- Add since/until query parameters to /admin/apikey-stats/summary endpoint
This commit is contained in:
zenfun
2025-12-31 14:18:42 +08:00
parent bfba16bbd4
commit 57797f38cb
3 changed files with 340 additions and 0 deletions

View File

@@ -1164,6 +1164,51 @@ definitions:
ref:
type: string
type: object
internal_api.reportAlertEntry:
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
required:
- severity
- title
- type
type: object
internal_api.reportAlertsRequest:
properties:
alerts:
items:
$ref: '#/definitions/internal_api.reportAlertEntry'
type: array
required:
- alerts
type: object
internal_api.reportAlertsResponse:
properties:
accepted:
type: integer
deduplicated:
type: integer
errors:
items:
type: string
type: array
type: object
internal_api.statsFlushEntry:
properties:
last_accessed_at:
@@ -1681,6 +1726,15 @@ paths:
/admin/apikey-stats/summary:
get:
description: Aggregate APIKey success/failure stats across all provider groups
parameters:
- description: Start time (unix seconds)
in: query
name: since
type: integer
- description: End time (unix seconds)
in: query
name: until
type: integer
produces:
- application/json
responses:
@@ -3386,6 +3440,36 @@ paths:
summary: Get current identity
tags:
- auth
/internal/alerts/report:
post:
consumes:
- application/json
description: Internal endpoint for Data Plane to report alerts to Control Plane
parameters:
- description: Alerts to report
in: body
name: request
required: true
schema:
$ref: '#/definitions/internal_api.reportAlertsRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/internal_api.reportAlertsResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/gin.H'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/gin.H'
summary: Report alerts from DP
tags:
- internal
/internal/apikey-stats/flush:
post:
consumes: