Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ generate-v1beta1-serverless-client: install-openapi-generator ## Generate server
@echo "==> Generating serverless audit log client"
rm -rf pkg/tidbcloud/v1beta1/serverless/auditlog
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/auditlog.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/auditlog --package-name auditlog -c go/config.yaml
cd pkg && go fmt ./tidbcloud/v1beta1/serverless/... && goimports -w .
@echo "==> Generating serverless cdc client"
rm -rf pkg/tidbcloud/v1beta1/serverless/cdc
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/cdc.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/cdc --package-name cdc -c go/config.yaml
Expand Down
11 changes: 10 additions & 1 deletion internal/cli/serverless/changefeed/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ const (
"enableTls": false
},
"dataFormat": {
// "protocol": "CANAL_JSON", "AVRO", "OPEN_PROTOCOL"
// "protocol": "CANAL_JSON", "AVRO", "OPEN_PROTOCOL", "DEBEZIUM"
"protocol": "CANAL_JSON",
// available when protocol is CANAL_JSON
"enableTidbExtension": false,
// available when protocol is DEBEZIUM
"debeziumConfig": {
"disableOutputOldValue": false,
"disableSchema": false
},
// available when protocol is AVRO
"avroConfig": {
"decimalHandlingMode": "PRECISE",
Expand Down Expand Up @@ -122,6 +127,10 @@ const (
"dataFormat": {
"protocol": "CANAL_JSON",
"enableTidbExtension": false,
"debeziumConfig": {
"disableOutputOldValue": false,
"disableSchema": false
},
"avroConfig": {
"decimalHandlingMode": "PRECISE",
"bigintUnsignedHandlingMode": "LONG",
Expand Down
21 changes: 19 additions & 2 deletions pkg/tidbcloud/v1beta1/serverless/cdc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,19 @@
"endpoint"
]
},
"DebeziumConfig": {
"type": "object",
"properties": {
"disableOutputOldValue": {
"type": "boolean",
"title": "whether disable output old value, default to false"
},
"disableSchema": {
"type": "boolean",
"title": "disable schema in debezium message, default to false"
}
}
},
"DecimalHandlingMode.Enum": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1083,6 +1096,9 @@
},
"avroConfig": {
"$ref": "#/definitions/AvroConfig"
},
"debeziumConfig": {
"$ref": "#/definitions/DebeziumConfig"
}
}
},
Expand Down Expand Up @@ -1215,9 +1231,10 @@
"enum": [
"CANAL_JSON",
"OPEN_PROTOCOL",
"AVRO"
"AVRO",
"DEBEZIUM"
],
"description": " - CANAL_JSON: Canal-JSON protocol.\n - OPEN_PROTOCOL: Open Protocol.\n - AVRO: Avro protocol."
"description": " - CANAL_JSON: Canal-JSON protocol.\n - OPEN_PROTOCOL: Open Protocol.\n - AVRO: Avro protocol.\n - DEBEZIUM: Debezium protocol."
},
"KafkaType.Enum": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ model_changefeed_type_enum.go
model_changefeeds.go
model_checkpoint.go
model_confluent_schema_registry.go
model_debezium_config.go
model_decimal_handling_mode_enum.go
model_describe_schema_table_resp.go
model_event_filter_rule.go
Expand Down
1 change: 1 addition & 0 deletions pkg/tidbcloud/v1beta1/serverless/cdc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Class | Method | HTTP request | Description
- [Changefeeds](docs/Changefeeds.md)
- [Checkpoint](docs/Checkpoint.md)
- [ConfluentSchemaRegistry](docs/ConfluentSchemaRegistry.md)
- [DebeziumConfig](docs/DebeziumConfig.md)
- [DecimalHandlingModeEnum](docs/DecimalHandlingModeEnum.md)
- [DescribeSchemaTableResp](docs/DescribeSchemaTableResp.md)
- [EventFilterRule](docs/EventFilterRule.md)
Expand Down
13 changes: 13 additions & 0 deletions pkg/tidbcloud/v1beta1/serverless/cdc/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,15 @@ components:
required:
- endpoint
type: object
DebeziumConfig:
properties:
disableOutputOldValue:
title: "whether disable output old value, default to false"
type: boolean
disableSchema:
title: "disable schema in debezium message, default to false"
type: boolean
type: object
DecimalHandlingMode.Enum:
description: |2-
- PRECISE: Precise handling mode for decimals.
Expand Down Expand Up @@ -872,6 +881,8 @@ components:
type: boolean
avroConfig:
$ref: '#/components/schemas/AvroConfig'
debeziumConfig:
$ref: '#/components/schemas/DebeziumConfig'
type: object
Kafka.Network:
properties:
Expand Down Expand Up @@ -969,10 +980,12 @@ components:
- CANAL_JSON: Canal-JSON protocol.
- OPEN_PROTOCOL: Open Protocol.
- AVRO: Avro protocol.
- DEBEZIUM: Debezium protocol.
enum:
- CANAL_JSON
- OPEN_PROTOCOL
- AVRO
- DEBEZIUM
type: string
KafkaType.Enum:
description: |2-
Expand Down
190 changes: 190 additions & 0 deletions pkg/tidbcloud/v1beta1/serverless/cdc/model_debezium_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions pkg/tidbcloud/v1beta1/serverless/cdc/model_kafka_data_format.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading