Skip to content

Commit 75972ca

Browse files
committed
support diagnosis job
1 parent 25ab378 commit 75972ca

File tree

9 files changed

+296
-16
lines changed

9 files changed

+296
-16
lines changed

api/docs/docs.go

+41-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
1+
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
22
// This file was generated by swaggo/swag
3-
43
package docs
54

65
import (
76
"bytes"
87
"encoding/json"
98
"strings"
9+
"text/template"
1010

11-
"github.com/alecthomas/template"
1211
"github.com/swaggo/swag"
1312
)
1413

1514
var doc = `{
1615
"schemes": {{ marshal .Schemes }},
1716
"swagger": "2.0",
1817
"info": {
19-
"description": "{{.Description}}",
18+
"description": "{{escape .Description}}",
2019
"title": "{{.Title}}",
2120
"contact": {},
2221
"version": "{{.Version}}"
@@ -263,6 +262,33 @@ var doc = `{
263262
}
264263
}
265264
},
265+
"/v2/job/diagnosis": {
266+
"get": {
267+
"security": [
268+
{
269+
"ApiKeyAuth": []
270+
}
271+
],
272+
"description": "diagnosis job.",
273+
"tags": [
274+
"job"
275+
],
276+
"operationId": "DiagnosisJobV2",
277+
"parameters": [
278+
{
279+
"type": "string",
280+
"description": "job id",
281+
"name": "job_id",
282+
"in": "formData"
283+
}
284+
],
285+
"responses": {
286+
"200": {
287+
"description": ""
288+
}
289+
}
290+
}
291+
},
266292
"/v2/job/migration/create": {
267293
"post": {
268294
"security": [
@@ -3017,15 +3043,15 @@ var doc = `{
30173043
"bulk_insert2": {
30183044
"type": "integer"
30193045
},
3020-
"retry_tx_limit": {
3021-
"type": "integer"
3022-
},
30233046
"dependency_history_size": {
30243047
"type": "integer"
30253048
},
30263049
"parallel_workers": {
30273050
"type": "integer"
30283051
},
3052+
"retry_tx_limit": {
3053+
"type": "integer"
3054+
},
30293055
"set_gtid_next": {
30303056
"type": "boolean"
30313057
},
@@ -3807,6 +3833,13 @@ func (s *s) ReadDoc() string {
38073833
a, _ := json.Marshal(v)
38083834
return string(a)
38093835
},
3836+
"escape": func(v interface{}) string {
3837+
// escape tabs
3838+
str := strings.Replace(v.(string), "\t", "\\t", -1)
3839+
// replace " with \", and if that results in \\", replace that with \\\"
3840+
str = strings.Replace(str, "\"", "\\\"", -1)
3841+
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
3842+
},
38103843
}).Parse(doc)
38113844
if err != nil {
38123845
return doc
@@ -3821,5 +3854,5 @@ func (s *s) ReadDoc() string {
38213854
}
38223855

38233856
func init() {
3824-
swag.Register(swag.Name, &s{})
3857+
swag.Register("swagger", &s{})
38253858
}

api/docs/swagger.json

+31-4
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,33 @@
247247
}
248248
}
249249
},
250+
"/v2/job/diagnosis": {
251+
"get": {
252+
"security": [
253+
{
254+
"ApiKeyAuth": []
255+
}
256+
],
257+
"description": "diagnosis job.",
258+
"tags": [
259+
"job"
260+
],
261+
"operationId": "DiagnosisJobV2",
262+
"parameters": [
263+
{
264+
"type": "string",
265+
"description": "job id",
266+
"name": "job_id",
267+
"in": "formData"
268+
}
269+
],
270+
"responses": {
271+
"200": {
272+
"description": ""
273+
}
274+
}
275+
}
276+
},
250277
"/v2/job/migration/create": {
251278
"post": {
252279
"security": [
@@ -3001,15 +3028,15 @@
30013028
"bulk_insert2": {
30023029
"type": "integer"
30033030
},
3004-
"retry_tx_limit": {
3005-
"type": "integer"
3006-
},
30073031
"dependency_history_size": {
30083032
"type": "integer"
30093033
},
30103034
"parallel_workers": {
30113035
"type": "integer"
30123036
},
3037+
"retry_tx_limit": {
3038+
"type": "integer"
3039+
},
30133040
"set_gtid_next": {
30143041
"type": "boolean"
30153042
},
@@ -3759,4 +3786,4 @@
37593786
"in": "header"
37603787
}
37613788
}
3762-
}
3789+
}

api/docs/swagger.yaml

+22-4
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,12 @@ definitions:
591591
type: integer
592592
bulk_insert2:
593593
type: integer
594-
retry_tx_limit:
595-
type: integer
596594
dependency_history_size:
597595
type: integer
598596
parallel_workers:
599597
type: integer
598+
retry_tx_limit:
599+
type: integer
600600
set_gtid_next:
601601
type: boolean
602602
use_my_sql_dependency:
@@ -1071,7 +1071,8 @@ definitions:
10711071
models.ValidateJobRespV2:
10721072
properties:
10731073
driver_config_validated:
1074-
description: DriverConfigValidated indicates whether the agent validated the driver
1074+
description: DriverConfigValidated indicates whether the agent validated the
1075+
driver
10751076
type: boolean
10761077
job_validation_error:
10771078
type: string
@@ -1250,6 +1251,22 @@ paths:
12501251
- ApiKeyAuth: []
12511252
tags:
12521253
- database
1254+
/v2/job/diagnosis:
1255+
get:
1256+
description: diagnosis job.
1257+
operationId: DiagnosisJobV2
1258+
parameters:
1259+
- description: job id
1260+
in: formData
1261+
name: job_id
1262+
type: string
1263+
responses:
1264+
"200":
1265+
description: ""
1266+
security:
1267+
- ApiKeyAuth: []
1268+
tags:
1269+
- job
12531270
/v2/job/migration/create:
12541271
post:
12551272
consumes:
@@ -1993,7 +2010,8 @@ paths:
19932010
name: task_name
19942011
required: true
19952012
type: string
1996-
- description: nomad_http_address is the http address of the nomad that the target dtle is running with. ignore it if you are not sure what to provide
2013+
- description: nomad_http_address is the http address of the nomad that the
2014+
target dtle is running with. ignore it if you are not sure what to provide
19972015
in: query
19982016
name: nomad_http_address
19992017
type: string

api/handler/v2/database.go

+1
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,4 @@ func connectDatabase(reqParam *models.ConnectionReqV2) error {
347347

348348
return nil
349349
}
350+

0 commit comments

Comments
 (0)