{
  "swagger": "2.0",
  "info": {
    "title": "TiDB Cloud Premium API",
    "description": "TiDB Cloud Premium API",
    "version": "v1beta2"
  },
  "tags": [
    {
      "name": "TidbService"
    }
  ],
  "host": "cloud.tidbapi.com",
  "basePath": "/v1beta2",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/tidbs": {
      "get": {
        "summary": "List TiDB Cloud Premium instances",
        "description": "Lists all TiDB Cloud Premium instances in your organization. You can filter results by service plan, region, name, or ID.",
        "operationId": "TidbService_ListTidbs",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2ListTidbsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "servicePlan",
            "description": "The plan of the service. If specified, only TiDB Cloud Premium instances of the specified plan are returned.\n\n- `Premium`: [TiDB Cloud Premium](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-premium)\n\n- `Premium_Reserved`: TiDB Cloud Premium Reserved",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "Starter",
              "Essential",
              "Premium",
              "BYOC",
              "Dedicated",
              "Premium_Reserved",
              "Essential_V2"
            ]
          },
          {
            "name": "regionIds",
            "description": "A list of region IDs. If specified, only TiDB Cloud Premium instances in these regions are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "name",
            "description": "The display name to filter by. If specified, only TiDB Cloud Premium instances whose display name contains this value are returned.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "tags",
            "description": "A list of tags. If specified, only TiDB Cloud Premium instances tagged with any of these values are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "tidbIds",
            "description": "A list of TiDB Cloud Premium instance IDs. If specified, only the ones matching these IDs are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "resourcePoolIds",
            "description": "A list of resource pool IDs. If specified, only TiDB Cloud BYOC instances in these resource pools are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "pageSize",
            "description": "The maximum number of TiDB Cloud Premium instances to return. If not specified, at most 10 will be returned. The maximum value is `100`. Values greater than `100` are set to `100`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "10"
          },
          {
            "name": "pageToken",
            "description": "The pagination token received from a previous [List TiDB Cloud Premium instances](#tag/TiDB-Instance/operation/TidbService_ListTidbs) request. Use this token to retrieve the next page of results.\n\n**Note**: When paginating, all other parameters must match the original request.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "skip",
            "description": "The number of TiDB Cloud Premium instances to skip before returning results. If the value exceeds the total number of TiDB Cloud Premium instances, the response is `200` with an empty list and no `nextPageToken`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      },
      "post": {
        "summary": "Create a TiDB Cloud Premium instance",
        "description": "Creates a new TiDB Cloud Premium instance. If the `tidb.cloud/project` label is provided, the instance will be created in the specified project.",
        "operationId": "TidbService_CreateTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidb",
            "description": "The TiDB Cloud Premium instance to create.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"displayName\": \"my-tidb\",\n  \"regionId\": \"aws-us-west-2\",\n  \"maxRcu\": 20000,\n  \"servicePlan\": \"Premium\"\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}": {
      "get": {
        "summary": "Get a TiDB Cloud Premium instance",
        "description": "Retrieves details of a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to retrieve.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      },
      "delete": {
        "summary": "Delete a TiDB Cloud Premium instance",
        "description": "Deletes a TiDB Cloud Premium instance by `tidbId`.",
        "operationId": "TidbService_DeleteTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to delete.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request DELETE 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}:resumeTidb": {
      "post": {
        "summary": "Resume a TiDB Cloud Premium instance",
        "description": "Accepts an asynchronous request to resume a paused TiDB Cloud Premium or Premium Reserved instance. Resuming an instance resumes its underlying resource pool and every instance in that pool. Poll the instance state with GetTidb to observe completion.",
        "operationId": "TidbService_ResumeTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ResumeTidbResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of a paused TiDB Cloud Premium or Premium Reserved instance.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ]
      }
    },
    "/tidbs/{tidbId}:bindTags": {
      "post": {
        "operationId": "TidbService_BindTags",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2BindTagsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2TidbServiceBindTagsBody"
            }
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}:unbindTags": {
      "post": {
        "operationId": "TidbService_UnbindTags",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2UnbindTagsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2TidbServiceUnbindTagsBody"
            }
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidb.tidbId}": {
      "patch": {
        "summary": "Update a TiDB Cloud Premium instance",
        "description": "Updates the configuration of a specific TiDB Cloud Premium instance. You can modify the following fields: `displayName` and `maxRcu`.",
        "operationId": "TidbService_UpdateTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidb.tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to update.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "tidb",
            "description": "The TiDB Cloud Premium instance to update.",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "displayName": {
                  "type": "string",
                  "example": "foo-bar",
                  "description": "The user-defined name of the TiDB Cloud Premium instance.",
                  "maxLength": 64,
                  "minLength": 4,
                  "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
                },
                "minRcu": {
                  "type": "string",
                  "format": "int64",
                  "description": "Deprecated: min_rcu is now automatically managed.\nAny value provided here will be ignored in favor of max(5000, max_rcu / 4).",
                  "readOnly": true
                },
                "maxRcu": {
                  "type": "string",
                  "format": "int64",
                  "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
                },
                "reservedCapacityTemplateId": {
                  "type": "string",
                  "format": "int64",
                  "description": "The target capacity template ID for Premium Reserved resize."
                }
              },
              "title": "The TiDB Cloud Premium instance to update.",
              "required": [
                "tidb"
              ]
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request PATCH 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"displayName\": \"my-updated-tidb\",\n  \"maxRcu\": 40000\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}:resetRootPassword": {
      "post": {
        "summary": "Reset the root password of a TiDB Cloud Premium instance",
        "description": "Sets a new password for the TiDB Cloud Premium instance's root user. The new password is not returned in the response for security reasons, so save your password in a secure location.",
        "operationId": "TidbService_ResetRootPassword",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2ResetRootPasswordResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to reset the root password.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2TidbServiceResetRootPasswordBody"
            }
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}:resetRootPassword' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"rootPassword\": \"your-new-password\"\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}/cloudProviderInfo": {
      "get": {
        "summary": "Get cloud provider information for a TiDB Cloud Premium instance",
        "description": "Retrieves the TiDB Cloud account ID and external ID for the underlying cloud infrastructure of a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetCloudProviderInfo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2CloudProviderInfo"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to retrieve cloud provider information.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/cloudProviderInfo' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs:estimatePrice": {
      "post": {
        "summary": "Estimate price",
        "description": "Estimates the cost for a TiDB Cloud Premium instance with the given configuration, including RCU and storage costs.",
        "operationId": "TidbService_EstimatePrice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2EstimatePriceResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2EstimatePriceRequest"
            }
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs:calculateMinRcu": {
      "post": {
        "summary": "Calculate minimum RCU",
        "description": "Calculates the minimum number of Request Capacity Units (RCUs) for a TiDB Cloud Premium instance based on maxRcu and server-side quota strategy.",
        "operationId": "TidbService_CalculateMinRcu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2CalculateMinRcuResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2CalculateMinRcuRequest"
            }
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/capacityOptions": {
      "get": {
        "summary": "List Premium Reserved capacity options",
        "description": "Lists visible Premium Reserved capacity options for the current organization.",
        "operationId": "TidbService_ListPremiumReservedCapacityOptions",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListPremiumReservedCapacityOptionsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}/backupPolicies": {
      "get": {
        "summary": "List backup policies",
        "description": "Lists all available backup policies for a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_ListBackupPolicies",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2ListBackupPoliciesResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}/backupSetting": {
      "get": {
        "summary": "Get backup setting",
        "description": "Retrieves the backup setting for a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetBackupSetting",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2BackupSetting"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{backupSetting.tidbId}/backupSetting": {
      "patch": {
        "summary": "Update backup setting",
        "description": "Updates the backup setting for a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_UpdateBackupSetting",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2BackupSetting"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "backupSetting.tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "backupSetting",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "backupPolicy": {
                  "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyTier"
                },
                "pitrStartTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "pitrEndTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "lastModifyTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "mode": {
                  "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupMode"
                },
                "retentionDays": {
                  "type": "integer",
                  "format": "int32",
                  "x-nullable": true
                },
                "dailyBackupTimeUtc": {
                  "type": "string",
                  "x-nullable": true
                }
              },
              "required": [
                "backupSetting"
              ]
            }
          },
          {
            "name": "validateOnly",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}/backups": {
      "get": {
        "summary": "List backups for a TiDB Cloud Premium instance",
        "description": "Lists all backups for a specific TiDB Cloud Premium instance. You can filter results by state, region, trigger type, or time range.",
        "operationId": "TidbService_ListTidbBackups",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListTidbBackupsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to list backups.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "states",
            "description": "A list of backup states. If specified, only backups matching these states are returned.\n\n - UNKNOWN: The backup state is unknown.\n - PENDING: The backup is pending.\n - RUNNING: The backup is in progress.\n - SUCCEEDED: The backup completed successfully.\n - FAILED: The backup has failed.\n - CANCELLED: The backup is cancelled.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "UNKNOWN",
                "PENDING",
                "RUNNING",
                "SUCCEEDED",
                "FAILED",
                "CANCELLED"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "regionIds",
            "description": "A list of region IDs. If specified, only backups in these regions are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "triggerTypes",
            "description": "A list of backup trigger types. If specified, only backups matching these trigger types are returned.\n\n - AUTO: The backup is triggered automatically by TiDB Cloud.\n - MANUAL: The backup is triggered manually by a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUTO",
                "MANUAL"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "startTime",
            "description": "The inclusive start of the backup time range, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If specified, only backups at or after this time are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endTime",
            "description": "The inclusive end of the backup time range, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If specified, only backups at or before this time are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "pageSize",
            "description": "The maximum number of backups to return. If not specified, at most 10 backups will be returned. The maximum value is `100`. Values greater than `100` are set to `100`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "10"
          },
          {
            "name": "pageToken",
            "description": "The pagination token received from a previous [List backups for a TiDB Cloud Premium instance](#tag/Backup/operation/TidbService_ListTidbBackups) request. Use this token to retrieve the next page of results.\n\n**Note**: When paginating, all other parameters must match the original request.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "skip",
            "description": "The number of backups to skip before returning results. If the value exceeds the total number of backups, the response is `200` with an empty list and no `nextPageToken`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "public",
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/backups' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      },
      "post": {
        "summary": "Create a backup for a TiDB Cloud Premium instance",
        "description": "Creates a manual backup for a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_CreateTidbBackup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2CreateTidbBackupResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to create a backup.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/TidbServiceCreateTidbBackupBody"
            }
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/backups' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \\\"name\\\": \\\"my-manual-backup\\\"\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}/backups/{backupId}": {
      "delete": {
        "summary": "Delete a backup for a TiDB Cloud Premium instance",
        "description": "Deletes a backup by `backupId`.",
        "operationId": "TidbService_DeleteTidbBackup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "backupId",
            "description": "The ID of the backup to delete.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request DELETE 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/backups/{backup_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs:restore": {
      "post": {
        "summary": "Restore a TiDB Cloud Premium instance from a backup",
        "description": "Restores a new TiDB Cloud Premium instance from a backup. Supported restore modes: `SNAPSHOT`, `PITR`, `DEDICATED_SNAPSHOT`, and `CLASSIC_SNAPSHOT`.",
        "operationId": "TidbService_RestoreTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2RestoreTidbResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2RestoreTidbRequest"
            }
          }
        ],
        "tags": [
          "public",
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl (SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"SNAPSHOT\",\n  \"backupId\": \"{backup_id}\"\n}'"
          },
          {
            "label": "curl (PITR)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"PITR\",\n  \"pointInTime\": \"2023-10-01T12:00:00Z\"\n}'"
          },
          {
            "label": "curl (DEDICATED_SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"DEDICATED_SNAPSHOT\",\n  \"backupId\": \"{backup_id}\"\n}'"
          },
          {
            "label": "curl (CLASSIC_SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"restoreMode\": \"CLASSIC_SNAPSHOT\",\n  \"classicBackupStorage\": {\n    \"cloudProvider\": \"aws\",\n    \"bucketUri\": \"s3://my-backup-bucket/tidb-backups/\",\n    \"auth\": {\n      \"accessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n      \"accessKeySecret\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"\n    }\n  }\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}:restoreStatus": {
      "get": {
        "summary": "Get the restore status for a TiDB Cloud Premium instance",
        "description": "Retrieves the current restore status for a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_RestoreStatus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2RestoreStatusResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}:getRestoreStatus": {
      "get": {
        "summary": "Get the restore status for a TiDB Cloud Premium instance",
        "description": "Retrieves the restore progress of a TiDB Cloud Premium instance, including the completion percentage and any error messages.",
        "operationId": "TidbService_GetRestoreStatus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2GetRestoreStatusResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}:getRestoreStatus' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs:validateClassicBackup": {
      "post": {
        "summary": "Validate classic backup",
        "description": "Validates a classic backup before restoring from it. Use this to verify the backup is valid and compatible before creating a restore request.",
        "operationId": "TidbService_ValidateClassicBackup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ValidateClassicBackupResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2ValidateClassicBackupRequest"
            }
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}/caCertificateUrl": {
      "get": {
        "summary": "Get the CA certificate download URL for a TiDB Cloud Premium instance",
        "description": "Retrieves the download URL for the CA certificate required to establish TLS (Transport Layer Security) connections to a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetCaCertificateDownloadUrl",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2CaCertificateDownloadUrl"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to retrieve the CA certificate.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "public",
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/caCertificateUrl' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs/{tidbDualLayerEncryption.tidbId}/dualLayerDataEncryption": {
      "patch": {
        "summary": "Update dual-layer data encryption for a TiDB Cloud Premium instance",
        "description": "Enable, switch, or disable the dual-layer data encryption configuration for a TiDB Cloud Premium instance.",
        "operationId": "TidbService_UpdateTidbDualLayerEncryption",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2TidbDualLayerEncryption"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbDualLayerEncryption.tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "tidbDualLayerEncryption",
            "description": "The dual-layer data encryption resource to update.",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "state": {
                  "description": "The current encryption state.",
                  "readOnly": true,
                  "allOf": [
                    {
                      "$ref": "#/definitions/v1beta2TidbDualLayerEncryptionState"
                    }
                  ]
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable status or error detail.",
                  "readOnly": true
                },
                "encryption": {
                  "description": "The encryption configuration.",
                  "allOf": [
                    {
                      "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
                    }
                  ]
                }
              },
              "title": "The dual-layer data encryption resource to update.",
              "required": [
                "tidbDualLayerEncryption"
              ]
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    },
    "/tidbs/{tidbId}/dualLayerDataEncryption": {
      "get": {
        "summary": "Get dual-layer data encryption for a TiDB Cloud Premium instance",
        "description": "Retrieves the current dual-layer data encryption configuration and status for a TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetTidbDualLayerEncryption",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2TidbDualLayerEncryption"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TidbService"
        ]
      }
    }
  },
  "definitions": {
    "TidbServiceCreateTidbBackupBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the manual backup."
        }
      },
      "required": [
        "name"
      ]
    },
    "commonv1beta1ClusterState": {
      "type": "string",
      "enum": [
        "CREATING",
        "DELETING",
        "ACTIVE",
        "RESTORING",
        "MAINTENANCE",
        "DELETED",
        "INACTIVE",
        "UPGRADING",
        "IMPORTING",
        "MODIFYING",
        "PAUSING",
        "PAUSED",
        "RESUMING"
      ],
      "description": "Enum of possible states of a cluster.\n\n - CREATING: Cluster is being created.\n - DELETING: Cluster is being deleted.\n - ACTIVE: Cluster is active for use.\n - RESTORING: Cluster data is being restored.\n - MAINTENANCE: Cluster is under maintenance.\n - DELETED: Cluster has been deleted.\n - INACTIVE: Cluster is not active, but not being deleted.\n - UPGRADING: Cluster is being updated.\nOnly for Dedicated Cluster.\n - IMPORTING: Cluster is being imported.\nOnly for Dedicated Cluster.\n - MODIFYING: Cluster is being modified.\nOnly for Dedicated Cluster.\n - PAUSING: Cluster is being paused.\nOnly for Dedicated Cluster.\n - PAUSED: Cluster is paused.\nOnly for Dedicated Cluster.\n - RESUMING: Cluster is resuming.\nOnly for Dedicated Cluster."
    },
    "commonv1beta1ServicePlan": {
      "type": "string",
      "enum": [
        "Starter",
        "Essential",
        "Premium",
        "BYOC",
        "Dedicated",
        "Premium_Reserved",
        "Essential_V2"
      ]
    },
    "commonv1beta1Tag": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "example": "tags/aaa:bbb",
          "description": "The unique name of the tag, in the format `tags/{key}:{value}`.",
          "pattern": "^tags/(.+):(.+)$"
        },
        "key": {
          "type": "string",
          "example": "env",
          "description": "The key of the tag."
        },
        "value": {
          "type": "string",
          "example": "prod",
          "description": "The value of the tag."
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "googlerpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
        },
        "message": {
          "type": "string",
          "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          },
          "description": "A list of messages that carry the error details.  There is a common set of\nmessage types for APIs to use."
        }
      },
      "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
    },
    "nextgenv1beta2Backup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier of the backup.",
          "readOnly": true
        },
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance to which the backup belongs.",
          "readOnly": true
        },
        "organizationId": {
          "type": "string",
          "description": "The ID of the organization to which the backup belongs.",
          "readOnly": true
        },
        "servicePlan": {
          "example": "Premium",
          "description": "The service plan of the backup. The possible value is `Premium`.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ServicePlan"
            }
          ]
        },
        "displayName": {
          "type": "string",
          "description": "The name of the backup.",
          "readOnly": true
        },
        "description": {
          "type": "string",
          "description": "The description of the backup."
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the backup was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "sizeBytes": {
          "type": "string",
          "format": "int64",
          "description": "The size of the backup in bytes.",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupState"
            }
          ]
        },
        "type": {
          "description": "The type of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupType"
            }
          ]
        },
        "triggerType": {
          "description": "The trigger type of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupTriggerType"
            }
          ]
        },
        "expirationTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the backup expires, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "backupTs": {
          "type": "string",
          "description": "The backup timestamp.",
          "readOnly": true
        },
        "regionId": {
          "type": "string",
          "description": "The ID of the region where the backup is stored.",
          "readOnly": true
        },
        "customerManaged": {
          "type": "boolean",
          "description": "Whether the source cluster used a customer-managed key at backup time. Combine with encryption_key_id: \"0\" means not encrypted; non-zero key id with false means SMEK; non-zero key id with true means CMEK.",
          "title": "Whether the source cluster used a customer-managed key at backup time.\nCombine with `encryption_key_id`:\n- `encryption_key_id == \"0\"`: backup was not encrypted\n- `encryption_key_id != \"0\" \u0026\u0026 customer_managed == false`: backup used SMEK\n- `encryption_key_id != \"0\" \u0026\u0026 customer_managed == true`: backup used CMEK",
          "readOnly": true
        },
        "encryptionKeyId": {
          "type": "string",
          "description": "Source cluster encryption key ID at backup time. \"0\" means no encryption key was used.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2BackupSetting": {
      "type": "object",
      "properties": {
        "tidbId": {
          "type": "string"
        },
        "backupPolicy": {
          "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyTier"
        },
        "pitrStartTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "pitrEndTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "lastModifyTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "mode": {
          "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupMode"
        },
        "retentionDays": {
          "type": "integer",
          "format": "int32",
          "x-nullable": true
        },
        "dailyBackupTimeUtc": {
          "type": "string",
          "x-nullable": true
        }
      },
      "required": [
        "tidbId"
      ]
    },
    "nextgenv1beta2BackupSettingBackupMode": {
      "type": "string",
      "enum": [
        "STANDARD_BUNDLE",
        "FLEXIBLE_RETENTION"
      ]
    },
    "nextgenv1beta2BackupSettingBackupPolicy": {
      "type": "object",
      "properties": {
        "name": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyTier"
            }
          ]
        },
        "description": {
          "type": "string",
          "readOnly": true
        },
        "pitr": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyPiTRPolicy"
            }
          ]
        },
        "hourlyBackup": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyHourlyPolicy"
            }
          ]
        },
        "dailyBackup": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyDailyPolicy"
            }
          ]
        }
      }
    },
    "nextgenv1beta2BackupSettingBackupPolicyDailyPolicy": {
      "type": "object",
      "properties": {
        "retentionDays": {
          "type": "integer",
          "format": "int32"
        },
        "startTimeUtc": {
          "type": "string"
        }
      }
    },
    "nextgenv1beta2BackupSettingBackupPolicyHourlyPolicy": {
      "type": "object",
      "properties": {
        "retentionDays": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "nextgenv1beta2BackupSettingBackupPolicyPiTRPolicy": {
      "type": "object",
      "properties": {
        "retentionDays": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "nextgenv1beta2BackupSettingBackupPolicyTier": {
      "type": "string",
      "enum": [
        "TIER1",
        "TIER2",
        "TIER3"
      ]
    },
    "nextgenv1beta2BackupState": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "PENDING",
        "RUNNING",
        "SUCCEEDED",
        "FAILED",
        "CANCELLED"
      ],
      "description": "The state of a backup.\n\n - UNKNOWN: The backup state is unknown.\n - PENDING: The backup is pending.\n - RUNNING: The backup is in progress.\n - SUCCEEDED: The backup completed successfully.\n - FAILED: The backup has failed.\n - CANCELLED: The backup is cancelled."
    },
    "nextgenv1beta2BackupStorageAuth": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "type": "string",
          "description": "The access key ID used to access the backup storage."
        },
        "accessKeySecret": {
          "type": "string",
          "description": "The access key secret used to access the backup storage."
        }
      },
      "required": [
        "accessKeyId",
        "accessKeySecret"
      ]
    },
    "nextgenv1beta2BackupTriggerType": {
      "type": "string",
      "enum": [
        "AUTO",
        "MANUAL"
      ],
      "description": "The trigger type of a backup.\n\n - AUTO: The backup is triggered automatically by TiDB Cloud.\n - MANUAL: The backup is triggered manually by a user."
    },
    "nextgenv1beta2BackupType": {
      "type": "string",
      "enum": [
        "SNAPSHOT"
      ],
      "description": "The type of a backup.\n\n - SNAPSHOT: A full snapshot backup."
    },
    "nextgenv1beta2CaCertificateDownloadUrl": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The download URL for the CA certificate of the TiDB Cloud Premium instance.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CalculateMinRcuRequest": {
      "type": "object",
      "properties": {
        "regionId": {
          "type": "string",
          "title": "Required. Region where the tidb will be created.\nFormat: {cloud_provider}-{region_code}"
        },
        "maxRcu": {
          "type": "string",
          "format": "int64",
          "description": "Required. The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
        },
        "servicePlan": {
          "description": "Required. Service plan for the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ServicePlan"
            }
          ]
        }
      },
      "required": [
        "regionId",
        "maxRcu",
        "servicePlan"
      ]
    },
    "nextgenv1beta2CalculateMinRcuResponse": {
      "type": "object",
      "properties": {
        "minRcu": {
          "type": "string",
          "format": "int64",
          "description": "The minimum number of Request Capacity Units (RCUs) calculated by server-side strategy.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ClassicBackupStorage": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "example": "aws",
          "description": "The cloud provider where the backup object storage is located.\n\n**Note**: Currently, only `\"aws\"` and `\"alicloud\"` are supported.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ]
        },
        "regionId": {
          "type": "string",
          "description": "The region where the backup object storage is located, in the format of `{cloud_provider}-{region_code}`. For example, `alicloud-cn-shanghai`.\n\nThis field is required when `cloud_provider` is `\"alicloud\"`."
        },
        "bucketUri": {
          "type": "string",
          "example": "s3://my-backup-bucket/tidb-backups/",
          "description": "The URI of the backup bucket.\n\n- For Amazon S3, use the format `s3://{bucket_name}/{path}`. For example, `s3://my-backup-bucket/tidb-backups/`.\n\n- For Alibaba Cloud OSS, use the format `oss://{bucket_name}/{path}`. For example, `oss://my-backup-bucket/tidb-backups/`."
        },
        "auth": {
          "description": "The authentication credentials for accessing the backup storage.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupStorageAuth"
            }
          ]
        }
      },
      "description": "The storage configuration for a classic backup.",
      "required": [
        "cloudProvider",
        "bucketUri",
        "auth"
      ]
    },
    "nextgenv1beta2CmekAccessIamPrincipalAliyunCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The Alibaba Cloud account ID of the CMEK IAM principal.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CmekAccessIamPrincipalAwsCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The AWS account ID of the CMEK IAM principal.",
          "readOnly": true
        },
        "externalId": {
          "type": "string",
          "description": "The AWS STS AssumeRole `ExternalId` that must be pinned in the KMS\nkey policy's `Condition` block when granting access to this principal.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ConnectionReachability": {
      "type": "object",
      "properties": {
        "reachable": {
          "type": "boolean",
          "description": "Indicates whether the endpoint is reachable.",
          "readOnly": true
        },
        "detail": {
          "description": "The detailed reachability status of the endpoint connection.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ConnectionReachabilityDetail"
            }
          ]
        }
      }
    },
    "nextgenv1beta2ConnectionReachabilityDetail": {
      "type": "object",
      "properties": {
        "serviceActive": {
          "type": "boolean",
          "description": "Indicates whether the service is active.",
          "readOnly": true
        },
        "endpointActive": {
          "type": "boolean",
          "description": "Indicates whether the endpoint is active.",
          "readOnly": true
        },
        "dnsReachable": {
          "type": "boolean",
          "description": "Indicates whether the DNS is reachable.",
          "readOnly": true
        },
        "message": {
          "type": "string",
          "description": "A human-readable message that describes the reachability status.",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CustomerManagedEncryptionKey": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The unique name of the CMEK, in the format of `cmeks/{cmek_id}`.",
          "readOnly": true
        },
        "customerManagedEncryptionKeyId": {
          "type": "string",
          "description": "The ID of the CMEK.",
          "readOnly": true
        },
        "regionId": {
          "type": "string",
          "description": "The region where the CMEK is located, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`."
        },
        "cloudProvider": {
          "description": "The cloud provider where the CMEK is located.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud (not yet supported, planned for a future release)\n\n- `\"azure\"`: Microsoft Azure (not yet supported, planned for a future release)\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ]
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        },
        "awsKms": {
          "description": "The configuration for AWS KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CustomerManagedEncryptionKeyAwsKms"
            }
          ]
        },
        "aliyunKms": {
          "description": "The configuration for Alibaba Cloud KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CustomerManagedEncryptionKeyAliyunKms"
            }
          ]
        },
        "awsPrincipal": {
          "description": "AWS IAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CmekAccessIamPrincipalAwsCmekPrincipal"
            }
          ]
        },
        "aliyunPrincipal": {
          "description": "Alibaba Cloud RAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CmekAccessIamPrincipalAliyunCmekPrincipal"
            }
          ]
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the CMEK was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        }
      },
      "required": [
        "regionId",
        "servicePlan"
      ]
    },
    "nextgenv1beta2CustomerManagedEncryptionKeyAliyunKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "type": "string",
          "description": "The Alibaba Cloud KMS key ARN used for encryption, e.g.\n`acs:kms:ap-southeast-1:5841052134823325:key/key-sgp68887a54phjt9703ut`."
        }
      },
      "required": [
        "kmsKeyArn"
      ]
    },
    "nextgenv1beta2CustomerManagedEncryptionKeyAwsKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the AWS KMS key used for encryption."
        }
      },
      "required": [
        "kmsKeyArn"
      ]
    },
    "nextgenv1beta2EstimatePriceRequest": {
      "type": "object",
      "properties": {
        "regionId": {
          "type": "string",
          "title": "Required. Region where the tidb will be created.\nFormat: {cloud_provider}-{region_code}"
        },
        "maxRcu": {
          "type": "string",
          "format": "int64",
          "description": "Optional. Required when service_plan is Premium."
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        },
        "reservedCapacityTemplateId": {
          "type": "string",
          "format": "int64",
          "description": "Optional. Required when service_plan is Premium_Reserved."
        }
      },
      "required": [
        "regionId",
        "servicePlan"
      ]
    },
    "nextgenv1beta2EstimatePriceResponse": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "type": "string",
          "readOnly": true
        },
        "region": {
          "type": "string",
          "readOnly": true
        },
        "rcu": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "rcuCostHourly": {
          "type": "string",
          "readOnly": true
        },
        "rcuCostMonthly": {
          "type": "string",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ListBackupPoliciesResponse": {
      "type": "object",
      "properties": {
        "backupPolicies": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicy"
          }
        }
      }
    },
    "nextgenv1beta2ResetRootPasswordResponse": {
      "type": "object"
    },
    "nextgenv1beta2RestoreMode": {
      "type": "string",
      "enum": [
        "SNAPSHOT",
        "PITR",
        "DEDICATED_SNAPSHOT",
        "CLASSIC_SNAPSHOT"
      ],
      "description": "The mode used to restore a TiDB Cloud Premium instance.\n\n - SNAPSHOT: Restores from native snapshot backup data of a TiDB Cloud Premium instance.\n - PITR: Restores from native point-in-time recovery (PITR) backup data of a TiDB Cloud Premium instance.\n - DEDICATED_SNAPSHOT: Restores from snapshot backup data of a TiDB Cloud Dedicated cluster.\n - CLASSIC_SNAPSHOT: Restores from snapshot backup data stored in object storage of a classic TiDB."
    },
    "nextgenv1beta2RestoreState": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "PENDING",
        "RUNNING",
        "SUCCEEDED",
        "FAILED",
        "CANCELLED"
      ],
      "description": "The current state of the restore operation.\n\n - UNKNOWN: The state of the restore operation is unknown.\n - PENDING: The restore operation is pending.\n - RUNNING: The restore operation is in progress.\n - SUCCEEDED: The restore operation completed successfully.\n - FAILED: The restore operation has failed.\n - CANCELLED: The restore operation is cancelled."
    },
    "nextgenv1beta2RestoreStatusResponse": {
      "type": "object",
      "properties": {
        "state": {
          "description": "The current state of the restore operation.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2RestoreState"
            }
          ]
        },
        "message": {
          "type": "string",
          "title": "Error message provided if the restore failed",
          "readOnly": true
        },
        "progress": {
          "type": "integer",
          "format": "int32",
          "title": "Progress percentage (0-100)",
          "readOnly": true
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
          "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
        }
      },
      "additionalProperties": {},
      "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(\u0026foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n    // or ...\n    if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n      foo = any.unpack(Foo.getDefaultInstance());\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := \u0026pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := \u0026pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": \u003cstring\u003e,\n      \"lastName\": \u003cstring\u003e\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"
    },
    "tidb_cloud_open_apinextgenv1beta2BindTagsResponse": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/commonv1beta1Tag"
          }
        }
      }
    },
    "tidb_cloud_open_apinextgenv1beta2ListTidbsResponse": {
      "type": "object",
      "properties": {
        "tidbs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
          },
          "description": "A list of TiDB Cloud Premium instances that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of TiDB Cloud Premium instances that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "The token to retrieve the next page of results. Use this value as the `pageToken` parameter in the next request. This field is empty when there are no more pages."
        }
      }
    },
    "tidb_cloud_open_apinextgenv1beta2Tidb": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The unique identifier for the TiDB Cloud Premium instance, which is generated by the API and follows the format `tidbs/{tidbId}`.",
          "readOnly": true
        },
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "displayName": {
          "type": "string",
          "example": "foo-bar",
          "description": "The user-defined name of the TiDB Cloud Premium instance.",
          "maxLength": 64,
          "minLength": 4,
          "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
        },
        "regionId": {
          "type": "string",
          "description": "The unique identifier of the region where the TiDB Cloud Premium instance is deployed, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`."
        },
        "cloudProvider": {
          "description": "The cloud provider where the TiDB Cloud Premium instance is deployed.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud\n\n- `\"azure\"`: Microsoft Azure\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ]
        },
        "regionDisplayName": {
          "type": "string",
          "description": "The display name of the region where the TiDB Cloud Premium instance is deployed. For example, `Oregon (us-west-2)`.",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the TiDB Cloud Premium instance.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ClusterState"
            }
          ]
        },
        "rootPassword": {
          "type": "string",
          "example": "my-shining-password",
          "description": "The root password of the TiDB Cloud Premium instance.\n\nThis field supports two input formats:\n- Plaintext password (legacy behavior)\n- RSA-OAEP-SHA256 encrypted payload prefixed with `rsa_oaep_sha256:`\n\nIf the marker prefix is present, the server parses and decrypts the encrypted payload.\nAny parse/decrypt failure returns an explicit parameter error without plaintext fallback.\nIf the marker prefix is absent, the value is treated as plaintext for backward compatibility.\n\nFor plaintext input, the password must be between 8 and 64 characters long and can contain letters,\nnumbers, and special characters.",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        },
        "minRcu": {
          "type": "string",
          "format": "int64",
          "description": "The minimum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.\n\nThis field is read-only and is automatically calculated as `max(5000, maxRcu / 4)`.",
          "readOnly": true
        },
        "maxRcu": {
          "type": "string",
          "format": "int64",
          "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
        },
        "servicePlan": {
          "description": "The plan of the service.\n\n- `Premium`: [TiDB Cloud Premium](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-premium)\n\n- `Premium_Reserved`: TiDB Cloud Premium Reserved",
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ServicePlan"
            }
          ]
        },
        "reservedCapacityTemplateId": {
          "type": "string",
          "format": "int64",
          "description": "The capacity template ID for Premium Reserved. This field is only accepted\nwhen `service_plan` is `Premium_Reserved`; it is not returned in responses."
        },
        "reservedCapacity": {
          "description": "The current Reserved capacity information. This field is only returned for\nPremium Reserved instances.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ReservedCapacity"
            }
          ]
        },
        "resourcePoolId": {
          "type": "string",
          "x-nullable": true,
          "description": "The resource pool selected for this TiDB Cloud instance.\nCurrently, this field is only used for TiDB Cloud BYOC instances."
        },
        "resourcePoolDisplayName": {
          "type": "string",
          "x-nullable": true,
          "description": "The current display name of the selected resource pool.\nCurrently, this field is only returned for TiDB Cloud BYOC instances.",
          "readOnly": true
        },
        "highAvailabilityType": {
          "description": "The high availability configuration for the TiDB Cloud instance.\n- `REGIONAL`: high availability across multiple availability zones within a region. For more information, see [Regional high availability architecture](https://docs.pingcap.com/tidbcloud/serverless-high-availability/#regional-high-availability-architecture).\n- `ZONAL`: high availability within a single availability zone. For more information, see [Zonal high availability architecture](https://docs.pingcap.com/tidbcloud/serverless-high-availability/#zonal-high-availability-architecture).\nTiDB Cloud Premium and Premium Reserved support only `REGIONAL`.\nIf omitted for TiDB Cloud Essential, the selected resource pool determines the value.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbHighAvailabilityType"
            }
          ]
        },
        "annotations": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The annotations for the TiDB Cloud Premium instance. The following lists some predefined annotations:\n- `tidb.cloud/has-set-password`: indicates whether the TiDB Cloud Premium instance has a root password set.\n- `tidb.cloud/available-features`: lists available features of the TiDB Cloud Premium instance."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The labels for the TiDB Cloud Premium instance.\n- `tidb.cloud/organization`: the ID of the organization where the TiDB Cloud Premium instance belongs.\n- `tidb.cloud/project`: the ID of the project where the TiDB Cloud Premium instance belongs."
        },
        "creator": {
          "type": "string",
          "description": "The email address or public API key of the user who created the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the TiDB Cloud Premium instance was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "updateTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the TiDB Cloud Premium instance was last updated, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "automaticResumeAt": {
          "type": "string",
          "format": "date-time",
          "description": "The scheduled time when the Resource Pool will automatically resume this instance's pool.\nThis field is set only while the Resource Pool is paused.",
          "readOnly": true
        },
        "endpoints": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta2TidbEndpoint"
          },
          "description": "The connection endpoints for accessing the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "dualLayerDataEncryption": {
          "description": "The dual-layer data encryption configuration for the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
            }
          ]
        },
        "tidbVersion": {
          "type": "string",
          "description": "The version of the TiDB instance.",
          "readOnly": true
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "capacityUpdateTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the capacity of the TiDB Cloud Premium instance was last updated, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        }
      },
      "required": [
        "displayName",
        "regionId",
        "maxRcu",
        "servicePlan"
      ]
    },
    "tidb_cloud_open_apinextgenv1beta2UnbindTagsResponse": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/commonv1beta1Tag"
          }
        }
      }
    },
    "v1beta1RegionCloudProvider": {
      "type": "string",
      "enum": [
        "aws",
        "gcp",
        "azure",
        "alicloud"
      ],
      "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."
    },
    "v1beta2ClassicBackupInfo": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "description": "The cloud provider where the backup object storage is located.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ]
        },
        "regionId": {
          "type": "string",
          "description": "The region where the backup object storage is located, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`.",
          "readOnly": true
        },
        "version": {
          "type": "string",
          "description": "The TiDB version of the backup data.",
          "readOnly": true
        },
        "backupTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the backup was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "sizeBytes": {
          "type": "string",
          "format": "int64",
          "description": "The backup size in bytes.",
          "readOnly": true
        }
      }
    },
    "v1beta2CloudProviderInfo": {
      "type": "object",
      "properties": {
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance."
        },
        "cloudProvider": {
          "description": "The cloud provider where the TiDB Cloud Premium instance is deployed.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud\n\n- `\"azure\"`: Microsoft Azure\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ]
        },
        "tidbCloudAccountId": {
          "type": "string",
          "description": "The TiDB Cloud account ID for the underlying cloud infrastructure of the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "tidbCloudAccountExternalId": {
          "type": "string",
          "description": "The external ID of the TiDB Cloud account, which is used for assuming Identity and Access Management (IAM) roles for cross-account access.",
          "readOnly": true
        },
        "nodeRole": {
          "type": "string",
          "description": "The node role or identity used to grant storage access.\nFor Azure, this is the kubelet identity object ID.",
          "readOnly": true
        }
      },
      "required": [
        "tidbId"
      ]
    },
    "v1beta2CreateTidbBackupResponse": {
      "type": "object",
      "properties": {
        "backupId": {
          "type": "string",
          "description": "The ID of the created backup.",
          "readOnly": true
        }
      }
    },
    "v1beta2GetRestoreStatusResponse": {
      "type": "object",
      "properties": {
        "state": {
          "description": "The current state of the restore operation.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2RestoreState"
            }
          ]
        },
        "message": {
          "type": "string",
          "description": "The detailed error message if the restore operation fails.",
          "readOnly": true
        },
        "progress": {
          "type": "integer",
          "format": "int32",
          "description": "The restore progress percentage, from `0` to `100`.",
          "readOnly": true
        }
      }
    },
    "v1beta2ListPremiumReservedCapacityOptionsResponse": {
      "type": "object",
      "properties": {
        "reservedCapacities": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta2ReservedCapacity"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1beta2ListTidbBackupsResponse": {
      "type": "object",
      "properties": {
        "backups": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/nextgenv1beta2Backup"
          },
          "description": "A list of backups that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of backups that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "The token to retrieve the next page of results. Use this value as the `pageToken` parameter in the next request. This field is empty when there are no more pages."
        }
      }
    },
    "v1beta2ReservedCapacity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "readOnly": true
        },
        "templateCode": {
          "type": "string",
          "readOnly": true
        },
        "purchasedVcpu": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "peakQps": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "workloadType": {
          "type": "string",
          "readOnly": true
        },
        "description": {
          "type": "string",
          "readOnly": true
        },
        "scope": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ReservedCapacityScope"
            }
          ]
        }
      }
    },
    "v1beta2ReservedCapacityScope": {
      "type": "string",
      "enum": [
        "DEFAULT",
        "ORG_PRIVATE"
      ]
    },
    "v1beta2RestoreTidbRequest": {
      "type": "object",
      "properties": {
        "tidb": {
          "description": "The configuration of the TiDB Cloud Premium instance to create.\n\n**Note**: Currently, only TiDB Cloud Premium instances with `servicePlan` set to `Premium` are supported.",
          "allOf": [
            {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          ]
        },
        "sourceTidbId": {
          "type": "string",
          "description": "The ID of the source TiDB Cloud Premium instance containing the backup data."
        },
        "restoreMode": {
          "$ref": "#/definitions/nextgenv1beta2RestoreMode"
        },
        "backupId": {
          "type": "string",
          "description": "The ID of the backup to restore from.\n\nThis field is required when `restoreMode` is `\"SNAPSHOT\"` or `\"DEDICATED_SNAPSHOT\"`."
        },
        "pointInTime": {
          "type": "string",
          "format": "date-time",
          "description": "The point in time to restore data to, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nThis field is required when `restoreMode` is `\"PITR\"`."
        },
        "classicBackupStorage": {
          "description": "The classic backup storage configuration.\n\nThis field is required when `restoreMode` is `\"CLASSIC_SNAPSHOT\"`.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ClassicBackupStorage"
            }
          ]
        },
        "validateOnly": {
          "type": "boolean",
          "description": "If set to `true`, the request is validated but not executed. Defaults to `false`."
        }
      },
      "required": [
        "tidb",
        "restoreMode"
      ]
    },
    "v1beta2RestoreTidbResponse": {
      "type": "object",
      "properties": {
        "tidb": {
          "description": "The restored TiDB Cloud Premium instance.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          ]
        }
      }
    },
    "v1beta2ResumeTidbResponse": {
      "type": "object"
    },
    "v1beta2TidbDualLayerDataEncryption": {
      "type": "object",
      "properties": {
        "noEncryption": {
          "type": "object",
          "properties": {},
          "description": "Disables dual-layer data encryption. The TiDB Cloud Premium instance uses the default encryption provided by the cloud provider."
        },
        "defaultKey": {
          "type": "object",
          "properties": {},
          "description": "Enables dual-layer data encryption using the TiDB Cloud default key."
        },
        "cmek": {
          "description": "Enables dual-layer data encryption using a customer-managed encryption key (CMEK).\nConfigure the key according to the cloud provider:\n- AWS: set `awsKms` and `awsPrincipal`.\n- Alibaba Cloud: set `aliyunKms` and `aliyunPrincipal`.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CustomerManagedEncryptionKey"
            }
          ]
        }
      },
      "description": "The dual-layer data encryption configuration for a TiDB Cloud Premium instance. Specify exactly one of the following options: `noEncryption`, `defaultKey`, or `cmek`."
    },
    "v1beta2TidbDualLayerEncryption": {
      "type": "object",
      "properties": {
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance."
        },
        "state": {
          "description": "The current encryption state.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerEncryptionState"
            }
          ]
        },
        "message": {
          "type": "string",
          "description": "Human-readable status or error detail.",
          "readOnly": true
        },
        "encryption": {
          "description": "The encryption configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
            }
          ]
        }
      },
      "required": [
        "tidbId"
      ]
    },
    "v1beta2TidbDualLayerEncryptionState": {
      "type": "string",
      "enum": [
        "MODIFYING",
        "ENABLED"
      ]
    },
    "v1beta2TidbEndpoint": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "The hostname of the endpoint.\n\nWhen `connectionType` is `\"PRIVATE_ENDPOINT\"`, the behavior of the `host` field varies by cloud provider:\n- For AWS, this field is available after the Private Link service is ready.\n- For Google Cloud and Azure, this field is available after you create a private endpoint connection.",
          "readOnly": true
        },
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The port number of the endpoint.",
          "readOnly": true
        },
        "connectionType": {
          "description": "The connection type of the endpoint.\n\n- `PUBLIC`: a public endpoint. For more information, see [Network](https://docs.pingcap.com/tidbcloud/connect-to-tidb-instance/#network).\n\n- `PRIVATE_ENDPOINT`: a private endpoint. For more information, see [Network](https://docs.pingcap.com/tidbcloud/connect-to-tidb-instance/#network).\n\n- `VPC_PEERING`: a VPC peering endpoint (not yet supported, planned for a future release).",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbEndpointConnectionType"
            }
          ]
        },
        "connectionReachability": {
          "description": "The reachability status of the endpoint connection.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ConnectionReachability"
            }
          ]
        },
        "egressIps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The public egress IP addresses used by the TiDB Cloud Premium instance.\n\nThis field is returned only for public endpoints. You can use these IP addresses\nto configure allowlists on upstream services when connecting through a public endpoint.",
          "readOnly": true
        }
      }
    },
    "v1beta2TidbEndpointConnectionType": {
      "type": "string",
      "enum": [
        "PUBLIC",
        "PRIVATE_ENDPOINT",
        "VPC_PEERING"
      ]
    },
    "v1beta2TidbHighAvailabilityType": {
      "type": "string",
      "enum": [
        "REGIONAL",
        "ZONAL"
      ],
      "description": "The high availability configuration for the TiDB Cloud Premium instance.\n\n - REGIONAL: High availability across multiple availability zones within a region.\n - ZONAL: High availability within a single availability zone."
    },
    "v1beta2TidbServiceBindTagsBody": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "tags"
      ]
    },
    "v1beta2TidbServiceResetRootPasswordBody": {
      "type": "object",
      "properties": {
        "rootPassword": {
          "type": "string",
          "example": "my-shining-password",
          "description": "The new root password.\n\nThis field supports two input formats:\n- Plaintext password (legacy behavior)\n- RSA-OAEP-SHA256 encrypted payload prefixed with `rsa_oaep_sha256:`\n\nIf the marker prefix is present, the server parses and decrypts the encrypted payload.\nAny parse/decrypt failure returns an explicit parameter error without plaintext fallback.\nIf the marker prefix is absent, the value is treated as plaintext for backward compatibility.\n\nFor plaintext input, the password must be between 8 and 64 characters long.",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        }
      },
      "required": [
        "rootPassword"
      ]
    },
    "v1beta2TidbServiceUnbindTagsBody": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "tags"
      ]
    },
    "v1beta2UpdateTidbRequestTidb": {
      "type": "object",
      "properties": {
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance to update."
        },
        "displayName": {
          "type": "string",
          "example": "foo-bar",
          "description": "The user-defined name of the TiDB Cloud Premium instance.",
          "maxLength": 64,
          "minLength": 4,
          "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
        },
        "minRcu": {
          "type": "string",
          "format": "int64",
          "description": "Deprecated: min_rcu is now automatically managed.\nAny value provided here will be ignored in favor of max(5000, max_rcu / 4).",
          "readOnly": true
        },
        "maxRcu": {
          "type": "string",
          "format": "int64",
          "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
        },
        "reservedCapacityTemplateId": {
          "type": "string",
          "format": "int64",
          "description": "The target capacity template ID for Premium Reserved resize."
        }
      },
      "required": [
        "tidbId"
      ]
    },
    "v1beta2ValidateClassicBackupRequest": {
      "type": "object",
      "properties": {
        "classicBackupStorage": {
          "$ref": "#/definitions/nextgenv1beta2ClassicBackupStorage"
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        }
      },
      "required": [
        "classicBackupStorage",
        "servicePlan"
      ]
    },
    "v1beta2ValidateClassicBackupResponse": {
      "type": "object",
      "properties": {
        "classicBackupInfo": {
          "title": "only return when validate pass",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ClassicBackupInfo"
            }
          ]
        }
      }
    }
  }
}
