mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-23 04:38:17 +00:00
a8163b6e48
This commit changes how the various http endpoints are registered; previously we had to define the handler function in one place, then in another, explicitly register that handler with a path and operation type with the router. If we wanted to also export documentation about that method, we would need to annotate the handler with a duplicate of the path and method type. There was a decent amount of boiler plate and it was very easy to omit some of that registration information, or for it to potentially drift or be mistranscribed. This commit eliminates most of the boiler plate; now we require that every endpoint be annotated with the utoipa::path macro, which centralizes the handler, path and method type definition in one place. To register the route and docs we now have a much simpler `router_and_docs!` macro that can register both the with the axum router and with the openapi docs machinery.
180 lines
4.6 KiB
JSON
180 lines
4.6 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "tsa-daemon",
|
|
"description": "",
|
|
"license": {
|
|
"name": "Apache-2.0"
|
|
},
|
|
"version": "2026.01.31-3793b4de"
|
|
},
|
|
"paths": {
|
|
"/api/admin/bump-config-epoch": {
|
|
"post": {
|
|
"tags": [
|
|
"config"
|
|
],
|
|
"summary": "Allows the system operator to trigger a configuration epoch bump,\nwhich causes various configs that are using the Epoch strategy to\nbe re-evaluated by triggering the appropriate callbacks.",
|
|
"operationId": "bump_config_epoch",
|
|
"responses": {
|
|
"200": {
|
|
"description": "bump successful"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/admin/memory/stats": {
|
|
"get": {
|
|
"tags": [
|
|
"memory"
|
|
],
|
|
"summary": "Returns information about the system memory usage in an unstructured\nhuman readable format. The output is not machine parseable and may\nchange without notice between versions of kumomta.",
|
|
"operationId": "memory_stats",
|
|
"responses": {
|
|
"200": {
|
|
"description": "stats were returned"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/admin/set_diagnostic_log_filter/v1": {
|
|
"post": {
|
|
"tags": [
|
|
"logging"
|
|
],
|
|
"summary": "Changes the diagnostic log filter dynamically.\nSee <https://docs.kumomta.com/reference/kumo/set_diagnostic_log_filter/>\nfor more information on diagnostic log filters.",
|
|
"operationId": "set_diagnostic_log_filter_v1",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SetDiagnosticFilterRequest"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Diagnostic level set successfully"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/get_bounce_v1/bounced.json": {
|
|
"get": {
|
|
"tags": [],
|
|
"operationId": "get_bounce_v1",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/get_config_v1/shaping.toml": {
|
|
"get": {
|
|
"tags": [],
|
|
"operationId": "get_config_v1",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/get_suspension_v1/suspended.json": {
|
|
"get": {
|
|
"tags": [],
|
|
"operationId": "get_suspension_v1",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/metrics": {
|
|
"get": {
|
|
"tags": [],
|
|
"summary": "Returns the current set of metrics in Prometheus Exposition format",
|
|
"operationId": "report_metrics",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"text/plain": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/metrics.json": {
|
|
"get": {
|
|
"tags": [],
|
|
"summary": "Returns the current set of metrics in a json representation.\nThis is easier to consume than the Prometheus Exposition format, but\nis more resource intensive to produce and parse when the number of\nmetrics is large, such as for a busy server.",
|
|
"operationId": "report_metrics_json",
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/publish_log_v1": {
|
|
"post": {
|
|
"tags": [],
|
|
"operationId": "publish_log_v1",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"default": null
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/subscribe_event_v1": {
|
|
"get": {
|
|
"tags": [],
|
|
"operationId": "subscribe_event_v1",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/subscribe_suspension_v1": {
|
|
"get": {
|
|
"tags": [],
|
|
"summary": "This is a legacy endpoint that can only report on the old SuspensionEntry\nenum variants",
|
|
"operationId": "subscribe_suspension_v1",
|
|
"responses": {},
|
|
"deprecated": true
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"SetDiagnosticFilterRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"filter"
|
|
],
|
|
"properties": {
|
|
"filter": {
|
|
"type": "string",
|
|
"description": "The diagnostic filter spec to use",
|
|
"example": "kumod=trace"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securitySchemes": {
|
|
"basic_auth": {
|
|
"type": "http",
|
|
"scheme": "basic"
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"basic_auth": [
|
|
""
|
|
]
|
|
}
|
|
]
|
|
}
|