Skip to content

Commit

Permalink
api(ticdc): add swagger gen back (#10791) (#10825)
Browse files Browse the repository at this point in the history
close #10790
  • Loading branch information
ti-chi-bot authored Mar 27, 2024
1 parent 3029b0d commit 12e870c
Show file tree
Hide file tree
Showing 4 changed files with 402 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ check: check-copyright generate_mock go-generate fmt check-static tidy terror_ch
@git --no-pager diff --exit-code || (echo "Please add changed files!" && false)

fast_check: check-copyright fmt check-static tidy terror_check errdoc \
check-merge-conflicts check-ticdc-dashboard check-diff-line-width check-makefiles \
check-merge-conflicts check-ticdc-dashboard check-diff-line-width swagger-spec check-makefiles \
check_cdc_integration_test check_dm_integration_test check_engine_integration_test
@git --no-pager diff --exit-code || (echo "Please add changed files!" && false)

Expand All @@ -359,6 +359,9 @@ else
go tool cover -html "$(TEST_DIR)/all_cov.out" -o "$(TEST_DIR)/all_cov.html"
endif

swagger-spec: tools/bin/swag
tools/bin/swag init --exclude dm,engine --parseVendor -generalInfo cdc/api/v1/api.go --output docs/swagger

unit_test_coverage:
grep -vE ".*.pb.go|$(CDC_PKG)/testing_utils/.*|$(CDC_PKG)/cdc/sink/simple_mysql_tester.go|.*.__failpoint_binding__.go" "$(TEST_DIR)/cov.unit.out" > "$(TEST_DIR)/unit_cov.out"
go tool cover -html "$(TEST_DIR)/unit_cov.out" -o "$(TEST_DIR)/unit_cov.html"
Expand Down
151 changes: 148 additions & 3 deletions docs/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,57 @@ var doc = `{
}
}
},
"/api/v2/changefeeds/{changefeed_id}/synced": {
"get": {
"description": "get the synced status of a changefeed",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"changefeed",
"v2"
],
"summary": "Get synced status",
"parameters": [
{
"type": "string",
"description": "changefeed_id",
"name": "changefeed_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "default",
"name": "namespace",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v2.SyncedStatus"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/model.HTTPError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.HTTPError"
}
}
}
}
},
"/api/v2/health": {
"get": {
"description": "Check the health status of a TiCDC cluster",
Expand Down Expand Up @@ -1370,9 +1421,18 @@ var doc = `{
"config.CloudStorageConfig": {
"type": "object",
"properties": {
"file-cleanup-cron-spec": {
"type": "string"
},
"file-expiration-days": {
"type": "integer"
},
"file-size": {
"type": "integer"
},
"flush-concurrency": {
"type": "integer"
},
"flush-interval": {
"type": "string"
},
Expand Down Expand Up @@ -1742,10 +1802,10 @@ var doc = `{
"description": "SendTimeout specifies the timeout for a message that has not been acknowledged by the server since sent.\nSend and SendAsync returns an error after timeout.\ndefault: 30s",
"type": "integer"
},
"tls-certificate-path": {
"tls-certificate-file": {
"type": "string"
},
"tls-private-key-path": {
"tls-key-file-path": {
"type": "string"
},
"tls-trust-certs-file-path": {
Expand All @@ -1768,7 +1828,6 @@ var doc = `{
"$ref": "#/definitions/config.CloudStorageConfig"
},
"column-selectors": {
"description": "ColumnSelectors is Deprecated.",
"type": "array",
"items": {
"$ref": "#/definitions/config.ColumnSelector"
Expand Down Expand Up @@ -2314,9 +2373,18 @@ var doc = `{
"v2.CloudStorageConfig": {
"type": "object",
"properties": {
"file_cleanup_cron_spec": {
"type": "string"
},
"file_expiration_days": {
"type": "integer"
},
"file_size": {
"type": "integer"
},
"flush_concurrency": {
"type": "integer"
},
"flush_interval": {
"type": "string"
},
Expand Down Expand Up @@ -2368,15 +2436,33 @@ var doc = `{
"v2.ConsistentConfig": {
"type": "object",
"properties": {
"compression": {
"type": "string"
},
"encoding_worker_num": {
"type": "integer"
},
"flush_concurrency": {
"type": "integer"
},
"flush_interval": {
"type": "integer"
},
"flush_worker_num": {
"type": "integer"
},
"level": {
"type": "string"
},
"max_log_size": {
"type": "integer"
},
"memory_usage": {
"$ref": "#/definitions/v2.ConsistentMemoryUsage"
},
"meta_flush_interval": {
"type": "integer"
},
"storage": {
"type": "string"
},
Expand All @@ -2385,6 +2471,17 @@ var doc = `{
}
}
},
"v2.ConsistentMemoryUsage": {
"type": "object",
"properties": {
"event_cache_percentage": {
"type": "integer"
},
"memory_quota_percentage": {
"type": "integer"
}
}
},
"v2.DispatchRule": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2537,6 +2634,9 @@ var doc = `{
}
}
},
"v2.JSONDuration": {
"type": "object"
},
"v2.KafkaConfig": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2847,6 +2947,9 @@ var doc = `{
"case_sensitive": {
"type": "boolean"
},
"changefeed_error_stuck_duration": {
"$ref": "#/definitions/v2.JSONDuration"
},
"check_gc_safe_point": {
"type": "boolean"
},
Expand Down Expand Up @@ -2880,11 +2983,17 @@ var doc = `{
"sink": {
"$ref": "#/definitions/v2.SinkConfig"
},
"sql_mode": {
"type": "string"
},
"sync_point_interval": {
"type": "string"
},
"sync_point_retention": {
"type": "string"
},
"synced_status": {
"$ref": "#/definitions/v2.SyncedStatusConfig"
}
}
},
Expand Down Expand Up @@ -3031,6 +3140,42 @@ var doc = `{
}
}
},
"v2.SyncedStatus": {
"type": "object",
"properties": {
"info": {
"type": "string"
},
"last_synced_ts": {
"type": "string"
},
"now_ts": {
"type": "string"
},
"puller_resolved_ts": {
"type": "string"
},
"sink_checkpoint_ts": {
"type": "string"
},
"synced": {
"type": "boolean"
}
}
},
"v2.SyncedStatusConfig": {
"type": "object",
"properties": {
"checkpoint_interval": {
"description": "The maximum interval between latest checkpoint ts and now or\nbetween latest sink's checkpoint ts and puller's checkpoint ts required to reach synced state",
"type": "integer"
},
"synced_check_interval": {
"description": "The minimum interval between the latest synced ts and now required to reach synced state",
"type": "integer"
}
}
},
"v2.Table": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 12e870c

Please sign in to comment.