Skip to content

Commit

Permalink
Merge pull request #2771 from actiontech/1956mvp3-api-definition-3
Browse files Browse the repository at this point in the history
api definition: add status to associated rollback workflow
  • Loading branch information
iwanghc authored Nov 22, 2024
2 parents 5868e4c + 668d8c9 commit b46a11a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
6 changes: 3 additions & 3 deletions sqle/api/controller/v1/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

type UpdateSqlBackupStrategyReq struct {
Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"`
Strategy string `json:"strategy" enums:"none,manual,reverse_sql,original_row"`
}

// UpdateSqlBackupStrategy
Expand All @@ -27,7 +27,7 @@ func UpdateSqlBackupStrategy(c echo.Context) error {
}

type UpdateTaskBackupStrategyReq struct {
Strategy string `json:"strategy" enums:"none,manual,reverse_sql,origin_row"`
Strategy string `json:"strategy" enums:"none,manual,reverse_sql,original_row"`
}

// UpdateTaskBackupStrategy
Expand Down Expand Up @@ -73,7 +73,7 @@ type BackupSqlData struct {
OriginSQL string `json:"origin_sql"`
OriginTaskId uint `json:"origin_task_id"`
BackupSqls []string `json:"backup_sqls"`
BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"`
BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,original_row"`
InstanceName string `json:"instance_name"`
InstanceId string `json:"instance_id"`
ExecStatus string `json:"exec_status"`
Expand Down
3 changes: 2 additions & 1 deletion sqle/api/controller/v2/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ type AuditTaskSQLResV2 struct {
RollbackSQLs []string `json:"rollback_sqls,omitempty"`
Description string `json:"description"`
SQLType string `json:"sql_type"`
BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,origin_row"`
BackupStrategy string `json:"backup_strategy" enums:"none,manual,reverse_sql,original_row"`
BackupStrategyTip string `json:"backup_strategy_tip"`
AssociatedRollbackWorkflows []*AssociatedRollbackWorkflow `json:"associated_rollback_workflows"`
}

type AssociatedRollbackWorkflow struct {
WorkflowID string `json:"workflow_id"`
WorkflowName string `json:"workflow_name"`
Status string `json:"status" enums:"wait_for_audit,wait_for_execution,rejected,canceled,exec_failed,executing,finished"`
}

type AuditResult struct {
Expand Down
20 changes: 16 additions & 4 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11797,7 +11797,7 @@ var doc = `{
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
},
"description": {
Expand Down Expand Up @@ -17595,7 +17595,7 @@ var doc = `{
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
}
}
Expand Down Expand Up @@ -17684,7 +17684,7 @@ var doc = `{
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
}
}
Expand Down Expand Up @@ -18513,6 +18513,18 @@ var doc = `{
"v2.AssociatedRollbackWorkflow": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"wait_for_audit",
"wait_for_execution",
"rejected",
"canceled",
"exec_failed",
"executing",
"finished"
]
},
"workflow_id": {
"type": "string"
},
Expand Down Expand Up @@ -18810,7 +18822,7 @@ var doc = `{
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
},
"backup_strategy_tip": {
Expand Down
20 changes: 16 additions & 4 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -11781,7 +11781,7 @@
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
},
"description": {
Expand Down Expand Up @@ -17579,7 +17579,7 @@
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
}
}
Expand Down Expand Up @@ -17668,7 +17668,7 @@
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
}
}
Expand Down Expand Up @@ -18497,6 +18497,18 @@
"v2.AssociatedRollbackWorkflow": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"wait_for_audit",
"wait_for_execution",
"rejected",
"canceled",
"exec_failed",
"executing",
"finished"
]
},
"workflow_id": {
"type": "string"
},
Expand Down Expand Up @@ -18794,7 +18806,7 @@
"none",
"manual",
"reverse_sql",
"origin_row"
"original_row"
]
},
"backup_strategy_tip": {
Expand Down
18 changes: 14 additions & 4 deletions sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ definitions:
- none
- manual
- reverse_sql
- origin_row
- original_row
type: string
description:
type: string
Expand Down Expand Up @@ -4452,7 +4452,7 @@ definitions:
- none
- manual
- reverse_sql
- origin_row
- original_row
type: string
type: object
v1.UpdateSqlFileOrderV1Req:
Expand Down Expand Up @@ -4512,7 +4512,7 @@ definitions:
- none
- manual
- reverse_sql
- origin_row
- original_row
type: string
type: object
v1.UpdateWechatConfigurationReqV1:
Expand Down Expand Up @@ -5080,6 +5080,16 @@ definitions:
type: object
v2.AssociatedRollbackWorkflow:
properties:
status:
enum:
- wait_for_audit
- wait_for_execution
- rejected
- canceled
- exec_failed
- executing
- finished
type: string
workflow_id:
type: string
workflow_name:
Expand Down Expand Up @@ -5287,7 +5297,7 @@ definitions:
- none
- manual
- reverse_sql
- origin_row
- original_row
type: string
backup_strategy_tip:
type: string
Expand Down

0 comments on commit b46a11a

Please sign in to comment.