From f9f3673d0d1aabe9ea35f4dc3d9a6c199bc862b5 Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Thu, 14 Nov 2024 16:37:56 +0800 Subject: [PATCH 1/3] api definition: modify path of updating backup strategy for sql --- sqle/api/controller/v1/backup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqle/api/controller/v1/backup.go b/sqle/api/controller/v1/backup.go index 4bb6dd0b6..2217ca189 100644 --- a/sqle/api/controller/v1/backup.go +++ b/sqle/api/controller/v1/backup.go @@ -21,7 +21,7 @@ type UpdateSqlBackupStrategyReq struct { // @Param sql_id path string true "sql id" // @Param strategy body v1.UpdateSqlBackupStrategyReq true "update back up strategy for one sql in workflow" // @Success 200 {object} controller.BaseRes -// @router /v1/tasks/audits/{task_id}/sqls/{sql_id}/ [patch] +// @router /v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy [patch] func UpdateSqlBackupStrategy(c echo.Context) error { return nil } @@ -41,7 +41,7 @@ type UpdateTaskBackupStrategyReq struct { // @Param task_id path string true "task id" // @Param strategy body v1.UpdateTaskBackupStrategyReq true "update back up strategy for sqls in workflow" // @Success 200 {object} controller.BaseRes -// @router /v1/tasks/audits/{task_id}/ [patch] +// @router /v1/tasks/audits/{task_id}/backup_strategy [patch] func UpdateTaskBackupStrategy(c echo.Context) error { return nil } @@ -91,7 +91,7 @@ type BackupSqlListRes struct { // @Tags workflow // @Id GetBackupSqlListV1 // @Security ApiKeyAuth -// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed,terminating,terminate_succeeded,terminate_failed) +// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed,terminating,terminate_succeeded,terminate_failed,execute_rollback) // @Param project_name path string true "project name" // @Param workflow_id path string true "workflow id" // @Param filter_instance_id query uint false "filter: instance id in workflow" From 46acd3e4edd45f625126a379ef344b3b1cb29118 Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Thu, 14 Nov 2024 16:38:27 +0800 Subject: [PATCH 2/3] api definition: add new status for task to filter --- sqle/api/controller/v1/task.go | 2 +- sqle/api/controller/v2/task.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sqle/api/controller/v1/task.go b/sqle/api/controller/v1/task.go index afe32de62..fc697a1c1 100644 --- a/sqle/api/controller/v1/task.go +++ b/sqle/api/controller/v1/task.go @@ -501,7 +501,7 @@ type AuditTaskSQLResV1 struct { // @Id getAuditTaskSQLsV1 // @Security ApiKeyAuth // @Param task_id path string true "task id" -// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed) +// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed,execute_rollback) // @Param filter_audit_status query string false "filter: audit status of task sql" Enums(initialized,doing,finished) // @Param filter_audit_level query string false "filter: audit level of task sql" Enums(normal,notice,warn,error) // @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" diff --git a/sqle/api/controller/v2/task.go b/sqle/api/controller/v2/task.go index e0aff0422..547103e83 100644 --- a/sqle/api/controller/v2/task.go +++ b/sqle/api/controller/v2/task.go @@ -60,7 +60,7 @@ type AuditResult struct { // @Id getAuditTaskSQLsV2 // @Security ApiKeyAuth // @Param task_id path string true "task id" -// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed,terminating,terminate_succeeded,terminate_failed) +// @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed,manually_executed,terminating,terminate_succeeded,terminate_failed,execute_rollback) // @Param filter_audit_status query string false "filter: audit status of task sql" Enums(initialized,doing,finished) // @Param filter_audit_level query string false "filter: audit level of task sql" Enums(normal,notice,warn,error) // @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" From 798a038d885d2c772dcf84ca5af9916cedd541a1 Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Thu, 14 Nov 2024 16:38:34 +0800 Subject: [PATCH 3/3] docs: update swagger --- sqle/docs/docs.go | 15 ++++++++++----- sqle/docs/swagger.json | 15 ++++++++++----- sqle/docs/swagger.yaml | 6 +++++- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 2f2f9945f..dd1beffe1 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -7144,7 +7144,8 @@ var doc = `{ "manually_executed", "terminating", "terminate_succeeded", - "terminate_failed" + "terminate_failed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", @@ -9123,7 +9124,9 @@ var doc = `{ } } } - }, + } + }, + "/v1/tasks/audits/{task_id}/backup_strategy": { "patch": { "security": [ { @@ -9331,7 +9334,8 @@ var doc = `{ "doing", "succeeded", "failed", - "manually_executed" + "manually_executed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", @@ -9482,7 +9486,7 @@ var doc = `{ } } }, - "/v1/tasks/audits/{task_id}/sqls/{sql_id}/": { + "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { "patch": { "security": [ { @@ -10918,7 +10922,8 @@ var doc = `{ "manually_executed", "terminating", "terminate_succeeded", - "terminate_failed" + "terminate_failed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 0aa91f974..b73a2b0dd 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -7128,7 +7128,8 @@ "manually_executed", "terminating", "terminate_succeeded", - "terminate_failed" + "terminate_failed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", @@ -9107,7 +9108,9 @@ } } } - }, + } + }, + "/v1/tasks/audits/{task_id}/backup_strategy": { "patch": { "security": [ { @@ -9315,7 +9318,8 @@ "doing", "succeeded", "failed", - "manually_executed" + "manually_executed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", @@ -9466,7 +9470,7 @@ } } }, - "/v1/tasks/audits/{task_id}/sqls/{sql_id}/": { + "/v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy": { "patch": { "security": [ { @@ -10902,7 +10906,8 @@ "manually_executed", "terminating", "terminate_succeeded", - "terminate_failed" + "terminate_failed", + "execute_rollback" ], "type": "string", "description": "filter: exec status of task sql", diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index 6b8b34961..cccb8e5da 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -10459,6 +10459,7 @@ paths: - terminating - terminate_succeeded - terminate_failed + - execute_rollback in: query name: filter_exec_status type: string @@ -11869,6 +11870,7 @@ paths: summary: 获取Sql扫描任务信息 tags: - task + /v1/tasks/audits/{task_id}/backup_strategy: patch: consumes: - application/json @@ -12000,6 +12002,7 @@ paths: - succeeded - failed - manually_executed + - execute_rollback in: query name: filter_exec_status type: string @@ -12103,7 +12106,7 @@ paths: summary: 获取task相关的SQL执行计划和表元数据 tags: - task - /v1/tasks/audits/{task_id}/sqls/{sql_id}/: + /v1/tasks/audits/{task_id}/sqls/{sql_id}/backup_strategy: patch: consumes: - application/json @@ -13037,6 +13040,7 @@ paths: - terminating - terminate_succeeded - terminate_failed + - execute_rollback in: query name: filter_exec_status type: string