feat: scaffold TASK-WP6-01 admin operations
Dada P0-A isolated Windows CI / validate-and-package (push) Successful in 10m45s
Dada P0-A isolated Windows CI / validate-and-package (push) Successful in 10m45s
This commit is contained in:
@@ -363,6 +363,339 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AdminOverviewResponse": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"asset_cleanup": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"pending_jobs": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"pending_jobs"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"generated_at": {
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{3})?Z$",
|
||||
"type": "string"
|
||||
},
|
||||
"generation_jobs": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"pending_manual_review": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"pending_manual_review_oldest_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{3})?Z$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"queued": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"running": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"pending_manual_review",
|
||||
"pending_manual_review_oldest_at",
|
||||
"queued",
|
||||
"running"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"models": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"configured_default_model_id": {
|
||||
"anyOf": [
|
||||
{
|
||||
"maxLength": 80,
|
||||
"pattern": "^[a-z0-9][a-z0-9.-]+$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configured_model_count": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"recommended_model_id": {
|
||||
"anyOf": [
|
||||
{
|
||||
"maxLength": 80,
|
||||
"pattern": "^[a-z0-9][a-z0-9.-]+$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"runtime_available_count": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"configured_default_model_id",
|
||||
"configured_model_count",
|
||||
"recommended_model_id",
|
||||
"runtime_available_count"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"recent_operations": {
|
||||
"items": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{3})?Z$",
|
||||
"type": "string"
|
||||
},
|
||||
"operation_id": {
|
||||
"pattern": "^[0-9a-fA-F-]{36}$",
|
||||
"type": "string"
|
||||
},
|
||||
"operation_type": {
|
||||
"maxLength": 80,
|
||||
"pattern": "^[a-z][a-z0-9_]+$",
|
||||
"type": "string"
|
||||
},
|
||||
"result": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"succeeded"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"rejected"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"target_ref": {
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9:._-]{0,159}$",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"created_at",
|
||||
"operation_id",
|
||||
"operation_type",
|
||||
"result",
|
||||
"target_ref"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"maxItems": 10,
|
||||
"type": "array"
|
||||
},
|
||||
"services": {
|
||||
"items": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"checked_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{3})?Z$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"service_id": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"resend"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"amap"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"ai_gateway"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"worker"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"asset_root"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"available"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"degraded"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"paused"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"unavailable"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"checked_at",
|
||||
"service_id",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"type": "array"
|
||||
},
|
||||
"storage": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"last_measured_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{3})?Z$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"limit_bytes": {
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"managed_content_bytes": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"status": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"normal"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"critical"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"full"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"unavailable"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"last_measured_at",
|
||||
"limit_bytes",
|
||||
"managed_content_bytes",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"user_slots": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"active_and_suspended": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"limit": {
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"active_and_suspended",
|
||||
"limit"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"generated_at",
|
||||
"user_slots",
|
||||
"generation_jobs",
|
||||
"models",
|
||||
"storage",
|
||||
"services",
|
||||
"recent_operations",
|
||||
"asset_cleanup"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AdminSessionResponse": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
@@ -7965,6 +8298,39 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/admin/overview": {
|
||||
"get": {
|
||||
"operationId": "getAdminOverview",
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AdminOverviewResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Default Response"
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorEnvelope"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Default Response"
|
||||
},
|
||||
"503": {
|
||||
"description": "Default Response"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"Admin Operations"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/admin/users/{userId}/credit-adjustments": {
|
||||
"post": {
|
||||
"operationId": "adjustAdminUserCredits",
|
||||
|
||||
Reference in New Issue
Block a user