github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/openapi/gen.types.go (about) 1 // Package openapi provides primitives to interact with the openapi HTTP API. 2 // 3 // Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT. 4 package openapi 5 6 import ( 7 "encoding/json" 8 "fmt" 9 ) 10 11 // Defines values for TaskOnDuplicate. 12 const ( 13 TaskOnDuplicateError TaskOnDuplicate = "error" 14 15 TaskOnDuplicateIgnore TaskOnDuplicate = "ignore" 16 17 TaskOnDuplicateReplace TaskOnDuplicate = "replace" 18 ) 19 20 // Defines values for TaskShardMode. 21 const ( 22 TaskShardModeOptimistic TaskShardMode = "optimistic" 23 24 TaskShardModePessimistic TaskShardMode = "pessimistic" 25 ) 26 27 // Defines values for TaskTaskMode. 28 const ( 29 TaskTaskModeAll TaskTaskMode = "all" 30 31 TaskTaskModeFull TaskTaskMode = "full" 32 33 TaskTaskModeIncremental TaskTaskMode = "incremental" 34 ) 35 36 // Defines values for TaskFullMigrateConfAnalyze. 37 const ( 38 TaskFullMigrateConfAnalyzeOff TaskFullMigrateConfAnalyze = "off" 39 40 TaskFullMigrateConfAnalyzeOptional TaskFullMigrateConfAnalyze = "optional" 41 42 TaskFullMigrateConfAnalyzeRequired TaskFullMigrateConfAnalyze = "required" 43 ) 44 45 // Defines values for TaskFullMigrateConfChecksum. 46 const ( 47 TaskFullMigrateConfChecksumOff TaskFullMigrateConfChecksum = "off" 48 49 TaskFullMigrateConfChecksumOptional TaskFullMigrateConfChecksum = "optional" 50 51 TaskFullMigrateConfChecksumRequired TaskFullMigrateConfChecksum = "required" 52 ) 53 54 // Defines values for TaskFullMigrateConfImportMode. 55 const ( 56 TaskFullMigrateConfImportModeLogical TaskFullMigrateConfImportMode = "logical" 57 58 TaskFullMigrateConfImportModePhysical TaskFullMigrateConfImportMode = "physical" 59 ) 60 61 // Defines values for TaskFullMigrateConfOnDuplicateLogical. 62 const ( 63 TaskFullMigrateConfOnDuplicateLogicalError TaskFullMigrateConfOnDuplicateLogical = "error" 64 65 TaskFullMigrateConfOnDuplicateLogicalIgnore TaskFullMigrateConfOnDuplicateLogical = "ignore" 66 67 TaskFullMigrateConfOnDuplicateLogicalReplace TaskFullMigrateConfOnDuplicateLogical = "replace" 68 ) 69 70 // Defines values for TaskFullMigrateConfOnDuplicatePhysical. 71 const ( 72 TaskFullMigrateConfOnDuplicatePhysicalManual TaskFullMigrateConfOnDuplicatePhysical = "manual" 73 74 TaskFullMigrateConfOnDuplicatePhysicalNone TaskFullMigrateConfOnDuplicatePhysical = "none" 75 ) 76 77 // Defines values for TaskStage. 78 const ( 79 TaskStageFinished TaskStage = "Finished" 80 81 TaskStageRunning TaskStage = "Running" 82 83 TaskStageStopped TaskStage = "Stopped" 84 ) 85 86 // AlertManagerTopology defines model for AlertManagerTopology. 87 type AlertManagerTopology struct { 88 Host string `json:"host"` 89 Port int `json:"port"` 90 } 91 92 // ClusterMaster defines model for ClusterMaster. 93 type ClusterMaster struct { 94 // address of the current master node 95 Addr string `json:"addr"` 96 97 // online status of this master 98 Alive bool `json:"alive"` 99 100 // is this master the leader 101 Leader bool `json:"leader"` 102 Name string `json:"name"` 103 } 104 105 // ClusterTopology defines model for ClusterTopology. 106 type ClusterTopology struct { 107 AlertManagerTopology *AlertManagerTopology `json:"alert_manager_topology,omitempty"` 108 GrafanaTopology *GrafanaTopology `json:"grafana_topology,omitempty"` 109 MasterTopologyList *[]MasterTopology `json:"master_topology_list,omitempty"` 110 PrometheusTopology *PrometheusTopology `json:"prometheus_topology,omitempty"` 111 WorkerTopologyList *[]WorkerTopology `json:"worker_topology_list,omitempty"` 112 } 113 114 // ClusterWorker defines model for ClusterWorker. 115 type ClusterWorker struct { 116 // address of the current master node 117 Addr string `json:"addr"` 118 119 // source name bound to this worker node 120 BoundSourceName string `json:"bound_source_name"` 121 122 // bound stage of this worker node 123 BoundStage string `json:"bound_stage"` 124 Name string `json:"name"` 125 } 126 127 // ConverterTaskRequest defines model for ConverterTaskRequest. 128 type ConverterTaskRequest struct { 129 // task 130 Task *Task `json:"task,omitempty"` 131 132 // config file in yaml format https://docs.pingcap.com/zh/tidb/stable/task-configuration-file-full. 133 TaskConfigFile *string `json:"task_config_file,omitempty"` 134 } 135 136 // ConverterTaskResponse defines model for ConverterTaskResponse. 137 type ConverterTaskResponse struct { 138 // task 139 Task Task `json:"task"` 140 141 // config file in yaml format https://docs.pingcap.com/zh/tidb/stable/task-configuration-file-full. 142 TaskConfigFile string `json:"task_config_file"` 143 } 144 145 // CreateSourceRequest defines model for CreateSourceRequest. 146 type CreateSourceRequest struct { 147 // source 148 Source Source `json:"source"` 149 WorkerName *string `json:"worker_name,omitempty"` 150 } 151 152 // CreateTaskRequest defines model for CreateTaskRequest. 153 type CreateTaskRequest struct { 154 // task 155 Task Task `json:"task"` 156 } 157 158 // action to stop a relay request 159 type DisableRelayRequest struct { 160 // worker name list 161 WorkerNameList *WorkerNameList `json:"worker_name_list,omitempty"` 162 } 163 164 // status of dump unit 165 type DumpStatus struct { 166 CompletedTables float64 `json:"completed_tables"` 167 EstimateTotalRows float64 `json:"estimate_total_rows"` 168 FinishedBytes float64 `json:"finished_bytes"` 169 FinishedRows float64 `json:"finished_rows"` 170 TotalTables int64 `json:"total_tables"` 171 } 172 173 // action to start a relay request 174 type EnableRelayRequest struct { 175 // starting GTID of the upstream binlog 176 RelayBinlogGtid *string `json:"relay_binlog_gtid"` 177 178 // starting filename of the upstream binlog 179 RelayBinlogName *string `json:"relay_binlog_name"` 180 181 // the directory where the relay log is stored 182 RelayDir *string `json:"relay_dir"` 183 184 // worker name list 185 WorkerNameList *WorkerNameList `json:"worker_name_list,omitempty"` 186 } 187 188 // operation error 189 type ErrorWithMessage struct { 190 // error code 191 ErrorCode int `json:"error_code"` 192 193 // error message 194 ErrorMsg string `json:"error_msg"` 195 } 196 197 // GetClusterInfoResponse defines model for GetClusterInfoResponse. 198 type GetClusterInfoResponse struct { 199 // cluster id 200 ClusterId uint64 `json:"cluster_id"` 201 Topology *ClusterTopology `json:"topology,omitempty"` 202 } 203 204 // GetClusterMasterListResponse defines model for GetClusterMasterListResponse. 205 type GetClusterMasterListResponse struct { 206 Data []ClusterMaster `json:"data"` 207 Total int `json:"total"` 208 } 209 210 // GetClusterWorkerListResponse defines model for GetClusterWorkerListResponse. 211 type GetClusterWorkerListResponse struct { 212 Data []ClusterWorker `json:"data"` 213 Total int `json:"total"` 214 } 215 216 // GetSourceListResponse defines model for GetSourceListResponse. 217 type GetSourceListResponse struct { 218 Data []Source `json:"data"` 219 Total int `json:"total"` 220 } 221 222 // GetSourceStatusResponse defines model for GetSourceStatusResponse. 223 type GetSourceStatusResponse struct { 224 Data []SourceStatus `json:"data"` 225 Total int `json:"total"` 226 } 227 228 // GetTaskListResponse defines model for GetTaskListResponse. 229 type GetTaskListResponse struct { 230 Data []Task `json:"data"` 231 Total int `json:"total"` 232 } 233 234 // GetTaskMigrateTargetsResponse defines model for GetTaskMigrateTargetsResponse. 235 type GetTaskMigrateTargetsResponse struct { 236 Data []TaskMigrateTarget `json:"data"` 237 Total int `json:"total"` 238 } 239 240 // GetTaskStatusResponse defines model for GetTaskStatusResponse. 241 type GetTaskStatusResponse struct { 242 Data []SubTaskStatus `json:"data"` 243 Total int `json:"total"` 244 } 245 246 // GetTaskTableStructureResponse defines model for GetTaskTableStructureResponse. 247 type GetTaskTableStructureResponse struct { 248 SchemaCreateSql *string `json:"schema_create_sql,omitempty"` 249 SchemaName *string `json:"schema_name,omitempty"` 250 TableName string `json:"table_name"` 251 } 252 253 // GrafanaTopology defines model for GrafanaTopology. 254 type GrafanaTopology struct { 255 Host string `json:"host"` 256 Port int `json:"port"` 257 } 258 259 // status of load unit 260 type LoadStatus struct { 261 FinishedBytes int64 `json:"finished_bytes"` 262 MetaBinlog string `json:"meta_binlog"` 263 MetaBinlogGtid string `json:"meta_binlog_gtid"` 264 Progress string `json:"progress"` 265 TotalBytes int64 `json:"total_bytes"` 266 } 267 268 // MasterTopology defines model for MasterTopology. 269 type MasterTopology struct { 270 Host string `json:"host"` 271 Name string `json:"name"` 272 Port int `json:"port"` 273 } 274 275 // OperateTaskResponse defines model for OperateTaskResponse. 276 type OperateTaskResponse struct { 277 // pre-check result 278 CheckResult string `json:"check_result"` 279 280 // task 281 Task Task `json:"task"` 282 } 283 284 // action to operate table request 285 type OperateTaskTableStructureRequest struct { 286 // Writes the schema to the checkpoint so that DM can load it after restarting the task 287 Flush *bool `json:"flush,omitempty"` 288 289 // sql you want to operate 290 SqlContent string `json:"sql_content"` 291 292 // Updates the optimistic sharding metadata with this schema only used when an error occurs in the optimistic sharding DDL mode 293 Sync *bool `json:"sync,omitempty"` 294 } 295 296 // PrometheusTopology defines model for PrometheusTopology. 297 type PrometheusTopology struct { 298 Host string `json:"host"` 299 Port int `json:"port"` 300 } 301 302 // relay log cleanup policy configuration 303 type Purge struct { 304 // expiration time of relay log 305 Expires *int64 `json:"expires"` 306 307 // The interval to periodically check if the relay log is expired, default value: 3600, in seconds 308 Interval *int64 `json:"interval"` 309 310 // Minimum free disk space, in GB 311 RemainSpace *int64 `json:"remain_space"` 312 } 313 314 // action to stop a relay request 315 type PurgeRelayRequest struct { 316 // starting filename of the upstream binlog 317 RelayBinlogName string `json:"relay_binlog_name"` 318 319 // specify relay sub directory for relay_binlog_name. If not specified, the latest one will be used. Sample format: 2ae76434-f79f-11e8-bde2-0242ac130008.000001 320 RelayDir *string `json:"relay_dir"` 321 } 322 323 // the config of relay 324 type RelayConfig struct { 325 EnableRelay *bool `json:"enable_relay,omitempty"` 326 327 // starting GTID of the upstream binlog 328 RelayBinlogGtid *string `json:"relay_binlog_gtid"` 329 330 // starting filename of the upstream binlog 331 RelayBinlogName *string `json:"relay_binlog_name"` 332 333 // the directory where the relay log is stored 334 RelayDir *string `json:"relay_dir"` 335 } 336 337 // status of relay log 338 type RelayStatus struct { 339 // upstream binlog file information 340 MasterBinlog string `json:"master_binlog"` 341 342 // GTID of the upstream 343 MasterBinlogGtid string `json:"master_binlog_gtid"` 344 345 // relay current GTID 346 RelayBinlogGtid string `json:"relay_binlog_gtid"` 347 348 // whether to catch up with upstream progress 349 RelayCatchUpMaster bool `json:"relay_catch_up_master"` 350 351 // the directory where the relay log is stored 352 RelayDir string `json:"relay_dir"` 353 354 // current status 355 Stage string `json:"stage"` 356 } 357 358 // schema name list 359 type SchemaNameList []string 360 361 // data source ssl configuration, the field will be hidden when getting the data source configuration from the interface 362 type Security struct { 363 // Common Name of SSL certificates 364 CertAllowedCn *[]string `json:"cert_allowed_cn,omitempty"` 365 366 // certificate file content 367 SslCaContent string `json:"ssl_ca_content"` 368 369 // File content of PEM format/X509 format certificates 370 SslCertContent string `json:"ssl_cert_content"` 371 372 // Content of the private key file in X509 format 373 SslKeyContent string `json:"ssl_key_content"` 374 } 375 376 // ShardingGroup defines model for ShardingGroup. 377 type ShardingGroup struct { 378 DdlList []string `json:"ddl_list"` 379 FirstLocation string `json:"first_location"` 380 Synced []string `json:"synced"` 381 Target string `json:"target"` 382 Unsynced []string `json:"unsynced"` 383 } 384 385 // source 386 type Source struct { 387 // whether this source is enabled 388 Enable bool `json:"enable"` 389 390 // whether to use GTID to pull binlogs from upstream 391 EnableGtid bool `json:"enable_gtid"` 392 393 // flavor of this source 394 Flavor *string `json:"flavor,omitempty"` 395 396 // source address 397 Host string `json:"host"` 398 399 // source password 400 Password *string `json:"password"` 401 402 // source port 403 Port int `json:"port"` 404 405 // relay log cleanup policy configuration 406 Purge *Purge `json:"purge,omitempty"` 407 408 // the config of relay 409 RelayConfig *RelayConfig `json:"relay_config,omitempty"` 410 411 // data source ssl configuration, the field will be hidden when getting the data source configuration from the interface 412 Security *Security `json:"security"` 413 414 // source name 415 SourceName string `json:"source_name"` 416 StatusList *[]SourceStatus `json:"status_list,omitempty"` 417 418 // task name list 419 TaskNameList *TaskNameList `json:"task_name_list,omitempty"` 420 421 // source username 422 User string `json:"user"` 423 } 424 425 // source name list 426 type SourceNameList []string 427 428 // source status 429 type SourceStatus struct { 430 // error message when something wrong 431 ErrorMsg *string `json:"error_msg,omitempty"` 432 433 // status of relay log 434 RelayStatus *RelayStatus `json:"relay_status,omitempty"` 435 436 // source name 437 SourceName string `json:"source_name"` 438 439 // The worker currently bound to the source 440 WorkerName string `json:"worker_name"` 441 } 442 443 // StartTaskRequest defines model for StartTaskRequest. 444 type StartTaskRequest struct { 445 // whether to remove meta database in downstream database 446 RemoveMeta *bool `json:"remove_meta,omitempty"` 447 448 // time duration of safe mode 449 SafeModeTimeDuration *string `json:"safe_mode_time_duration,omitempty"` 450 451 // source name list 452 SourceNameList *SourceNameList `json:"source_name_list,omitempty"` 453 454 // task start time 455 StartTime *string `json:"start_time,omitempty"` 456 } 457 458 // StopTaskRequest defines model for StopTaskRequest. 459 type StopTaskRequest struct { 460 // source name list 461 SourceNameList *SourceNameList `json:"source_name_list,omitempty"` 462 463 // time duration waiting task stop 464 TimeoutDuration *string `json:"timeout_duration,omitempty"` 465 } 466 467 // SubTaskStatus defines model for SubTaskStatus. 468 type SubTaskStatus struct { 469 // status of dump unit 470 DumpStatus *DumpStatus `json:"dump_status,omitempty"` 471 472 // error message when something wrong 473 ErrorMsg *string `json:"error_msg,omitempty"` 474 475 // status of load unit 476 LoadStatus *LoadStatus `json:"load_status,omitempty"` 477 478 // task name 479 Name string `json:"name"` 480 481 // source name 482 SourceName string `json:"source_name"` 483 Stage TaskStage `json:"stage"` 484 485 // status of sync unit 486 SyncStatus *SyncStatus `json:"sync_status,omitempty"` 487 488 // task unit type 489 Unit string `json:"unit"` 490 UnresolvedDdlLockId *string `json:"unresolved_ddl_lock_id,omitempty"` 491 492 // worker name 493 WorkerName string `json:"worker_name"` 494 } 495 496 // status of sync unit 497 type SyncStatus struct { 498 BinlogType string `json:"binlog_type"` 499 500 // sharding DDL which current is blocking 501 BlockingDdls []string `json:"blocking_ddls"` 502 MasterBinlog string `json:"master_binlog"` 503 MasterBinlogGtid string `json:"master_binlog_gtid"` 504 RecentTps int64 `json:"recent_tps"` 505 SecondsBehindMaster int64 `json:"seconds_behind_master"` 506 Synced bool `json:"synced"` 507 SyncerBinlog string `json:"syncer_binlog"` 508 SyncerBinlogGtid string `json:"syncer_binlog_gtid"` 509 TotalEvents int64 `json:"total_events"` 510 TotalTps int64 `json:"total_tps"` 511 512 // sharding groups which current are un-resolved 513 UnresolvedGroups []ShardingGroup `json:"unresolved_groups"` 514 } 515 516 // schema name list 517 type TableNameList []string 518 519 // task 520 type Task struct { 521 BinlogFilterRule *Task_BinlogFilterRule `json:"binlog_filter_rule,omitempty"` 522 523 // whether to enable support for the online ddl plugin 524 EnhanceOnlineSchemaChange bool `json:"enhance_online_schema_change"` 525 526 // ignore precheck items 527 IgnoreCheckingItems *[]string `json:"ignore_checking_items,omitempty"` 528 529 // downstream database for storing meta information 530 MetaSchema *string `json:"meta_schema,omitempty"` 531 532 // task name 533 Name string `json:"name"` 534 535 // how to handle conflicted data 536 OnDuplicate TaskOnDuplicate `json:"on_duplicate"` 537 538 // the way to coordinate DDL 539 ShardMode *TaskShardMode `json:"shard_mode,omitempty"` 540 541 // source-related configuration 542 SourceConfig TaskSourceConfig `json:"source_config"` 543 StatusList *[]SubTaskStatus `json:"status_list,omitempty"` 544 545 // whether to enable strict optimistic shard mode 546 StrictOptimisticShardMode *bool `json:"strict_optimistic_shard_mode,omitempty"` 547 548 // table migrate rule 549 TableMigrateRule []TaskTableMigrateRule `json:"table_migrate_rule"` 550 551 // downstream database configuration 552 TargetConfig TaskTargetDataBase `json:"target_config"` 553 554 // migrate mode 555 TaskMode TaskTaskMode `json:"task_mode"` 556 } 557 558 // Task_BinlogFilterRule defines model for Task.BinlogFilterRule. 559 type Task_BinlogFilterRule struct { 560 AdditionalProperties map[string]TaskBinLogFilterRule `json:"-"` 561 } 562 563 // how to handle conflicted data 564 type TaskOnDuplicate string 565 566 // the way to coordinate DDL 567 type TaskShardMode string 568 569 // migrate mode 570 type TaskTaskMode string 571 572 // Filtering rules at binlog level 573 type TaskBinLogFilterRule struct { 574 // event type 575 IgnoreEvent *[]string `json:"ignore_event,omitempty"` 576 577 // sql pattern to filter 578 IgnoreSql *[]string `json:"ignore_sql,omitempty"` 579 } 580 581 // configuration of full migrate tasks 582 type TaskFullMigrateConf struct { 583 // to control checksum of physical import 584 Analyze *TaskFullMigrateConfAnalyze `json:"analyze,omitempty"` 585 586 // to control checksum of physical import 587 Checksum *TaskFullMigrateConfChecksum `json:"checksum,omitempty"` 588 589 // to control compress kv pairs of physical import 590 CompressKvPairs *string `json:"compress-kv-pairs,omitempty"` 591 592 // to control the way in which data is exported for consistency assurance 593 Consistency *string `json:"consistency,omitempty"` 594 595 // storage dir name 596 DataDir *string `json:"data_dir,omitempty"` 597 598 // disk quota for physical import 599 DiskQuota *string `json:"disk_quota,omitempty"` 600 601 // full export of concurrent 602 ExportThreads *int `json:"export_threads,omitempty"` 603 604 // to control import mode of full import 605 ImportMode *TaskFullMigrateConfImportMode `json:"import_mode,omitempty"` 606 607 // full import of concurrent 608 ImportThreads *int `json:"import_threads,omitempty"` 609 610 // to control the duplication resolution when meet duplicate rows for logical import 611 OnDuplicateLogical *TaskFullMigrateConfOnDuplicateLogical `json:"on_duplicate_logical,omitempty"` 612 613 // to control the duplication resolution when meet duplicate rows for physical import 614 OnDuplicatePhysical *TaskFullMigrateConfOnDuplicatePhysical `json:"on_duplicate_physical,omitempty"` 615 616 // address of pd 617 PdAddr *string `json:"pd_addr,omitempty"` 618 619 // to control range concurrency of physical import 620 RangeConcurrency *int `json:"range_concurrency,omitempty"` 621 622 // sorting dir name for physical import 623 SortingDir *string `json:"sorting_dir,omitempty"` 624 } 625 626 // to control checksum of physical import 627 type TaskFullMigrateConfAnalyze string 628 629 // to control checksum of physical import 630 type TaskFullMigrateConfChecksum string 631 632 // to control import mode of full import 633 type TaskFullMigrateConfImportMode string 634 635 // to control the duplication resolution when meet duplicate rows for logical import 636 type TaskFullMigrateConfOnDuplicateLogical string 637 638 // to control the duplication resolution when meet duplicate rows for physical import 639 type TaskFullMigrateConfOnDuplicatePhysical string 640 641 // configuration of incremental tasks 642 type TaskIncrMigrateConf struct { 643 // incremental synchronization of batch execution sql quantities 644 ReplBatch *int `json:"repl_batch,omitempty"` 645 646 // incremental task of concurrent 647 ReplThreads *int `json:"repl_threads,omitempty"` 648 } 649 650 // task migrate targets 651 type TaskMigrateTarget struct { 652 SourceSchema string `json:"source_schema"` 653 SourceTable string `json:"source_table"` 654 TargetSchema string `json:"target_schema"` 655 TargetTable string `json:"target_table"` 656 } 657 658 // task name list 659 type TaskNameList []string 660 661 // TaskSourceConf defines model for TaskSourceConf. 662 type TaskSourceConf struct { 663 BinlogGtid *string `json:"binlog_gtid,omitempty"` 664 BinlogName *string `json:"binlog_name,omitempty"` 665 BinlogPos *int `json:"binlog_pos,omitempty"` 666 667 // source name 668 SourceName string `json:"source_name"` 669 } 670 671 // source-related configuration 672 type TaskSourceConfig struct { 673 // configuration of full migrate tasks 674 FullMigrateConf *TaskFullMigrateConf `json:"full_migrate_conf,omitempty"` 675 676 // configuration of incremental tasks 677 IncrMigrateConf *TaskIncrMigrateConf `json:"incr_migrate_conf,omitempty"` 678 679 // source configuration 680 SourceConf []TaskSourceConf `json:"source_conf"` 681 } 682 683 // TaskStage defines model for TaskStage. 684 type TaskStage string 685 686 // upstream table to downstream migrate rules 687 type TaskTableMigrateRule struct { 688 // filter rule name 689 BinlogFilterRule *[]string `json:"binlog_filter_rule,omitempty"` 690 691 // source-related configuration 692 Source struct { 693 // schema name, wildcard support 694 Schema string `json:"schema"` 695 696 // source name 697 SourceName string `json:"source_name"` 698 699 // table name, wildcard support 700 Table string `json:"table"` 701 } `json:"source"` 702 703 // downstream-related configuration 704 Target *struct { 705 // schema name, does not support wildcards 706 Schema *string `json:"schema,omitempty"` 707 708 // table name, does not support wildcards 709 Table *string `json:"table,omitempty"` 710 } `json:"target,omitempty"` 711 } 712 713 // downstream database configuration 714 type TaskTargetDataBase struct { 715 // source address 716 Host string `json:"host"` 717 718 // source password 719 Password string `json:"password"` 720 721 // source port 722 Port int `json:"port"` 723 724 // data source ssl configuration, the field will be hidden when getting the data source configuration from the interface 725 Security *Security `json:"security"` 726 727 // source username 728 User string `json:"user"` 729 } 730 731 // TaskTemplateRequest defines model for TaskTemplateRequest. 732 type TaskTemplateRequest struct { 733 // whether to overwrite task template template 734 Overwrite bool `json:"overwrite"` 735 } 736 737 // TaskTemplateResponse defines model for TaskTemplateResponse. 738 type TaskTemplateResponse struct { 739 FailedTaskList []struct { 740 ErrorMsg string `json:"error_msg"` 741 TaskName string `json:"task_name"` 742 } `json:"failed_task_list"` 743 SuccessTaskList []string `json:"success_task_list"` 744 } 745 746 // UpdateSourceRequest defines model for UpdateSourceRequest. 747 type UpdateSourceRequest struct { 748 // source 749 Source Source `json:"source"` 750 } 751 752 // UpdateTaskRequest defines model for UpdateTaskRequest. 753 type UpdateTaskRequest struct { 754 // task 755 Task Task `json:"task"` 756 } 757 758 // worker name list 759 type WorkerNameList []string 760 761 // requests related to workers 762 type WorkerNameRequest struct { 763 // worker name 764 WorkerName string `json:"worker_name"` 765 } 766 767 // WorkerTopology defines model for WorkerTopology. 768 type WorkerTopology struct { 769 Host string `json:"host"` 770 Name string `json:"name"` 771 Port int `json:"port"` 772 } 773 774 // DMAPIUpdateClusterInfoJSONBody defines parameters for DMAPIUpdateClusterInfo. 775 type DMAPIUpdateClusterInfoJSONBody ClusterTopology 776 777 // DMAPIGetSourceListParams defines parameters for DMAPIGetSourceList. 778 type DMAPIGetSourceListParams struct { 779 // list source with status 780 WithStatus *bool `json:"with_status,omitempty"` 781 782 // only return the enable-relay source 783 EnableRelay *bool `json:"enable_relay,omitempty"` 784 } 785 786 // DMAPICreateSourceJSONBody defines parameters for DMAPICreateSource. 787 type DMAPICreateSourceJSONBody CreateSourceRequest 788 789 // DMAPIDeleteSourceParams defines parameters for DMAPIDeleteSource. 790 type DMAPIDeleteSourceParams struct { 791 // force stop source also stop the related tasks 792 Force *bool `json:"force,omitempty"` 793 } 794 795 // DMAPIGetSourceParams defines parameters for DMAPIGetSource. 796 type DMAPIGetSourceParams struct { 797 // list source with status 798 WithStatus *bool `json:"with_status,omitempty"` 799 } 800 801 // DMAPIUpdateSourceJSONBody defines parameters for DMAPIUpdateSource. 802 type DMAPIUpdateSourceJSONBody UpdateSourceRequest 803 804 // DMAPIDisableRelayJSONBody defines parameters for DMAPIDisableRelay. 805 type DMAPIDisableRelayJSONBody DisableRelayRequest 806 807 // DMAPIEnableRelayJSONBody defines parameters for DMAPIEnableRelay. 808 type DMAPIEnableRelayJSONBody EnableRelayRequest 809 810 // DMAPIPurgeRelayJSONBody defines parameters for DMAPIPurgeRelay. 811 type DMAPIPurgeRelayJSONBody PurgeRelayRequest 812 813 // DMAPITransferSourceJSONBody defines parameters for DMAPITransferSource. 814 type DMAPITransferSourceJSONBody WorkerNameRequest 815 816 // DMAPIGetTaskListParams defines parameters for DMAPIGetTaskList. 817 type DMAPIGetTaskListParams struct { 818 // get task with status 819 WithStatus *bool `json:"with_status,omitempty"` 820 821 // filter by task stage 822 Stage *TaskStage `json:"stage,omitempty"` 823 824 // filter by source name 825 SourceNameList *SourceNameList `json:"source_name_list,omitempty"` 826 } 827 828 // DMAPICreateTaskJSONBody defines parameters for DMAPICreateTask. 829 type DMAPICreateTaskJSONBody CreateTaskRequest 830 831 // DMAPIConvertTaskJSONBody defines parameters for DMAPIConvertTask. 832 type DMAPIConvertTaskJSONBody ConverterTaskRequest 833 834 // DMAPICreateTaskTemplateJSONBody defines parameters for DMAPICreateTaskTemplate. 835 type DMAPICreateTaskTemplateJSONBody Task 836 837 // DMAPIImportTaskTemplateJSONBody defines parameters for DMAPIImportTaskTemplate. 838 type DMAPIImportTaskTemplateJSONBody TaskTemplateRequest 839 840 // DMAPIDeleteTaskParams defines parameters for DMAPIDeleteTask. 841 type DMAPIDeleteTaskParams struct { 842 // force stop task even if some subtask is running 843 Force *bool `json:"force,omitempty"` 844 } 845 846 // DMAPIGetTaskParams defines parameters for DMAPIGetTask. 847 type DMAPIGetTaskParams struct { 848 // get task with status 849 WithStatus *bool `json:"with_status,omitempty"` 850 } 851 852 // DMAPIUpdateTaskJSONBody defines parameters for DMAPIUpdateTask. 853 type DMAPIUpdateTaskJSONBody UpdateTaskRequest 854 855 // DMAPIGetTaskMigrateTargetsParams defines parameters for DMAPIGetTaskMigrateTargets. 856 type DMAPIGetTaskMigrateTargetsParams struct { 857 SchemaPattern *string `json:"schema_pattern,omitempty"` 858 TablePattern *string `json:"table_pattern,omitempty"` 859 } 860 861 // DMAPIOperateTableStructureJSONBody defines parameters for DMAPIOperateTableStructure. 862 type DMAPIOperateTableStructureJSONBody OperateTaskTableStructureRequest 863 864 // DMAPIStartTaskJSONBody defines parameters for DMAPIStartTask. 865 type DMAPIStartTaskJSONBody StartTaskRequest 866 867 // DMAPIGetTaskStatusParams defines parameters for DMAPIGetTaskStatus. 868 type DMAPIGetTaskStatusParams struct { 869 // source name list 870 SourceNameList *SourceNameList `json:"source_name_list,omitempty"` 871 } 872 873 // DMAPIStopTaskJSONBody defines parameters for DMAPIStopTask. 874 type DMAPIStopTaskJSONBody StopTaskRequest 875 876 // DMAPIUpdateClusterInfoJSONRequestBody defines body for DMAPIUpdateClusterInfo for application/json ContentType. 877 type DMAPIUpdateClusterInfoJSONRequestBody DMAPIUpdateClusterInfoJSONBody 878 879 // DMAPICreateSourceJSONRequestBody defines body for DMAPICreateSource for application/json ContentType. 880 type DMAPICreateSourceJSONRequestBody DMAPICreateSourceJSONBody 881 882 // DMAPIUpdateSourceJSONRequestBody defines body for DMAPIUpdateSource for application/json ContentType. 883 type DMAPIUpdateSourceJSONRequestBody DMAPIUpdateSourceJSONBody 884 885 // DMAPIDisableRelayJSONRequestBody defines body for DMAPIDisableRelay for application/json ContentType. 886 type DMAPIDisableRelayJSONRequestBody DMAPIDisableRelayJSONBody 887 888 // DMAPIEnableRelayJSONRequestBody defines body for DMAPIEnableRelay for application/json ContentType. 889 type DMAPIEnableRelayJSONRequestBody DMAPIEnableRelayJSONBody 890 891 // DMAPIPurgeRelayJSONRequestBody defines body for DMAPIPurgeRelay for application/json ContentType. 892 type DMAPIPurgeRelayJSONRequestBody DMAPIPurgeRelayJSONBody 893 894 // DMAPITransferSourceJSONRequestBody defines body for DMAPITransferSource for application/json ContentType. 895 type DMAPITransferSourceJSONRequestBody DMAPITransferSourceJSONBody 896 897 // DMAPICreateTaskJSONRequestBody defines body for DMAPICreateTask for application/json ContentType. 898 type DMAPICreateTaskJSONRequestBody DMAPICreateTaskJSONBody 899 900 // DMAPIConvertTaskJSONRequestBody defines body for DMAPIConvertTask for application/json ContentType. 901 type DMAPIConvertTaskJSONRequestBody DMAPIConvertTaskJSONBody 902 903 // DMAPICreateTaskTemplateJSONRequestBody defines body for DMAPICreateTaskTemplate for application/json ContentType. 904 type DMAPICreateTaskTemplateJSONRequestBody DMAPICreateTaskTemplateJSONBody 905 906 // DMAPIImportTaskTemplateJSONRequestBody defines body for DMAPIImportTaskTemplate for application/json ContentType. 907 type DMAPIImportTaskTemplateJSONRequestBody DMAPIImportTaskTemplateJSONBody 908 909 // DMAPIUpdateTaskJSONRequestBody defines body for DMAPIUpdateTask for application/json ContentType. 910 type DMAPIUpdateTaskJSONRequestBody DMAPIUpdateTaskJSONBody 911 912 // DMAPIOperateTableStructureJSONRequestBody defines body for DMAPIOperateTableStructure for application/json ContentType. 913 type DMAPIOperateTableStructureJSONRequestBody DMAPIOperateTableStructureJSONBody 914 915 // DMAPIStartTaskJSONRequestBody defines body for DMAPIStartTask for application/json ContentType. 916 type DMAPIStartTaskJSONRequestBody DMAPIStartTaskJSONBody 917 918 // DMAPIStopTaskJSONRequestBody defines body for DMAPIStopTask for application/json ContentType. 919 type DMAPIStopTaskJSONRequestBody DMAPIStopTaskJSONBody 920 921 // Getter for additional properties for Task_BinlogFilterRule. Returns the specified 922 // element and whether it was found 923 func (a Task_BinlogFilterRule) Get(fieldName string) (value TaskBinLogFilterRule, found bool) { 924 if a.AdditionalProperties != nil { 925 value, found = a.AdditionalProperties[fieldName] 926 } 927 return 928 } 929 930 // Setter for additional properties for Task_BinlogFilterRule 931 func (a *Task_BinlogFilterRule) Set(fieldName string, value TaskBinLogFilterRule) { 932 if a.AdditionalProperties == nil { 933 a.AdditionalProperties = make(map[string]TaskBinLogFilterRule) 934 } 935 a.AdditionalProperties[fieldName] = value 936 } 937 938 // Override default JSON handling for Task_BinlogFilterRule to handle AdditionalProperties 939 func (a *Task_BinlogFilterRule) UnmarshalJSON(b []byte) error { 940 object := make(map[string]json.RawMessage) 941 err := json.Unmarshal(b, &object) 942 if err != nil { 943 return err 944 } 945 946 if len(object) != 0 { 947 a.AdditionalProperties = make(map[string]TaskBinLogFilterRule) 948 for fieldName, fieldBuf := range object { 949 var fieldVal TaskBinLogFilterRule 950 err := json.Unmarshal(fieldBuf, &fieldVal) 951 if err != nil { 952 return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) 953 } 954 a.AdditionalProperties[fieldName] = fieldVal 955 } 956 } 957 return nil 958 } 959 960 // Override default JSON handling for Task_BinlogFilterRule to handle AdditionalProperties 961 func (a Task_BinlogFilterRule) MarshalJSON() ([]byte, error) { 962 var err error 963 object := make(map[string]json.RawMessage) 964 965 for fieldName, field := range a.AdditionalProperties { 966 object[fieldName], err = json.Marshal(field) 967 if err != nil { 968 return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) 969 } 970 } 971 return json.Marshal(object) 972 }