Skip to content

Commit e9bebcd

Browse files
committed
README.md, api: rest: Fix TyNum to TryNum
1 parent 8583d0e commit e9bebcd

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ Add trigger_email task component at the bottom of the workflow to receive email
441441
![image](https://github.com/user-attachments/assets/d893cc1a-2cbd-417c-a19d-a650aaca7f6e)
442442

443443
### 3. GET execution task log
444-
[GET] /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs
444+
[GET] /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs
445445
![image](https://github.com/user-attachments/assets/347babf5-df32-4fe0-82e0-f0e111c333d1)
446446

447447

pkg/api/rest/controller/workflow.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,11 @@ func GetTaskDirectly(c echo.Context) error {
980980
// @Param wfId path string true "ID of the workflow."
981981
// @Param wfRunId path string true "ID of the workflowRunId."
982982
// @Param taskId path string true "ID of the task."
983-
// @Param taskTyNum path string true "ID of the taskTryNum."
983+
// @Param taskTryNum path string true "ID of the taskTryNum."
984984
// @Success 200 {object} airflow.InlineResponse200 "Successfully get the task Logs."
985985
// @Failure 400 {object} common.ErrorResponse "Sent bad request."
986986
// @Failure 500 {object} common.ErrorResponse "Failed to get the task Logs."
987-
// @Router /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs [get]
987+
// @Router /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs [get]
988988
func GetTaskLogs(c echo.Context) error {
989989
wfId := c.Param("wfId")
990990
if wfId == "" {
@@ -1004,19 +1004,19 @@ func GetTaskLogs(c echo.Context) error {
10041004
return common.ReturnErrorMsg(c, "Invalid get tasK from taskId.")
10051005
}
10061006

1007-
taskTyNum := c.Param("taskTyNum")
1008-
if taskTyNum == "" {
1009-
return common.ReturnErrorMsg(c, "Please provide the taskTyNum.")
1007+
taskTryNum := c.Param("taskTryNum")
1008+
if taskTryNum == "" {
1009+
return common.ReturnErrorMsg(c, "Please provide the taskTryNum.")
10101010
}
1011-
taskTyNumToInt, err := strconv.Atoi(taskTyNum)
1011+
taskTryNumToInt, err := strconv.Atoi(taskTryNum)
10121012
if err != nil {
10131013
return common.ReturnErrorMsg(c, "Invalid taskTryNum format.")
10141014
}
10151015
client, err := airflow.GetClient()
10161016
if err != nil {
10171017
return common.ReturnErrorMsg(c, err.Error())
10181018
}
1019-
logs, err := client.GetTaskLogs(wfId, common.UrlDecode(wfRunId), taskInfo.Name, taskTyNumToInt)
1019+
logs, err := client.GetTaskLogs(wfId, common.UrlDecode(wfRunId), taskInfo.Name, taskTryNumToInt)
10201020
if err != nil {
10211021
return common.ReturnErrorMsg(c, "Failed to get the workflow logs: "+err.Error())
10221022
}
@@ -1460,11 +1460,11 @@ func GetWorkflowVersion(c echo.Context) error {
14601460
// @Param wfId path string true "ID of the workflow."
14611461
// @Param wfRunId path string true "ID of the workflowRunId."
14621462
// @Param taskId path string true "ID of the task."
1463-
// @Param taskTyNum path string true "ID of the taskTryNum."
1463+
// @Param taskTryNum path string true "ID of the taskTryNum."
14641464
// @Success 200 {file} file "Log file downloaded successfully."
14651465
// @Failure 400 {object} common.ErrorResponse "Sent bad request."
14661466
// @Failure 500 {object} common.ErrorResponse "Failed to get the task Logs."
1467-
// @Router /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs/download [get]
1467+
// @Router /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs/download [get]
14681468
func GetTaskLogDownload(c echo.Context) error {
14691469
wfId := c.Param("wfId")
14701470
if wfId == "" {
@@ -1484,19 +1484,19 @@ func GetTaskLogDownload(c echo.Context) error {
14841484
return common.ReturnErrorMsg(c, "Invalid get tasK from taskId.")
14851485
}
14861486

1487-
taskTyNum := c.Param("taskTyNum")
1488-
if taskTyNum == "" {
1489-
return common.ReturnErrorMsg(c, "Please provide the taskTyNum.")
1487+
taskTryNum := c.Param("taskTryNum")
1488+
if taskTryNum == "" {
1489+
return common.ReturnErrorMsg(c, "Please provide the taskTryNum.")
14901490
}
1491-
taskTyNumToInt, err := strconv.Atoi(taskTyNum)
1491+
taskTryNumToInt, err := strconv.Atoi(taskTryNum)
14921492
if err != nil {
14931493
return common.ReturnErrorMsg(c, "Invalid taskTryNum format.")
14941494
}
14951495
client, err := airflow.GetClient()
14961496
if err != nil {
14971497
return common.ReturnErrorMsg(c, err.Error())
14981498
}
1499-
logs, err := client.GetTaskLogs(wfId, common.UrlDecode(wfRunId), taskInfo.Name, taskTyNumToInt)
1499+
logs, err := client.GetTaskLogs(wfId, common.UrlDecode(wfRunId), taskInfo.Name, taskTryNumToInt)
15001500
if err != nil {
15011501
return common.ReturnErrorMsg(c, "Failed to get the workflow logs: "+err.Error())
15021502
}

pkg/api/rest/docs/docs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ const docTemplate = `{
15291529
}
15301530
}
15311531
},
1532-
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs": {
1532+
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs": {
15331533
"get": {
15341534
"description": "Get the task Logs.",
15351535
"consumes": [
@@ -1568,7 +1568,7 @@ const docTemplate = `{
15681568
{
15691569
"type": "string",
15701570
"description": "ID of the taskTryNum.",
1571-
"name": "taskTyNum",
1571+
"name": "taskTryNum",
15721572
"in": "path",
15731573
"required": true
15741574
}
@@ -1595,7 +1595,7 @@ const docTemplate = `{
15951595
}
15961596
}
15971597
},
1598-
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs/download": {
1598+
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs/download": {
15991599
"get": {
16001600
"description": "Download the task logs as a file.",
16011601
"consumes": [
@@ -1634,7 +1634,7 @@ const docTemplate = `{
16341634
{
16351635
"type": "string",
16361636
"description": "ID of the taskTryNum.",
1637-
"name": "taskTyNum",
1637+
"name": "taskTryNum",
16381638
"in": "path",
16391639
"required": true
16401640
}

pkg/api/rest/docs/swagger.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@
15221522
}
15231523
}
15241524
},
1525-
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs": {
1525+
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs": {
15261526
"get": {
15271527
"description": "Get the task Logs.",
15281528
"consumes": [
@@ -1561,7 +1561,7 @@
15611561
{
15621562
"type": "string",
15631563
"description": "ID of the taskTryNum.",
1564-
"name": "taskTyNum",
1564+
"name": "taskTryNum",
15651565
"in": "path",
15661566
"required": true
15671567
}
@@ -1588,7 +1588,7 @@
15881588
}
15891589
}
15901590
},
1591-
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs/download": {
1591+
"/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs/download": {
15921592
"get": {
15931593
"description": "Download the task logs as a file.",
15941594
"consumes": [
@@ -1627,7 +1627,7 @@
16271627
{
16281628
"type": "string",
16291629
"description": "ID of the taskTryNum.",
1630-
"name": "taskTyNum",
1630+
"name": "taskTryNum",
16311631
"in": "path",
16321632
"required": true
16331633
}

pkg/api/rest/docs/swagger.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ paths:
15061506
summary: Clear taskInstances
15071507
tags:
15081508
- '[Workflow]'
1509-
/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs:
1509+
/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs:
15101510
get:
15111511
consumes:
15121512
- application/json
@@ -1530,7 +1530,7 @@ paths:
15301530
type: string
15311531
- description: ID of the taskTryNum.
15321532
in: path
1533-
name: taskTyNum
1533+
name: taskTryNum
15341534
required: true
15351535
type: string
15361536
produces:
@@ -1551,7 +1551,7 @@ paths:
15511551
summary: Get Task Logs
15521552
tags:
15531553
- '[Workflow]'
1554-
/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs/download:
1554+
/workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTryNum}/logs/download:
15551555
get:
15561556
consumes:
15571557
- application/json
@@ -1575,7 +1575,7 @@ paths:
15751575
type: string
15761576
- description: ID of the taskTryNum.
15771577
in: path
1578-
name: taskTyNum
1578+
name: taskTryNum
15791579
required: true
15801580
type: string
15811581
produces:

pkg/api/rest/route/workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func Workflow(e *echo.Echo) {
2828

2929
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/task_group/:tgId", controller.GetTaskGroupDirectly)
3030
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/task/:taskId", controller.GetTaskDirectly)
31-
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/task/:taskId/taskTryNum/:taskTyNum/logs", controller.GetTaskLogs)
32-
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/task/:taskId/taskTryNum/:taskTyNum/logs/download", controller.GetTaskLogDownload)
31+
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/task/:taskId/taskTryNum/:taskTryNum/logs", controller.GetTaskLogs)
32+
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/task/:taskId/taskTryNum/:taskTryNum/logs/download", controller.GetTaskLogDownload)
3333
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/runs", controller.GetWorkflowRuns)
3434
e.GET("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/taskInstances", controller.GetTaskInstances)
3535
e.POST("/"+strings.ToLower(common.ShortModuleName)+"/workflow/:wfId/workflowRun/:wfRunId/range", controller.ClearTaskInstances)

0 commit comments

Comments
 (0)