mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
docs(api): update swagger documentation for admin endpoints
Reflect recent API changes in Swagger documentation:
- Add endpoints for feature flag management (/admin/features)
- Add endpoint for issuing child keys to masters (/admin/masters/{id}/keys)
- Add endpoint for updating providers (/admin/providers/{id})
- Update provider model definitions with new fields (auto_ban, google_* attributes, status)
This commit is contained in:
@@ -18,6 +18,86 @@
|
||||
"host": "localhost:8080",
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/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": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/masters": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -69,6 +149,76 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/masters/{id}/keys": {
|
||||
"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/internal_api.IssueChildKeyRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/models": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -267,6 +417,70 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/providers/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"AdminAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Update provider attributes including status/auto-ban flags",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"admin"
|
||||
],
|
||||
"summary": "Update a provider",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Provider ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Provider Info",
|
||||
"name": "provider",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/github_com_ez-api_ez-api_internal_dto.ProviderDTO"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/github_com_ez-api_ez-api_internal_model.Provider"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/sync/snapshot": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -442,9 +656,24 @@
|
||||
"api_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"auto_ban": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ban_reason": {
|
||||
"type": "string"
|
||||
},
|
||||
"ban_until": {
|
||||
"type": "string"
|
||||
},
|
||||
"base_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"google_location": {
|
||||
"type": "string"
|
||||
},
|
||||
"google_project": {
|
||||
"type": "string"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -458,6 +687,13 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"skip_routing": {
|
||||
"description": "Optional control params",
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
@@ -571,6 +807,18 @@
|
||||
"api_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"auto_ban": {
|
||||
"description": "whether DP-triggered disable is allowed",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ban_reason": {
|
||||
"description": "reason for current disable",
|
||||
"type": "string"
|
||||
},
|
||||
"ban_until": {
|
||||
"description": "optional TTL for disable",
|
||||
"type": "string"
|
||||
},
|
||||
"base_url": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -580,6 +828,12 @@
|
||||
"deletedAt": {
|
||||
"$ref": "#/definitions/gorm.DeletedAt"
|
||||
},
|
||||
"google_location": {
|
||||
"type": "string"
|
||||
},
|
||||
"google_project": {
|
||||
"type": "string"
|
||||
},
|
||||
"group": {
|
||||
"description": "routing group/tier",
|
||||
"type": "string"
|
||||
@@ -594,6 +848,10 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "active, auto_disabled, manual_disabled",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "openai, anthropic, etc.",
|
||||
"type": "string"
|
||||
|
||||
Reference in New Issue
Block a user