Skip to content

Commit

Permalink
update cluster swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangyu committed Sep 29, 2024
1 parent 2282d4b commit a7fc3aa
Show file tree
Hide file tree
Showing 11 changed files with 858 additions and 194 deletions.
220 changes: 185 additions & 35 deletions pkg/tidbcloud/v1beta1/serverless/cluster.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"paths": {
"/clusters": {
"get": {
"summary": "Provides a list of TiDB Serverless clusters in a project.",
"summary": "Provides a list of TiDB Cloud Serverless clusters in a project.",
"operationId": "ServerlessService_ListClusters",
"responses": {
"200": {
Expand Down Expand Up @@ -121,7 +121,7 @@
},
"/clusters/{clusterId}": {
"get": {
"summary": "Retrieves details of a specific TiDB Serverless cluster.",
"summary": "Retrieves details of a specific TiDB Cloud Serverless cluster.",
"operationId": "ServerlessService_GetCluster",
"responses": {
"200": {
Expand Down Expand Up @@ -162,7 +162,7 @@
]
},
"delete": {
"summary": "Deletes a specific TiDB Serverless cluster.",
"summary": "Deletes a specific TiDB Cloud Serverless cluster.",
"operationId": "ServerlessService_DeleteCluster",
"responses": {
"200": {
Expand Down Expand Up @@ -194,7 +194,7 @@
},
"/clusters/{cluster.clusterId}": {
"patch": {
"summary": "Partially updates a specific TiDB Serverless cluster.",
"summary": "Partially updates a specific TiDB Cloud Serverless cluster.",
"operationId": "ServerlessService_PartialUpdateCluster",
"responses": {
"200": {
Expand Down Expand Up @@ -234,7 +234,7 @@
},
"/clusters/{clusterId}/password": {
"put": {
"summary": "Changes the root password of a specific TiDB Serverless cluster.",
"summary": "Changes the root password of a specific TiDB Cloud Serverless cluster.",
"operationId": "ServerlessService_ChangeRootPassword",
"responses": {
"200": {
Expand Down Expand Up @@ -274,7 +274,7 @@
},
"/regions": {
"get": {
"summary": "Provides a list of available regions for TiDB Serverless clusters.",
"summary": "Provides a list of available regions for TiDB Cloud Serverless clusters.",
"operationId": "ServerlessService_ListRegions",
"responses": {
"200": {
Expand All @@ -294,6 +294,87 @@
"ServerlessService"
]
}
},
"/clusters:batchCreate": {
"post": {
"summary": "Creates new TiDB Cloud Serverless clusters in batch.\nThe operation is atomic: it fails for all clusters or succeeds for all clusters (no partial success).",
"operationId": "ServerlessService_BatchCreateClusters",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1beta1BatchCreateClustersResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Message for requesting to create a batch of TiDB Cloud Serverless clusters.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1beta1BatchCreateClustersRequest"
}
}
],
"tags": [
"ServerlessService"
]
}
},
"/clusters:batchGet": {
"get": {
"summary": "Retrieves details of TiDB Cloud Serverless clusters in batch.\nThe operation is atomic: it fails for all clusters or succeeds for all clusters (no partial success).\nFor situations requiring partial failures, ListClusters method should be used.",
"operationId": "ServerlessService_BatchGetClusters",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1beta1BatchGetClustersResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "clusterIds",
"description": "A maximum of 1000 clusters can be get in a batch.",
"in": "query",
"required": true,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
},
{
"name": "view",
"description": "Optional. The level of detail to return for the cluster.\n\n - BASIC: Only basic information about the cluster is returned.\n - FULL: All details about the cluster are returned.",
"in": "query",
"required": false,
"type": "string",
"enum": [
"BASIC",
"FULL"
]
}
],
"tags": [
"ServerlessService"
]
}
}
},
"definitions": {
Expand Down Expand Up @@ -400,7 +481,7 @@
"description": "Required. The new root password for the cluster."
}
},
"description": "Message for requesting to change the root password of a TiDB Serverless cluster.",
"description": "Message for requesting to change the root password of a TiDB Cloud Serverless cluster.",
"required": [
"password"
]
Expand Down Expand Up @@ -501,7 +582,7 @@
"BASIC",
"FULL"
],
"description": "Enum for the different types of detail view to be returned for a TiDB Serverless cluster.\n\n - BASIC: Only basic information about the cluster is returned.\n - FULL: All details about the cluster are returned."
"description": "Enum for the different types of detail view to be returned for a TiDB Cloud Serverless cluster.\n\n - BASIC: Only basic information about the cluster is returned.\n - FULL: All details about the cluster are returned."
},
"tidb_cloud_open_apiserverlessv1beta1Cluster": {
"type": "object",
Expand Down Expand Up @@ -536,16 +617,6 @@
}
]
},
"version": {
"type": "string",
"description": "Output_only. The TiDB version of the cluster.",
"readOnly": true
},
"createdBy": {
"type": "string",
"description": "Output_only. The email of the creator of the cluster.",
"readOnly": true
},
"automatedBackupPolicy": {
"description": "Optional. Automated backup policy to set on the cluster.",
"allOf": [
Expand All @@ -554,11 +625,6 @@
}
]
},
"userPrefix": {
"type": "string",
"description": "Output_only. The unique prefix in SQL user name.",
"readOnly": true
},
"endpoints": {
"description": "Optional. The endpoints for connecting to the cluster.",
"allOf": [
Expand All @@ -567,6 +633,36 @@
}
]
},
"rootPassword": {
"type": "string",
"example": "my-shining-password",
"maxLength": 64,
"minLength": 8,
"pattern": "^.{8,64}$"
},
"encryptionConfig": {
"description": "Optional. Encryption settings for the cluster.",
"allOf": [
{
"$ref": "#/definitions/v1beta1ClusterEncryptionConfig"
}
]
},
"version": {
"type": "string",
"description": "Output_only. The TiDB version of the cluster.",
"readOnly": true
},
"createdBy": {
"type": "string",
"description": "Output_only. The email of the creator of the cluster.",
"readOnly": true
},
"userPrefix": {
"type": "string",
"description": "Output_only. The unique prefix in SQL user name.",
"readOnly": true
},
"state": {
"description": "Output_only. The current state of the cluster.",
"readOnly": true,
Expand All @@ -585,14 +681,6 @@
}
]
},
"encryptionConfig": {
"description": "Optional. Encryption settings for the cluster.",
"allOf": [
{
"$ref": "#/definitions/v1beta1ClusterEncryptionConfig"
}
]
},
"labels": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -627,6 +715,23 @@
"region"
]
},
"tidb_cloud_open_apiserverlessv1beta1CreateClusterRequest": {
"type": "object",
"properties": {
"cluster": {
"description": "Required. The cluster to be created.",
"allOf": [
{
"$ref": "#/definitions/tidb_cloud_open_apiserverlessv1beta1Cluster"
}
]
}
},
"description": "Message for requesting to create a TiDB Cloud Serverless cluster.",
"required": [
"cluster"
]
},
"tidb_cloud_open_apiserverlessv1beta1ListClustersResponse": {
"type": "object",
"properties": {
Expand All @@ -648,7 +753,7 @@
"description": "Total number of available clusters."
}
},
"description": "Responses message to the request for listing of TiDB Serverless clusters."
"description": "Responses message to the request for listing of TiDB Cloud Serverless clusters."
},
"tidb_cloud_open_apiserverlessv1beta1ListRegionsResponse": {
"type": "object",
Expand All @@ -662,11 +767,56 @@
"description": "A list of available regions."
}
},
"description": "Responses message to the request for listing of available regions in TiDB Serverless."
"description": "Responses message to the request for listing of available regions in TiDB Cloud Serverless."
},
"v1beta1BatchCreateClustersRequest": {
"type": "object",
"properties": {
"requests": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/tidb_cloud_open_apiserverlessv1beta1CreateClusterRequest"
},
"description": "The request message specifying the resources to create.\nA maximum of 1000 clusters can be created in a batch."
}
},
"description": "Message for requesting to create a batch of TiDB Cloud Serverless clusters.",
"required": [
"requests"
]
},
"v1beta1BatchCreateClustersResponse": {
"type": "object",
"properties": {
"clusters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/tidb_cloud_open_apiserverlessv1beta1Cluster"
},
"description": "Clusters created."
}
},
"description": "Responses message to the request for creating a batch of TiDB Cloud Serverless clusters."
},
"v1beta1BatchGetClustersResponse": {
"type": "object",
"properties": {
"clusters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/tidb_cloud_open_apiserverlessv1beta1Cluster"
},
"description": "Clusters created."
}
},
"description": "Responses message to the request for retrieving a batch of TiDB Cloud Serverless clusters."
},
"v1beta1ChangeRootPasswordResponse": {
"type": "object",
"description": "Responses message to the request for changing the root password of a TiDB Serverless cluster."
"description": "Responses message to the request for changing the root password of a TiDB Cloud Serverless cluster."
},
"v1beta1ClusterAutomatedBackupPolicy": {
"type": "object",
Expand Down Expand Up @@ -846,7 +996,7 @@
"description": "Required. The update mask indicating which fields are to be updated."
}
},
"description": "Message for requesting a partial update on a TiDB Serverless cluster.",
"description": "Message for requesting a partial update on a TiDB Cloud Serverless cluster.",
"required": [
"updateMask"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ model_serverless_service_change_root_password_body.go
model_serverless_service_get_cluster_view_parameter.go
model_serverlessv1beta1_cluster_view.go
model_tidb_cloud_open_apiserverlessv1beta1_cluster.go
model_tidb_cloud_open_apiserverlessv1beta1_create_cluster_request.go
model_tidb_cloud_open_apiserverlessv1beta1_list_clusters_response.go
model_tidb_cloud_open_apiserverlessv1beta1_list_regions_response.go
model_v1beta1_batch_create_clusters_request.go
model_v1beta1_batch_create_clusters_response.go
model_v1beta1_batch_get_clusters_response.go
model_v1beta1_cluster_automated_backup_policy.go
model_v1beta1_cluster_encryption_config.go
model_v1beta1_cluster_endpoints.go
Expand Down
18 changes: 12 additions & 6 deletions pkg/tidbcloud/v1beta1/serverless/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ All URIs are relative to *https://serverless.tidbapi.com/v1beta1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ServerlessServiceAPI* | [**ServerlessServiceChangeRootPassword**](docs/ServerlessServiceAPI.md#serverlessservicechangerootpassword) | **Put** /clusters/{clusterId}/password | Changes the root password of a specific TiDB Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceBatchCreateClusters**](docs/ServerlessServiceAPI.md#serverlessservicebatchcreateclusters) | **Post** /clusters:batchCreate | Creates new TiDB Cloud Serverless clusters in batch. The operation is atomic: it fails for all clusters or succeeds for all clusters (no partial success).
*ServerlessServiceAPI* | [**ServerlessServiceBatchGetClusters**](docs/ServerlessServiceAPI.md#serverlessservicebatchgetclusters) | **Get** /clusters:batchGet | Retrieves details of TiDB Cloud Serverless clusters in batch. The operation is atomic: it fails for all clusters or succeeds for all clusters (no partial success). For situations requiring partial failures, ListClusters method should be used.
*ServerlessServiceAPI* | [**ServerlessServiceChangeRootPassword**](docs/ServerlessServiceAPI.md#serverlessservicechangerootpassword) | **Put** /clusters/{clusterId}/password | Changes the root password of a specific TiDB Cloud Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceCreateCluster**](docs/ServerlessServiceAPI.md#serverlessservicecreatecluster) | **Post** /clusters | Creates a new TiDB Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceDeleteCluster**](docs/ServerlessServiceAPI.md#serverlessservicedeletecluster) | **Delete** /clusters/{clusterId} | Deletes a specific TiDB Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceGetCluster**](docs/ServerlessServiceAPI.md#serverlessservicegetcluster) | **Get** /clusters/{clusterId} | Retrieves details of a specific TiDB Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceListClusters**](docs/ServerlessServiceAPI.md#serverlessservicelistclusters) | **Get** /clusters | Provides a list of TiDB Serverless clusters in a project.
*ServerlessServiceAPI* | [**ServerlessServiceListRegions**](docs/ServerlessServiceAPI.md#serverlessservicelistregions) | **Get** /regions | Provides a list of available regions for TiDB Serverless clusters.
*ServerlessServiceAPI* | [**ServerlessServicePartialUpdateCluster**](docs/ServerlessServiceAPI.md#serverlessservicepartialupdatecluster) | **Patch** /clusters/{cluster.clusterId} | Partially updates a specific TiDB Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceDeleteCluster**](docs/ServerlessServiceAPI.md#serverlessservicedeletecluster) | **Delete** /clusters/{clusterId} | Deletes a specific TiDB Cloud Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceGetCluster**](docs/ServerlessServiceAPI.md#serverlessservicegetcluster) | **Get** /clusters/{clusterId} | Retrieves details of a specific TiDB Cloud Serverless cluster.
*ServerlessServiceAPI* | [**ServerlessServiceListClusters**](docs/ServerlessServiceAPI.md#serverlessservicelistclusters) | **Get** /clusters | Provides a list of TiDB Cloud Serverless clusters in a project.
*ServerlessServiceAPI* | [**ServerlessServiceListRegions**](docs/ServerlessServiceAPI.md#serverlessservicelistregions) | **Get** /regions | Provides a list of available regions for TiDB Cloud Serverless clusters.
*ServerlessServiceAPI* | [**ServerlessServicePartialUpdateCluster**](docs/ServerlessServiceAPI.md#serverlessservicepartialupdatecluster) | **Patch** /clusters/{cluster.clusterId} | Partially updates a specific TiDB Cloud Serverless cluster.


## Documentation For Models
Expand All @@ -103,8 +105,12 @@ Class | Method | HTTP request | Description
- [ServerlessServiceGetClusterViewParameter](docs/ServerlessServiceGetClusterViewParameter.md)
- [Serverlessv1beta1ClusterView](docs/Serverlessv1beta1ClusterView.md)
- [TidbCloudOpenApiserverlessv1beta1Cluster](docs/TidbCloudOpenApiserverlessv1beta1Cluster.md)
- [TidbCloudOpenApiserverlessv1beta1CreateClusterRequest](docs/TidbCloudOpenApiserverlessv1beta1CreateClusterRequest.md)
- [TidbCloudOpenApiserverlessv1beta1ListClustersResponse](docs/TidbCloudOpenApiserverlessv1beta1ListClustersResponse.md)
- [TidbCloudOpenApiserverlessv1beta1ListRegionsResponse](docs/TidbCloudOpenApiserverlessv1beta1ListRegionsResponse.md)
- [V1beta1BatchCreateClustersRequest](docs/V1beta1BatchCreateClustersRequest.md)
- [V1beta1BatchCreateClustersResponse](docs/V1beta1BatchCreateClustersResponse.md)
- [V1beta1BatchGetClustersResponse](docs/V1beta1BatchGetClustersResponse.md)
- [V1beta1ClusterAutomatedBackupPolicy](docs/V1beta1ClusterAutomatedBackupPolicy.md)
- [V1beta1ClusterEncryptionConfig](docs/V1beta1ClusterEncryptionConfig.md)
- [V1beta1ClusterEndpoints](docs/V1beta1ClusterEndpoints.md)
Expand Down
Loading

0 comments on commit a7fc3aa

Please sign in to comment.