发布 0.1.0:通知渠道、告警规则、令牌版本与安全加固
CI / test (push) Successful in 30s
Release / release (push) Successful in 49s

This commit is contained in:
Wang Defa
2026-07-10 17:38:34 +08:00
parent 4af6a0ca92
commit dbba1f4905
78 changed files with 6898 additions and 551 deletions
+479 -4
View File
@@ -871,6 +871,30 @@ const docTemplate = `{
}
}
},
"/api/v1/auth/revoke-sessions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"认证"
],
"summary": "撤销全部会话",
"responses": {
"200": {
"description": "新 token 与 expiresAt",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/v1/auth/totp": {
"get": {
"security": [
@@ -1078,6 +1102,124 @@ const docTemplate = `{
}
}
},
"/api/v1/log-events/alert-rules": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "告警规则列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "创建告警规则",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/log-events/alert-rules/{ruleId}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "更新告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "删除告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/oci-configs": {
"get": {
"security": [
@@ -1205,6 +1347,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "删除租户配置及其本地关联任务、快照、回传、告警和 AI 渠道数据,并撤销 Webhook 密钥;不删除 OCI 云端资源。",
"tags": [
"租户配置"
],
@@ -1235,7 +1378,7 @@ const docTemplate = `{
"tags": [
"租户 IAM"
],
"summary": "实时查询租户 OCI 审计事件:hours 首查",
"summary": "批式懒加载查询租户 OCI 审计事件",
"parameters": [
{
"type": "integer",
@@ -1243,6 +1386,18 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "续查游标(上次响应原样带回)",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "单批目标条数,缺省 100,上限 200",
"name": "limit",
"in": "query"
}
],
"responses": {
@@ -1656,6 +1811,37 @@ const docTemplate = `{
}
}
},
"/api/v1/oci-configs/{id}/domains": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"租户 IAM"
],
"summary": "租户身份域列表",
"parameters": [
{
"type": "integer",
"description": "配置 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/oci-configs/{id}/identity-providers": {
"get": {
"security": [
@@ -1674,6 +1860,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1704,6 +1896,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -1744,6 +1942,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1778,6 +1982,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1824,6 +2034,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1854,6 +2070,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3015,6 +3237,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3045,6 +3273,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3084,6 +3318,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3116,6 +3356,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "policyId",
@@ -3231,6 +3477,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3478,6 +3730,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3518,6 +3776,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "ruleId",
@@ -3551,6 +3815,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3835,6 +4105,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3865,6 +4141,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -3905,6 +4187,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3941,6 +4229,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3986,6 +4280,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4058,6 +4358,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4096,6 +4402,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4749,6 +5061,95 @@ const docTemplate = `{
}
}
},
"/api/v1/settings/notify-channels": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "返回全部通知渠道的脱敏视图",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "保存单渠道配置并返回全渠道最新视图",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.updateNotifyChannelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}/test": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "向指定渠道发送测试消息",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/settings/notify-events": {
"get": {
"security": [
@@ -5403,6 +5804,38 @@ const docTemplate = `{
}
},
"definitions": {
"internal_api.alertRuleRequest": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"eventTypes": {
"type": "string"
},
"name": {
"type": "string"
},
"ociConfigId": {
"type": "integer"
},
"resourceMatch": {
"type": "string"
},
"sourceIpMode": {
"type": "string"
},
"sourceIps": {
"type": "string"
},
"threshold": {
"type": "integer"
},
"windowMinutes": {
"type": "integer"
}
}
},
"internal_api.attachBootVolumeRequest": {
"type": "object",
"required": [
@@ -5817,14 +6250,18 @@ const docTemplate = `{
],
"properties": {
"password": {
"type": "string"
"type": "string",
"maxLength": 128
},
"totpCode": {
"description": "两步验证码;账号已启用 TOTP 时必填,缺失返回 428",
"type": "string"
"type": "string",
"maxLength": 8
},
"username": {
"type": "string"
"description": "字段长度上限防超长输入撑爆登录守卫与 bcrypt(S-03)",
"type": "string",
"maxLength": 64
}
}
},
@@ -5891,6 +6328,44 @@ const docTemplate = `{
}
}
},
"internal_api.updateNotifyChannelRequest": {
"type": "object",
"properties": {
"bodyTemplate": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"from": {
"type": "string"
},
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"secret": {
"type": "string"
},
"server": {
"type": "string"
},
"to": {
"type": "string"
},
"topic": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"internal_api.updateSecurityListRequest": {
"type": "object",
"properties": {
+479 -4
View File
@@ -864,6 +864,30 @@
}
}
},
"/api/v1/auth/revoke-sessions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"认证"
],
"summary": "撤销全部会话",
"responses": {
"200": {
"description": "新 token 与 expiresAt",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/v1/auth/totp": {
"get": {
"security": [
@@ -1071,6 +1095,124 @@
}
}
},
"/api/v1/log-events/alert-rules": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "告警规则列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "创建告警规则",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/log-events/alert-rules/{ruleId}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "更新告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "删除告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/oci-configs": {
"get": {
"security": [
@@ -1198,6 +1340,7 @@
"BearerAuth": []
}
],
"description": "删除租户配置及其本地关联任务、快照、回传、告警和 AI 渠道数据,并撤销 Webhook 密钥;不删除 OCI 云端资源。",
"tags": [
"租户配置"
],
@@ -1228,7 +1371,7 @@
"tags": [
"租户 IAM"
],
"summary": "实时查询租户 OCI 审计事件:hours 首查",
"summary": "批式懒加载查询租户 OCI 审计事件",
"parameters": [
{
"type": "integer",
@@ -1236,6 +1379,18 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "续查游标(上次响应原样带回)",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "单批目标条数,缺省 100,上限 200",
"name": "limit",
"in": "query"
}
],
"responses": {
@@ -1649,6 +1804,37 @@
}
}
},
"/api/v1/oci-configs/{id}/domains": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"租户 IAM"
],
"summary": "租户身份域列表",
"parameters": [
{
"type": "integer",
"description": "配置 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/oci-configs/{id}/identity-providers": {
"get": {
"security": [
@@ -1667,6 +1853,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1697,6 +1889,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -1737,6 +1935,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1771,6 +1975,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1817,6 +2027,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1847,6 +2063,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3008,6 +3230,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3038,6 +3266,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3077,6 +3311,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3109,6 +3349,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "policyId",
@@ -3224,6 +3470,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3471,6 +3723,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3511,6 +3769,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "ruleId",
@@ -3544,6 +3808,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3828,6 +4098,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3858,6 +4134,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -3898,6 +4180,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3934,6 +4222,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3979,6 +4273,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4051,6 +4351,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4089,6 +4395,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4742,6 +5054,95 @@
}
}
},
"/api/v1/settings/notify-channels": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "返回全部通知渠道的脱敏视图",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "保存单渠道配置并返回全渠道最新视图",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.updateNotifyChannelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}/test": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "向指定渠道发送测试消息",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/settings/notify-events": {
"get": {
"security": [
@@ -5396,6 +5797,38 @@
}
},
"definitions": {
"internal_api.alertRuleRequest": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"eventTypes": {
"type": "string"
},
"name": {
"type": "string"
},
"ociConfigId": {
"type": "integer"
},
"resourceMatch": {
"type": "string"
},
"sourceIpMode": {
"type": "string"
},
"sourceIps": {
"type": "string"
},
"threshold": {
"type": "integer"
},
"windowMinutes": {
"type": "integer"
}
}
},
"internal_api.attachBootVolumeRequest": {
"type": "object",
"required": [
@@ -5810,14 +6243,18 @@
],
"properties": {
"password": {
"type": "string"
"type": "string",
"maxLength": 128
},
"totpCode": {
"description": "两步验证码;账号已启用 TOTP 时必填,缺失返回 428",
"type": "string"
"type": "string",
"maxLength": 8
},
"username": {
"type": "string"
"description": "字段长度上限防超长输入撑爆登录守卫与 bcrypt(S-03)",
"type": "string",
"maxLength": 64
}
}
},
@@ -5884,6 +6321,44 @@
}
}
},
"internal_api.updateNotifyChannelRequest": {
"type": "object",
"properties": {
"bodyTemplate": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"from": {
"type": "string"
},
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"secret": {
"type": "string"
},
"server": {
"type": "string"
},
"to": {
"type": "string"
},
"topic": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"internal_api.updateSecurityListRequest": {
"type": "object",
"properties": {
+303 -1
View File
@@ -1,5 +1,26 @@
basePath: /
definitions:
internal_api.alertRuleRequest:
properties:
enabled:
type: boolean
eventTypes:
type: string
name:
type: string
ociConfigId:
type: integer
resourceMatch:
type: string
sourceIpMode:
type: string
sourceIps:
type: string
threshold:
type: integer
windowMinutes:
type: integer
type: object
internal_api.attachBootVolumeRequest:
properties:
bootVolumeId:
@@ -277,11 +298,15 @@ definitions:
internal_api.loginRequest:
properties:
password:
maxLength: 128
type: string
totpCode:
description: 两步验证码;账号已启用 TOTP 时必填,缺失返回 428
maxLength: 8
type: string
username:
description: 字段长度上限防超长输入撑爆登录守卫与 bcrypt(S-03)
maxLength: 64
type: string
required:
- password
@@ -328,6 +353,31 @@ definitions:
description: 更换 shape,运行中实例会自动重启
type: string
type: object
internal_api.updateNotifyChannelRequest:
properties:
bodyTemplate:
type: string
enabled:
type: boolean
from:
type: string
host:
type: string
port:
type: integer
secret:
type: string
server:
type: string
to:
type: string
topic:
type: string
url:
type: string
username:
type: string
type: object
internal_api.updateSecurityListRequest:
properties:
displayName:
@@ -1078,6 +1128,20 @@ paths:
summary: 密码登录开关
tags:
- 认证
/api/v1/auth/revoke-sessions:
post:
responses:
"200":
description: 新 token 与 expiresAt
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: 撤销全部会话
tags:
- 认证
/api/v1/auth/totp:
get:
responses:
@@ -1203,6 +1267,78 @@ paths:
summary: 回传日志事件列表
tags:
- 任务与日志回传
/api/v1/log-events/alert-rules:
get:
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 告警规则列表
tags:
- 任务与日志回传
post:
parameters:
- description: 请求体
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_api.alertRuleRequest'
responses:
"201":
description: Created
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 创建告警规则
tags:
- 任务与日志回传
/api/v1/log-events/alert-rules/{ruleId}:
delete:
parameters:
- description: 规则 ID
in: path
name: ruleId
required: true
type: integer
responses:
"204":
description: 无内容
security:
- BearerAuth: []
summary: 删除告警规则
tags:
- 任务与日志回传
put:
parameters:
- description: 规则 ID
in: path
name: ruleId
required: true
type: integer
- description: 请求体
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_api.alertRuleRequest'
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 更新告警规则
tags:
- 任务与日志回传
/api/v1/oci-configs:
get:
responses:
@@ -1237,6 +1373,7 @@ paths:
- 租户配置
/api/v1/oci-configs/{id}:
delete:
description: 删除租户配置及其本地关联任务、快照、回传、告警和 AI 渠道数据,并撤销 Webhook 密钥;不删除 OCI 云端资源。
parameters:
- description: 配置 ID
in: path
@@ -1301,6 +1438,14 @@ paths:
name: id
required: true
type: integer
- description: 续查游标(上次响应原样带回)
in: query
name: cursor
type: string
- description: 单批目标条数,缺省 100,上限 200
in: query
name: limit
type: integer
responses:
"200":
description: OK
@@ -1309,7 +1454,7 @@ paths:
type: object
security:
- BearerAuth: []
summary: 实时查询租户 OCI 审计事件:hours 首查
summary: 批式懒加载查询租户 OCI 审计事件
tags:
- 租户 IAM
/api/v1/oci-configs/{id}/audit-events/detail:
@@ -1560,6 +1705,25 @@ paths:
summary: 配置成本快照
tags:
- 成本
/api/v1/oci-configs/{id}/domains:
get:
parameters:
- description: 配置 ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 租户身份域列表
tags:
- 租户 IAM
/api/v1/oci-configs/{id}/identity-providers:
get:
parameters:
@@ -1568,6 +1732,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -1586,6 +1754,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: 请求体
in: body
name: body
@@ -1611,6 +1783,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: idpId
in: path
name: idpId
@@ -1632,6 +1808,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: idpId
in: path
name: idpId
@@ -1662,6 +1842,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -1680,6 +1864,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: 请求体(见接口说明)
in: body
name: body
@@ -2412,6 +2600,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -2430,6 +2622,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: 请求体(见接口说明)
in: body
name: body
@@ -2455,6 +2651,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -2474,6 +2674,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: policyId
in: path
name: policyId
@@ -2547,6 +2751,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -2701,6 +2909,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: 请求体(见接口说明)
in: body
name: body
@@ -2726,6 +2938,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: ruleId
in: path
name: ruleId
@@ -2747,6 +2963,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -2925,6 +3145,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
responses:
"200":
description: OK
@@ -2943,6 +3167,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: 请求体
in: body
name: body
@@ -2968,6 +3196,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: userId
in: path
name: userId
@@ -2988,6 +3220,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: userId
in: path
name: userId
@@ -3011,6 +3247,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: userId
in: path
name: userId
@@ -3065,6 +3305,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: userId
in: path
name: userId
@@ -3089,6 +3333,10 @@ paths:
name: id
required: true
type: integer
- description: 身份域 OCID(缺省 Default 域)
in: query
name: domainId
type: string
- description: userId
in: path
name: userId
@@ -3498,6 +3746,60 @@ paths:
summary: 返回本地维护的完整区域表
tags:
- 租户配置
/api/v1/settings/notify-channels:
get:
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 返回全部通知渠道的脱敏视图
tags:
- 设置
/api/v1/settings/notify-channels/{type}:
put:
parameters:
- description: 渠道类型(webhook/ntfy/bark/smtp)
in: path
name: type
required: true
type: string
- description: 请求体
in: body
name: body
required: true
schema:
$ref: '#/definitions/internal_api.updateNotifyChannelRequest'
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 保存单渠道配置并返回全渠道最新视图
tags:
- 设置
/api/v1/settings/notify-channels/{type}/test:
post:
parameters:
- description: 渠道类型(webhook/ntfy/bark/smtp)
in: path
name: type
required: true
type: string
responses:
"204":
description: 无内容
security:
- BearerAuth: []
summary: 向指定渠道发送测试消息
tags:
- 设置
/api/v1/settings/notify-events:
get:
responses: