github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/pkg/openapi/apiv1.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "engine/proto/datarw.proto",
     5      "version": "version not set"
     6    },
     7    "tags": [
     8      {
     9        "name": "DataRWService"
    10      },
    11      {
    12        "name": "ExecutorService"
    13      },
    14      {
    15        "name": "BrokerService"
    16      },
    17      {
    18        "name": "Discovery"
    19      },
    20      {
    21        "name": "TaskScheduler"
    22      },
    23      {
    24        "name": "JobManager"
    25      },
    26      {
    27        "name": "ResourceManager"
    28      },
    29      {
    30        "name": "TestService"
    31      }
    32    ],
    33    "consumes": [
    34      "application/json"
    35    ],
    36    "produces": [
    37      "application/json"
    38    ],
    39    "paths": {
    40      "/api/v1/executors": {
    41        "get": {
    42          "summary": "ListExecutors lists all executors.\nExecutors will use this API to discover other executors.\nCurrently, we assume that there aren't too many executors.\nIf the number of executors becomes very large in the future,\nwe can consider a mechanism to watch the changes of the executors.",
    43          "operationId": "Discovery_ListExecutors",
    44          "responses": {
    45            "200": {
    46              "description": "A successful response.",
    47              "schema": {
    48                "$ref": "#/definitions/enginepbListExecutorsResponse"
    49              }
    50            },
    51            "default": {
    52              "description": "An unexpected error response.",
    53              "schema": {
    54                "$ref": "#/definitions/rpcStatus"
    55              }
    56            }
    57          },
    58          "tags": [
    59            "Discovery"
    60          ]
    61        }
    62      },
    63      "/api/v1/executors/register": {
    64        "post": {
    65          "operationId": "Discovery_RegisterExecutor",
    66          "responses": {
    67            "200": {
    68              "description": "A successful response.",
    69              "schema": {
    70                "$ref": "#/definitions/enginepbExecutor"
    71              }
    72            },
    73            "default": {
    74              "description": "An unexpected error response.",
    75              "schema": {
    76                "$ref": "#/definitions/rpcStatus"
    77              }
    78            }
    79          },
    80          "parameters": [
    81            {
    82              "name": "executor",
    83              "in": "body",
    84              "required": true,
    85              "schema": {
    86                "$ref": "#/definitions/enginepbExecutor"
    87              }
    88            }
    89          ],
    90          "tags": [
    91            "Discovery"
    92          ]
    93        }
    94      },
    95      "/api/v1/jobs": {
    96        "get": {
    97          "operationId": "JobManager_ListJobs",
    98          "responses": {
    99            "200": {
   100              "description": "A successful response.",
   101              "schema": {
   102                "$ref": "#/definitions/enginepbListJobsResponse"
   103              }
   104            },
   105            "default": {
   106              "description": "An unexpected error response.",
   107              "schema": {
   108                "$ref": "#/definitions/rpcStatus"
   109              }
   110            }
   111          },
   112          "parameters": [
   113            {
   114              "name": "page_size",
   115              "description": "The maximum number of jobs to return.\nIf it is unspecified or less than 1, at most 100 jobs will be returned.\nThe maximum value is 1000. Larger values will be coerced to 1000.",
   116              "in": "query",
   117              "required": false,
   118              "type": "integer",
   119              "format": "int32"
   120            },
   121            {
   122              "name": "page_token",
   123              "description": "The page token, returned by a previous call, to request the next page of results.",
   124              "in": "query",
   125              "required": false,
   126              "type": "string"
   127            },
   128            {
   129              "name": "tenant_id",
   130              "in": "query",
   131              "required": false,
   132              "type": "string"
   133            },
   134            {
   135              "name": "project_id",
   136              "in": "query",
   137              "required": false,
   138              "type": "string"
   139            },
   140            {
   141              "name": "include_config",
   142              "description": "Whether to return the config of the job.\nConfig may contain sensitive information, it is not returned by default.",
   143              "in": "query",
   144              "required": false,
   145              "type": "boolean"
   146            },
   147            {
   148              "name": "type",
   149              "in": "query",
   150              "required": false,
   151              "type": "string",
   152              "enum": [
   153                "CVSDemo",
   154                "DM",
   155                "CDC",
   156                "FakeJob"
   157              ]
   158            },
   159            {
   160              "name": "state",
   161              "in": "query",
   162              "required": false,
   163              "type": "string",
   164              "enum": [
   165                "Created",
   166                "Running",
   167                "Failed",
   168                "Finished",
   169                "Canceling",
   170                "Canceled"
   171              ]
   172            }
   173          ],
   174          "tags": [
   175            "JobManager"
   176          ]
   177        },
   178        "post": {
   179          "operationId": "JobManager_CreateJob",
   180          "responses": {
   181            "200": {
   182              "description": "A successful response.",
   183              "schema": {
   184                "$ref": "#/definitions/enginepbJob"
   185              }
   186            },
   187            "default": {
   188              "description": "An unexpected error response.",
   189              "schema": {
   190                "$ref": "#/definitions/rpcStatus"
   191              }
   192            }
   193          },
   194          "parameters": [
   195            {
   196              "name": "job",
   197              "in": "body",
   198              "required": true,
   199              "schema": {
   200                "$ref": "#/definitions/enginepbJob"
   201              }
   202            },
   203            {
   204              "name": "tenant_id",
   205              "in": "query",
   206              "required": false,
   207              "type": "string"
   208            },
   209            {
   210              "name": "project_id",
   211              "in": "query",
   212              "required": false,
   213              "type": "string"
   214            }
   215          ],
   216          "tags": [
   217            "JobManager"
   218          ]
   219        }
   220      },
   221      "/api/v1/jobs/{id}": {
   222        "get": {
   223          "operationId": "JobManager_GetJob",
   224          "responses": {
   225            "200": {
   226              "description": "A successful response.",
   227              "schema": {
   228                "$ref": "#/definitions/enginepbJob"
   229              }
   230            },
   231            "default": {
   232              "description": "An unexpected error response.",
   233              "schema": {
   234                "$ref": "#/definitions/rpcStatus"
   235              }
   236            }
   237          },
   238          "parameters": [
   239            {
   240              "name": "id",
   241              "in": "path",
   242              "required": true,
   243              "type": "string",
   244              "pattern": "[^/]+"
   245            },
   246            {
   247              "name": "tenant_id",
   248              "in": "query",
   249              "required": false,
   250              "type": "string"
   251            },
   252            {
   253              "name": "project_id",
   254              "in": "query",
   255              "required": false,
   256              "type": "string"
   257            },
   258            {
   259              "name": "include_config",
   260              "description": "Whether to return the config of the job.\nConfig may contain sensitive information, it is not returned by default.",
   261              "in": "query",
   262              "required": false,
   263              "type": "boolean"
   264            }
   265          ],
   266          "tags": [
   267            "JobManager"
   268          ]
   269        },
   270        "delete": {
   271          "operationId": "JobManager_DeleteJob",
   272          "responses": {
   273            "200": {
   274              "description": "A successful response.",
   275              "schema": {
   276                "type": "object",
   277                "properties": {}
   278              }
   279            },
   280            "default": {
   281              "description": "An unexpected error response.",
   282              "schema": {
   283                "$ref": "#/definitions/rpcStatus"
   284              }
   285            }
   286          },
   287          "parameters": [
   288            {
   289              "name": "id",
   290              "in": "path",
   291              "required": true,
   292              "type": "string",
   293              "pattern": "[^/]+"
   294            },
   295            {
   296              "name": "tenant_id",
   297              "in": "query",
   298              "required": false,
   299              "type": "string"
   300            },
   301            {
   302              "name": "project_id",
   303              "in": "query",
   304              "required": false,
   305              "type": "string"
   306            }
   307          ],
   308          "tags": [
   309            "JobManager"
   310          ]
   311        }
   312      },
   313      "/api/v1/jobs/{id}/cancel": {
   314        "post": {
   315          "summary": "NOTE: for the compatibility of existing openapi(ticdc) format,\nwe use `/cancel` but not `:cancel`(google api suggested)\nrefer to: https://cloud.google.com/apis/design/custom_methods",
   316          "operationId": "JobManager_CancelJob",
   317          "responses": {
   318            "200": {
   319              "description": "A successful response.",
   320              "schema": {
   321                "$ref": "#/definitions/enginepbJob"
   322              }
   323            },
   324            "default": {
   325              "description": "An unexpected error response.",
   326              "schema": {
   327                "$ref": "#/definitions/rpcStatus"
   328              }
   329            }
   330          },
   331          "parameters": [
   332            {
   333              "name": "id",
   334              "in": "path",
   335              "required": true,
   336              "type": "string",
   337              "pattern": "[^/]+"
   338            },
   339            {
   340              "name": "tenant_id",
   341              "in": "query",
   342              "required": false,
   343              "type": "string"
   344            },
   345            {
   346              "name": "project_id",
   347              "in": "query",
   348              "required": false,
   349              "type": "string"
   350            }
   351          ],
   352          "tags": [
   353            "JobManager"
   354          ]
   355        }
   356      },
   357      "/api/v1/leader": {
   358        "get": {
   359          "operationId": "Discovery_GetLeader",
   360          "responses": {
   361            "200": {
   362              "description": "A successful response.",
   363              "schema": {
   364                "$ref": "#/definitions/enginepbGetLeaderResponse"
   365              }
   366            },
   367            "default": {
   368              "description": "An unexpected error response.",
   369              "schema": {
   370                "$ref": "#/definitions/rpcStatus"
   371              }
   372            }
   373          },
   374          "tags": [
   375            "Discovery"
   376          ]
   377        }
   378      },
   379      "/api/v1/leader/resign": {
   380        "post": {
   381          "operationId": "Discovery_ResignLeader",
   382          "responses": {
   383            "200": {
   384              "description": "A successful response.",
   385              "schema": {
   386                "type": "object",
   387                "properties": {}
   388              }
   389            },
   390            "default": {
   391              "description": "An unexpected error response.",
   392              "schema": {
   393                "$ref": "#/definitions/rpcStatus"
   394              }
   395            }
   396          },
   397          "tags": [
   398            "Discovery"
   399          ]
   400        }
   401      },
   402      "/api/v1/masters": {
   403        "get": {
   404          "operationId": "Discovery_ListMasters",
   405          "responses": {
   406            "200": {
   407              "description": "A successful response.",
   408              "schema": {
   409                "$ref": "#/definitions/enginepbListMastersResponse"
   410              }
   411            },
   412            "default": {
   413              "description": "An unexpected error response.",
   414              "schema": {
   415                "$ref": "#/definitions/rpcStatus"
   416              }
   417            }
   418          },
   419          "tags": [
   420            "Discovery"
   421          ]
   422        }
   423      }
   424    },
   425    "definitions": {
   426      "JobError": {
   427        "type": "object",
   428        "properties": {
   429          "code": {
   430            "type": "string"
   431          },
   432          "message": {
   433            "type": "string"
   434          }
   435        }
   436      },
   437      "JobState": {
   438        "type": "string",
   439        "enum": [
   440          "Created",
   441          "Running",
   442          "Failed",
   443          "Finished",
   444          "Canceling",
   445          "Canceled"
   446        ]
   447      },
   448      "RecordRecordType": {
   449        "type": "string",
   450        "enum": [
   451          "DDL"
   452        ]
   453      },
   454      "SelectorOp": {
   455        "type": "string",
   456        "enum": [
   457          "Eq",
   458          "Neq",
   459          "Regex"
   460        ]
   461      },
   462      "enginepbCheckDirResponse": {
   463        "type": "object",
   464        "properties": {
   465          "err_msg": {
   466            "type": "string"
   467          },
   468          "err_file_idx": {
   469            "type": "integer",
   470            "format": "int32"
   471          }
   472        }
   473      },
   474      "enginepbConfirmDispatchTaskResponse": {
   475        "type": "object"
   476      },
   477      "enginepbCreateResourceResponse": {
   478        "type": "object"
   479      },
   480      "enginepbExecutor": {
   481        "type": "object",
   482        "properties": {
   483          "id": {
   484            "type": "string",
   485            "readOnly": true
   486          },
   487          "name": {
   488            "type": "string",
   489            "description": "name is the readable name of the executor."
   490          },
   491          "address": {
   492            "type": "string"
   493          },
   494          "labels": {
   495            "type": "object",
   496            "additionalProperties": {
   497              "type": "string"
   498            }
   499          }
   500        }
   501      },
   502      "enginepbGenerateDataResponse": {
   503        "type": "object",
   504        "properties": {
   505          "err_msg": {
   506            "type": "string"
   507          }
   508        }
   509      },
   510      "enginepbGetLeaderResponse": {
   511        "type": "object",
   512        "properties": {
   513          "advertise_addr": {
   514            "type": "string"
   515          }
   516        }
   517      },
   518      "enginepbHeartbeatResponse": {
   519        "type": "object"
   520      },
   521      "enginepbIsReadyResponse": {
   522        "type": "object",
   523        "properties": {
   524          "ready": {
   525            "type": "boolean"
   526          }
   527        }
   528      },
   529      "enginepbJob": {
   530        "type": "object",
   531        "properties": {
   532          "id": {
   533            "type": "string"
   534          },
   535          "type": {
   536            "$ref": "#/definitions/enginepbJobType"
   537          },
   538          "state": {
   539            "$ref": "#/definitions/JobState"
   540          },
   541          "config": {
   542            "type": "string",
   543            "format": "byte",
   544            "description": "Output will ignore this field by default unless include_config is set to true."
   545          },
   546          "detail": {
   547            "type": "string",
   548            "format": "byte",
   549            "readOnly": true
   550          },
   551          "error": {
   552            "$ref": "#/definitions/JobError"
   553          },
   554          "selectors": {
   555            "type": "array",
   556            "items": {
   557              "$ref": "#/definitions/enginepbSelector"
   558            }
   559          }
   560        }
   561      },
   562      "enginepbJobType": {
   563        "type": "string",
   564        "enum": [
   565          "CVSDemo",
   566          "DM",
   567          "CDC",
   568          "FakeJob"
   569        ]
   570      },
   571      "enginepbListExecutorsResponse": {
   572        "type": "object",
   573        "properties": {
   574          "executors": {
   575            "type": "array",
   576            "items": {
   577              "$ref": "#/definitions/enginepbExecutor"
   578            }
   579          }
   580        }
   581      },
   582      "enginepbListFilesResponse": {
   583        "type": "object",
   584        "properties": {
   585          "fileNum": {
   586            "type": "integer",
   587            "format": "int32"
   588          }
   589        }
   590      },
   591      "enginepbListJobsResponse": {
   592        "type": "object",
   593        "properties": {
   594          "jobs": {
   595            "type": "array",
   596            "items": {
   597              "$ref": "#/definitions/enginepbJob"
   598            }
   599          },
   600          "next_page_token": {
   601            "type": "string",
   602            "description": "A token to retrieve next page of results.\nIf this field is empty, it means no more pages."
   603          }
   604        }
   605      },
   606      "enginepbListMastersResponse": {
   607        "type": "object",
   608        "properties": {
   609          "masters": {
   610            "type": "array",
   611            "items": {
   612              "$ref": "#/definitions/enginepbMaster"
   613            }
   614          }
   615        }
   616      },
   617      "enginepbMaster": {
   618        "type": "object",
   619        "properties": {
   620          "id": {
   621            "type": "string"
   622          },
   623          "name": {
   624            "type": "string",
   625            "description": "name is the readable name of the master."
   626          },
   627          "address": {
   628            "type": "string"
   629          },
   630          "is_leader": {
   631            "type": "boolean"
   632          }
   633        }
   634      },
   635      "enginepbPreDispatchTaskResponse": {
   636        "type": "object"
   637      },
   638      "enginepbProjectInfo": {
   639        "type": "object",
   640        "properties": {
   641          "tenant_id": {
   642            "type": "string"
   643          },
   644          "project_id": {
   645            "type": "string"
   646          }
   647        }
   648      },
   649      "enginepbQueryMetaStoreResponse": {
   650        "type": "object",
   651        "properties": {
   652          "config": {
   653            "type": "string",
   654            "format": "byte"
   655          }
   656        }
   657      },
   658      "enginepbQueryResourceResponse": {
   659        "type": "object",
   660        "properties": {
   661          "creator_executor": {
   662            "type": "string"
   663          },
   664          "job_id": {
   665            "type": "string"
   666          },
   667          "creator_worker_id": {
   668            "type": "string"
   669          }
   670        }
   671      },
   672      "enginepbQueryStorageConfigResponse": {
   673        "type": "object",
   674        "properties": {
   675          "config": {
   676            "type": "string",
   677            "format": "byte"
   678          }
   679        }
   680      },
   681      "enginepbReadLinesResponse": {
   682        "type": "object",
   683        "properties": {
   684          "key": {
   685            "type": "string",
   686            "format": "byte"
   687          },
   688          "val": {
   689            "type": "string",
   690            "format": "byte"
   691          },
   692          "isEof": {
   693            "type": "boolean"
   694          },
   695          "errMsg": {
   696            "type": "string"
   697          }
   698        }
   699      },
   700      "enginepbRecord": {
   701        "type": "object",
   702        "properties": {
   703          "tp": {
   704            "$ref": "#/definitions/RecordRecordType"
   705          },
   706          "schema_ver": {
   707            "type": "integer",
   708            "format": "int32"
   709          },
   710          "tid": {
   711            "type": "integer",
   712            "format": "int32"
   713          },
   714          "gtid": {
   715            "type": "integer",
   716            "format": "int32"
   717          },
   718          "pk": {
   719            "type": "integer",
   720            "format": "int32"
   721          },
   722          "time_tracer": {
   723            "type": "array",
   724            "items": {
   725              "type": "string",
   726              "format": "int64"
   727            },
   728            "title": "for record time"
   729          }
   730        }
   731      },
   732      "enginepbRemoveLocalResourceResponse": {
   733        "type": "object"
   734      },
   735      "enginepbRemoveResourceResponse": {
   736        "type": "object"
   737      },
   738      "enginepbResourceKey": {
   739        "type": "object",
   740        "properties": {
   741          "job_id": {
   742            "type": "string"
   743          },
   744          "resource_id": {
   745            "type": "string"
   746          }
   747        }
   748      },
   749      "enginepbScheduleTaskResponse": {
   750        "type": "object",
   751        "properties": {
   752          "executor_id": {
   753            "type": "string"
   754          },
   755          "executor_addr": {
   756            "type": "string"
   757          }
   758        }
   759      },
   760      "enginepbSelector": {
   761        "type": "object",
   762        "properties": {
   763          "label": {
   764            "type": "string"
   765          },
   766          "target": {
   767            "type": "string"
   768          },
   769          "op": {
   770            "$ref": "#/definitions/SelectorOp"
   771          }
   772        }
   773      },
   774      "enginepbStoreType": {
   775        "type": "string",
   776        "enum": [
   777          "AppMetaStore"
   778        ]
   779      },
   780      "enginepbWriteLinesResponse": {
   781        "type": "object",
   782        "properties": {
   783          "err_msg": {
   784            "type": "string"
   785          }
   786        }
   787      },
   788      "protobufAny": {
   789        "type": "object",
   790        "properties": {
   791          "@type": {
   792            "type": "string"
   793          }
   794        },
   795        "additionalProperties": {}
   796      },
   797      "rpcStatus": {
   798        "type": "object",
   799        "properties": {
   800          "code": {
   801            "type": "integer",
   802            "format": "int32"
   803          },
   804          "message": {
   805            "type": "string"
   806          },
   807          "details": {
   808            "type": "array",
   809            "items": {
   810              "$ref": "#/definitions/protobufAny"
   811            }
   812          }
   813        }
   814      }
   815    }
   816  }