Skip to content

Commit 5d3df11

Browse files
committed
update api to support alicloud
1 parent 8e08285 commit 5d3df11

14 files changed

+824
-110
lines changed

internal/cli/serverless/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func ListCmd(h *internal.Helper) *cobra.Command {
124124
"DisplayName",
125125
"State",
126126
"Version",
127-
"Cloud",
127+
"CloudProvider",
128128
"Region",
129129
"CreateTime",
130130
}

pkg/tidbcloud/v1beta1/serverless/cluster.swagger.json

Lines changed: 96 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,30 @@
394394
},
395395
"description": "Message for spending limit configuration."
396396
},
397+
"ClusterUsage": {
398+
"type": "object",
399+
"properties": {
400+
"requestUnit": {
401+
"type": "string",
402+
"format": "int64",
403+
"description": "Output_only. The Request Units used in this month.",
404+
"readOnly": true
405+
},
406+
"rowBasedStorage": {
407+
"type": "number",
408+
"format": "double",
409+
"description": "Output_only. The storage used on row-based storage in bytes.",
410+
"readOnly": true
411+
},
412+
"columnarStorage": {
413+
"type": "number",
414+
"format": "double",
415+
"description": "Output_only. The storage used on column-based storage in bytes.",
416+
"readOnly": true
417+
}
418+
},
419+
"description": "Message for usage statistics of a cluster."
420+
},
397421
"EndpointsPrivate": {
398422
"type": "object",
399423
"properties": {
@@ -444,10 +468,37 @@
444468
"disabled": {
445469
"type": "boolean",
446470
"description": "Optional. Whether the public endpoint is disabled."
471+
},
472+
"authorizedNetworks": {
473+
"type": "array",
474+
"items": {
475+
"type": "object",
476+
"$ref": "#/definitions/EndpointsPublicAuthorizedNetwork"
477+
},
478+
"title": "The list of networks that are allowed to connect to the cluster"
447479
}
448480
},
449481
"description": "Message for public endpoint to connect to the cluster."
450482
},
483+
"EndpointsPublicAuthorizedNetwork": {
484+
"type": "object",
485+
"properties": {
486+
"startIpAddress": {
487+
"type": "string"
488+
},
489+
"endIpAddress": {
490+
"type": "string"
491+
},
492+
"displayName": {
493+
"type": "string"
494+
}
495+
},
496+
"required": [
497+
"startIpAddress",
498+
"endIpAddress",
499+
"displayName"
500+
]
501+
},
451502
"PrivateAWS": {
452503
"type": "object",
453504
"properties": {
@@ -685,7 +736,7 @@
685736
"readOnly": true,
686737
"allOf": [
687738
{
688-
"$ref": "#/definitions/v1beta1ClusterUsage"
739+
"$ref": "#/definitions/ClusterUsage"
689740
}
690741
]
691742
},
@@ -715,6 +766,14 @@
715766
"format": "date-time",
716767
"description": "Output_only. Timestamp when the cluster was last updated.",
717768
"readOnly": true
769+
},
770+
"auditLogConfig": {
771+
"description": "Optional. The audit log configuration for the cluster.",
772+
"allOf": [
773+
{
774+
"$ref": "#/definitions/v1beta1ClusterAuditLogConfig"
775+
}
776+
]
718777
}
719778
},
720779
"description": "Message for a serverless TiDB cluster resource.",
@@ -823,12 +882,28 @@
823882
"type": "object",
824883
"description": "Responses message to the request for changing the root password of a TiDB Cloud Serverless cluster."
825884
},
885+
"v1beta1ClusterAuditLogConfig": {
886+
"type": "object",
887+
"properties": {
888+
"enabled": {
889+
"type": "boolean",
890+
"x-nullable": true,
891+
"description": "Optional. Whether audit log is enabled."
892+
},
893+
"unredacted": {
894+
"type": "boolean",
895+
"x-nullable": true,
896+
"description": "Optional. Whether unredacted the audit log."
897+
}
898+
},
899+
"description": "Message for audit log configuration."
900+
},
826901
"v1beta1ClusterAutomatedBackupPolicy": {
827902
"type": "object",
828903
"properties": {
829904
"startTime": {
830905
"type": "string",
831-
"description": "Optional. Cron expression for when automated backups should start."
906+
"description": "Optional. When automated backups should start, in HH:mm format, UTC."
832907
},
833908
"retentionDays": {
834909
"type": "integer",
@@ -871,30 +946,6 @@
871946
},
872947
"description": "Message for endpoint information for connecting to a cluster."
873948
},
874-
"v1beta1ClusterUsage": {
875-
"type": "object",
876-
"properties": {
877-
"requestUnit": {
878-
"type": "string",
879-
"format": "int64",
880-
"description": "Output_only. The Request Units used in this month.",
881-
"readOnly": true
882-
},
883-
"rowBasedStorage": {
884-
"type": "number",
885-
"format": "double",
886-
"description": "Output_only. The storage used on row-based storage in bytes.",
887-
"readOnly": true
888-
},
889-
"columnarStorage": {
890-
"type": "number",
891-
"format": "double",
892-
"description": "Output_only. The storage used on column-based storage in bytes.",
893-
"readOnly": true
894-
}
895-
},
896-
"description": "Message for usage statistics of a cluster."
897-
},
898949
"v1beta1PartialUpdateClusterRequestPartialUpdateCluster": {
899950
"type": "object",
900951
"properties": {
@@ -936,6 +987,14 @@
936987
"type": "string"
937988
},
938989
"description": "Optional. The labels for the cluster.\ntidb.cloud/organization. The label for the cluster organization id.\ntidb.cloud/project. The label for the cluster project id."
990+
},
991+
"auditLogConfig": {
992+
"description": "Optional. The audit log configuration for the cluster.",
993+
"allOf": [
994+
{
995+
"$ref": "#/definitions/v1beta1ClusterAuditLogConfig"
996+
}
997+
]
939998
}
940999
},
9411000
"required": [
@@ -947,9 +1006,10 @@
9471006
"enum": [
9481007
"aws",
9491008
"gcp",
950-
"azure"
1009+
"azure",
1010+
"alicloud"
9511011
],
952-
"description": "Enum of cloud provider names.\n\n - aws: Amazon Web Services.\nbuf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - gcp: Google Cloud Platform.\nbuf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n - azure: Microsoft Azure.\nbuf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE"
1012+
"description": "Enum of cloud provider names.\n\n - aws: Amazon Web Services.\n - gcp: Google Cloud Platform.\n - azure: Microsoft Azure.\n - alicloud: Alibaba Cloud"
9531013
},
9541014
"v1beta1ServerlessServicePartialUpdateClusterBody": {
9551015
"type": "object",
@@ -991,6 +1051,14 @@
9911051
"type": "string"
9921052
},
9931053
"description": "Optional. The labels for the cluster.\ntidb.cloud/organization. The label for the cluster organization id.\ntidb.cloud/project. The label for the cluster project id."
1054+
},
1055+
"auditLogConfig": {
1056+
"description": "Optional. The audit log configuration for the cluster.",
1057+
"allOf": [
1058+
{
1059+
"$ref": "#/definitions/v1beta1ClusterAuditLogConfig"
1060+
}
1061+
]
9941062
}
9951063
},
9961064
"description": "Required. The cluster to be updated.",

pkg/tidbcloud/v1beta1/serverless/cluster/.openapi-generator/FILES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ configuration.go
99
git_push.sh
1010
model_cluster_high_availability_type.go
1111
model_cluster_spending_limit.go
12+
model_cluster_usage.go
1213
model_commonv1beta1_cluster_state.go
1314
model_commonv1beta1_region.go
1415
model_endpoints_private.go
1516
model_endpoints_public.go
17+
model_endpoints_public_authorized_network.go
1618
model_googlerpc_status.go
1719
model_private_aws.go
1820
model_private_gcp.go
@@ -28,10 +30,10 @@ model_tidb_cloud_open_apiserverlessv1beta1_list_regions_response.go
2830
model_v1beta1_batch_create_clusters_request.go
2931
model_v1beta1_batch_create_clusters_response.go
3032
model_v1beta1_batch_get_clusters_response.go
33+
model_v1beta1_cluster_audit_log_config.go
3134
model_v1beta1_cluster_automated_backup_policy.go
3235
model_v1beta1_cluster_encryption_config.go
3336
model_v1beta1_cluster_endpoints.go
34-
model_v1beta1_cluster_usage.go
3537
model_v1beta1_partial_update_cluster_request_partial_update_cluster.go
3638
model_v1beta1_region_cloud_provider.go
3739
model_v1beta1_serverless_service_partial_update_cluster_body.go

pkg/tidbcloud/v1beta1/serverless/cluster/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ Class | Method | HTTP request | Description
9393

9494
- [ClusterHighAvailabilityType](docs/ClusterHighAvailabilityType.md)
9595
- [ClusterSpendingLimit](docs/ClusterSpendingLimit.md)
96+
- [ClusterUsage](docs/ClusterUsage.md)
9697
- [Commonv1beta1ClusterState](docs/Commonv1beta1ClusterState.md)
9798
- [Commonv1beta1Region](docs/Commonv1beta1Region.md)
9899
- [EndpointsPrivate](docs/EndpointsPrivate.md)
99100
- [EndpointsPublic](docs/EndpointsPublic.md)
101+
- [EndpointsPublicAuthorizedNetwork](docs/EndpointsPublicAuthorizedNetwork.md)
100102
- [GooglerpcStatus](docs/GooglerpcStatus.md)
101103
- [PrivateAWS](docs/PrivateAWS.md)
102104
- [PrivateGCP](docs/PrivateGCP.md)
@@ -112,10 +114,10 @@ Class | Method | HTTP request | Description
112114
- [V1beta1BatchCreateClustersRequest](docs/V1beta1BatchCreateClustersRequest.md)
113115
- [V1beta1BatchCreateClustersResponse](docs/V1beta1BatchCreateClustersResponse.md)
114116
- [V1beta1BatchGetClustersResponse](docs/V1beta1BatchGetClustersResponse.md)
117+
- [V1beta1ClusterAuditLogConfig](docs/V1beta1ClusterAuditLogConfig.md)
115118
- [V1beta1ClusterAutomatedBackupPolicy](docs/V1beta1ClusterAutomatedBackupPolicy.md)
116119
- [V1beta1ClusterEncryptionConfig](docs/V1beta1ClusterEncryptionConfig.md)
117120
- [V1beta1ClusterEndpoints](docs/V1beta1ClusterEndpoints.md)
118-
- [V1beta1ClusterUsage](docs/V1beta1ClusterUsage.md)
119121
- [V1beta1PartialUpdateClusterRequestPartialUpdateCluster](docs/V1beta1PartialUpdateClusterRequestPartialUpdateCluster.md)
120122
- [V1beta1RegionCloudProvider](docs/V1beta1RegionCloudProvider.md)
121123
- [V1beta1ServerlessServicePartialUpdateClusterBody](docs/V1beta1ServerlessServicePartialUpdateClusterBody.md)

0 commit comments

Comments
 (0)