{
  "swagger": "2.0",
  "info": {
    "title": "TiDB Cloud Premium API",
    "description": "TiDB Cloud Premium API",
    "version": "v1beta2"
  },
  "tags": [
    {
      "name": "TidbService"
    }
  ],
  "host": "cloud.tidbapi.com",
  "basePath": "/api/v2025/cloud/v1beta2",
  "schemes": ["https"],
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "paths": {
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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 BYOC resource pool IDs. If specified, only TiDB Cloud Premium 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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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}'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
                },
                "dailyBackupTimeUtc": {
                  "type": "string",
                  "x-nullable": true
                },
                "lastModifyTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "mode": {
                  "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupMode"
                },
                "pitrEndTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "pitrStartTime": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                },
                "retentionDays": {
                  "type": "integer",
                  "format": "int32",
                  "x-nullable": true
                }
              }
            }
          },
          {
            "name": "validateOnly",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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": {
                  "description": "The user-defined name of the TiDB Cloud Premium instance.",
                  "type": "string",
                  "example": "foo-bar",
                  "maxLength": 64,
                  "minLength": 4,
                  "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
                },
                "maxRcu": {
                  "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.",
                  "type": "string",
                  "format": "int64"
                },
                "minRcu": {
                  "description": "Deprecated: min_rcu is now automatically managed.\nAny value provided here will be ignored in favor of max(5000, max_rcu / 4).",
                  "type": "string",
                  "format": "int64",
                  "readOnly": true
                },
                "reservedCapacityTemplateId": {
                  "description": "The target capacity template ID for Premium Reserved resize.",
                  "type": "string",
                  "format": "int64"
                }
              },
              "title": "The TiDB Cloud Premium instance to update."
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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}'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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": {
                "encryption": {
                  "description": "The encryption configuration.",
                  "allOf": [
                    {
                      "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
                    }
                  ]
                },
                "message": {
                  "description": "Human-readable status or error detail.",
                  "type": "string",
                  "readOnly": true
                },
                "state": {
                  "description": "The current encryption state.",
                  "allOf": [
                    {
                      "$ref": "#/definitions/v1beta2TidbDualLayerEncryptionState"
                    }
                  ],
                  "readOnly": true
                }
              },
              "title": "The dual-layer data encryption resource to update."
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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": {
              "enum": ["UNKNOWN", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"],
              "type": "string"
            },
            "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": {
              "enum": ["AUTO", "MANUAL"],
              "type": "string"
            },
            "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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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}'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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}'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "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}'"
          }
        ]
      }
    },
    "/api/v2025/cloud/v1beta2/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"
            }
          },
          {
            "name": "orgId",
            "description": "Organization id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "projectId",
            "description": "Project id",
            "in": "query",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["TidbService"]
      }
    }
  },
  "definitions": {
    "TidbServiceCreateTidbBackupBody": {
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of the manual backup.",
          "type": "string"
        }
      },
      "required": ["name"]
    },
    "commonv1beta1ClusterState": {
      "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.",
      "type": "string",
      "enum": [
        "CREATING",
        "DELETING",
        "ACTIVE",
        "RESTORING",
        "MAINTENANCE",
        "DELETED",
        "INACTIVE",
        "UPGRADING",
        "IMPORTING",
        "MODIFYING",
        "PAUSING",
        "PAUSED",
        "RESUMING"
      ]
    },
    "commonv1beta1ServicePlan": {
      "type": "string",
      "enum": ["Starter", "Essential", "Premium", "BYOC", "Dedicated", "Premium_Reserved", "Essential_V2"]
    },
    "commonv1beta1Tag": {
      "type": "object",
      "properties": {
        "key": {
          "description": "The key of the tag.",
          "type": "string",
          "example": "env"
        },
        "name": {
          "description": "The unique name of the tag, in the format `tags/{key}:{value}`.",
          "type": "string",
          "example": "tags/aaa:bbb",
          "pattern": "^tags/(.+):(.+)$"
        },
        "value": {
          "description": "The value of the tag.",
          "type": "string",
          "example": "prod"
        }
      },
      "required": ["key", "value"]
    },
    "googlerpcStatus": {
      "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).",
      "type": "object",
      "properties": {
        "code": {
          "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code].",
          "type": "integer",
          "format": "int32"
        },
        "details": {
          "description": "A list of messages that carry the error details.  There is a common set of\nmessage types for APIs to use.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/protobufAny",
            "type": "object"
          }
        },
        "message": {
          "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.",
          "type": "string"
        }
      }
    },
    "nextgenv1beta2Backup": {
      "type": "object",
      "properties": {
        "backupTs": {
          "description": "The backup timestamp.",
          "type": "string",
          "readOnly": true
        },
        "createTime": {
          "description": "The timestamp when the backup was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "customerManaged": {
          "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.",
          "type": "boolean",
          "readOnly": true,
          "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\" && customer_managed == false`: backup used SMEK\n- `encryption_key_id != \"0\" && customer_managed == true`: backup used CMEK"
        },
        "description": {
          "description": "The description of the backup.",
          "type": "string"
        },
        "displayName": {
          "description": "The name of the backup.",
          "type": "string",
          "readOnly": true
        },
        "encryptionKeyId": {
          "description": "Source cluster encryption key ID at backup time. \"0\" means no encryption key was used.",
          "type": "string",
          "readOnly": true
        },
        "expirationTime": {
          "description": "The timestamp when the backup expires, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "id": {
          "description": "The unique identifier of the backup.",
          "type": "string",
          "readOnly": true
        },
        "organizationId": {
          "description": "The ID of the organization to which the backup belongs.",
          "type": "string",
          "readOnly": true
        },
        "regionId": {
          "description": "The ID of the region where the backup is stored.",
          "type": "string",
          "readOnly": true
        },
        "servicePlan": {
          "description": "The service plan of the backup. The possible value is `Premium`.",
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ServicePlan"
            }
          ],
          "readOnly": true,
          "example": "Premium"
        },
        "sizeBytes": {
          "description": "The size of the backup in bytes.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the backup.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupState"
            }
          ],
          "readOnly": true
        },
        "tidbId": {
          "description": "The ID of the TiDB Cloud Premium instance to which the backup belongs.",
          "type": "string",
          "readOnly": true
        },
        "triggerType": {
          "description": "The trigger type of the backup.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupTriggerType"
            }
          ],
          "readOnly": true
        },
        "type": {
          "description": "The type of the backup.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupType"
            }
          ],
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2BackupSetting": {
      "type": "object",
      "properties": {
        "backupPolicy": {
          "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyTier"
        },
        "dailyBackupTimeUtc": {
          "type": "string",
          "x-nullable": true
        },
        "lastModifyTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "mode": {
          "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupMode"
        },
        "pitrEndTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "pitrStartTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "retentionDays": {
          "type": "integer",
          "format": "int32",
          "x-nullable": true
        },
        "tidbId": {
          "type": "string"
        }
      },
      "required": ["tidbId"]
    },
    "nextgenv1beta2BackupSettingBackupMode": {
      "type": "string",
      "enum": ["STANDARD_BUNDLE", "FLEXIBLE_RETENTION"]
    },
    "nextgenv1beta2BackupSettingBackupPolicy": {
      "type": "object",
      "properties": {
        "dailyBackup": {
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyDailyPolicy"
            }
          ],
          "readOnly": true
        },
        "description": {
          "type": "string",
          "readOnly": true
        },
        "hourlyBackup": {
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyHourlyPolicy"
            }
          ],
          "readOnly": true
        },
        "name": {
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyTier"
            }
          ],
          "readOnly": true
        },
        "pitr": {
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicyPiTRPolicy"
            }
          ],
          "readOnly": true
        }
      }
    },
    "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": {
      "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.",
      "type": "string",
      "enum": ["UNKNOWN", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"]
    },
    "nextgenv1beta2BackupStorageAuth": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "description": "The access key ID used to access the backup storage.",
          "type": "string"
        },
        "accessKeySecret": {
          "description": "The access key secret used to access the backup storage.",
          "type": "string"
        }
      },
      "required": ["accessKeyId", "accessKeySecret"]
    },
    "nextgenv1beta2BackupTriggerType": {
      "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.",
      "type": "string",
      "enum": ["AUTO", "MANUAL"]
    },
    "nextgenv1beta2BackupType": {
      "description": "The type of a backup.\n\n - SNAPSHOT: A full snapshot backup.",
      "type": "string",
      "enum": ["SNAPSHOT"]
    },
    "nextgenv1beta2CaCertificateDownloadUrl": {
      "type": "object",
      "properties": {
        "uri": {
          "description": "The download URL for the CA certificate of the TiDB Cloud Premium instance.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CalculateMinRcuRequest": {
      "type": "object",
      "properties": {
        "maxRcu": {
          "description": "Required. The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.",
          "type": "string",
          "format": "int64"
        },
        "regionId": {
          "type": "string",
          "title": "Required. Region where the tidb will be created.\nFormat: {cloud_provider}-{region_code}"
        },
        "servicePlan": {
          "description": "Required. Service plan for the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ServicePlan"
            }
          ]
        }
      },
      "required": ["regionId", "maxRcu", "servicePlan"]
    },
    "nextgenv1beta2CalculateMinRcuResponse": {
      "type": "object",
      "properties": {
        "minRcu": {
          "description": "The minimum number of Request Capacity Units (RCUs) calculated by server-side strategy.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ClassicBackupStorage": {
      "description": "The storage configuration for a classic backup.",
      "type": "object",
      "properties": {
        "auth": {
          "description": "The authentication credentials for accessing the backup storage.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2BackupStorageAuth"
            }
          ]
        },
        "bucketUri": {
          "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/`.",
          "type": "string",
          "example": "s3://my-backup-bucket/tidb-backups/"
        },
        "cloudProvider": {
          "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"
            }
          ],
          "example": "aws"
        },
        "regionId": {
          "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\"`.",
          "type": "string"
        }
      },
      "required": ["cloudProvider", "bucketUri", "auth"]
    },
    "nextgenv1beta2CmekAccessIamPrincipalAliyunCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "description": "The Alibaba Cloud account ID of the CMEK IAM principal.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CmekAccessIamPrincipalAwsCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "description": "The AWS account ID of the CMEK IAM principal.",
          "type": "string",
          "readOnly": true
        },
        "externalId": {
          "description": "The AWS STS AssumeRole `ExternalId` that must be pinned in the KMS\nkey policy's `Condition` block when granting access to this principal.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ConnectionReachability": {
      "type": "object",
      "properties": {
        "detail": {
          "description": "The detailed reachability status of the endpoint connection.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ConnectionReachabilityDetail"
            }
          ],
          "readOnly": true
        },
        "reachable": {
          "description": "Indicates whether the endpoint is reachable.",
          "type": "boolean",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ConnectionReachabilityDetail": {
      "type": "object",
      "properties": {
        "dnsReachable": {
          "description": "Indicates whether the DNS is reachable.",
          "type": "boolean",
          "readOnly": true
        },
        "endpointActive": {
          "description": "Indicates whether the endpoint is active.",
          "type": "boolean",
          "readOnly": true
        },
        "message": {
          "description": "A human-readable message that describes the reachability status.",
          "type": "string",
          "readOnly": true
        },
        "serviceActive": {
          "description": "Indicates whether the service is active.",
          "type": "boolean",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2CustomerManagedEncryptionKey": {
      "type": "object",
      "properties": {
        "aliyunKms": {
          "description": "The configuration for Alibaba Cloud KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CustomerManagedEncryptionKeyAliyunKms"
            }
          ]
        },
        "aliyunPrincipal": {
          "description": "Alibaba Cloud RAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CmekAccessIamPrincipalAliyunCmekPrincipal"
            }
          ]
        },
        "awsKms": {
          "description": "The configuration for AWS KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CustomerManagedEncryptionKeyAwsKms"
            }
          ]
        },
        "awsPrincipal": {
          "description": "AWS IAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2CmekAccessIamPrincipalAwsCmekPrincipal"
            }
          ]
        },
        "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",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ],
          "readOnly": true
        },
        "createTime": {
          "description": "The timestamp when the CMEK was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "customerManagedEncryptionKeyId": {
          "description": "The ID of the CMEK.",
          "type": "string",
          "readOnly": true
        },
        "name": {
          "description": "The unique name of the CMEK, in the format of `cmeks/{cmek_id}`.",
          "type": "string",
          "readOnly": true
        },
        "regionId": {
          "description": "The region where the CMEK is located, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`.",
          "type": "string"
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        }
      },
      "required": ["regionId", "servicePlan"]
    },
    "nextgenv1beta2CustomerManagedEncryptionKeyAliyunKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "description": "The Alibaba Cloud KMS key ARN used for encryption, e.g.\n`acs:kms:ap-southeast-1:5841052134823325:key/key-sgp68887a54phjt9703ut`.",
          "type": "string"
        }
      },
      "required": ["kmsKeyArn"]
    },
    "nextgenv1beta2CustomerManagedEncryptionKeyAwsKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "description": "The Amazon Resource Name (ARN) of the AWS KMS key used for encryption.",
          "type": "string"
        }
      },
      "required": ["kmsKeyArn"]
    },
    "nextgenv1beta2EstimatePriceRequest": {
      "type": "object",
      "properties": {
        "maxRcu": {
          "description": "Optional. Required when service_plan is Premium.",
          "type": "string",
          "format": "int64"
        },
        "regionId": {
          "type": "string",
          "title": "Required. Region where the tidb will be created.\nFormat: {cloud_provider}-{region_code}"
        },
        "reservedCapacityTemplateId": {
          "description": "Optional. Required when service_plan is Premium_Reserved.",
          "type": "string",
          "format": "int64"
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        }
      },
      "required": ["regionId", "servicePlan"]
    },
    "nextgenv1beta2EstimatePriceResponse": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "type": "string",
          "readOnly": true
        },
        "rcu": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "rcuCostHourly": {
          "type": "string",
          "readOnly": true
        },
        "rcuCostMonthly": {
          "type": "string",
          "readOnly": true
        },
        "region": {
          "type": "string",
          "readOnly": true
        }
      }
    },
    "nextgenv1beta2ListBackupPoliciesResponse": {
      "type": "object",
      "properties": {
        "backupPolicies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/nextgenv1beta2BackupSettingBackupPolicy",
            "type": "object"
          }
        }
      }
    },
    "nextgenv1beta2ResetRootPasswordResponse": {
      "type": "object"
    },
    "nextgenv1beta2RestoreMode": {
      "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.",
      "type": "string",
      "enum": ["SNAPSHOT", "PITR", "DEDICATED_SNAPSHOT", "CLASSIC_SNAPSHOT"]
    },
    "nextgenv1beta2RestoreState": {
      "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.",
      "type": "string",
      "enum": ["UNKNOWN", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"]
    },
    "nextgenv1beta2RestoreStatusResponse": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "readOnly": true,
          "title": "Error message provided if the restore failed"
        },
        "progress": {
          "type": "integer",
          "format": "int32",
          "readOnly": true,
          "title": "Progress percentage (0-100)"
        },
        "state": {
          "description": "The current state of the restore operation.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2RestoreState"
            }
          ],
          "readOnly": true
        }
      }
    },
    "protobufAny": {
      "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(&foo)) {\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 := &pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := &pb.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\": <string>,\n      \"lastName\": <string>\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    }",
      "type": "object",
      "additionalProperties": {},
      "properties": {
        "@type": {
          "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.",
          "type": "string"
        }
      }
    },
    "tidb_cloud_open_apinextgenv1beta2BindTagsResponse": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/commonv1beta1Tag",
            "type": "object"
          }
        }
      }
    },
    "tidb_cloud_open_apinextgenv1beta2ListTidbsResponse": {
      "type": "object",
      "properties": {
        "nextPageToken": {
          "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.",
          "type": "string"
        },
        "tidbs": {
          "description": "A list of TiDB Cloud Premium instances that match the query.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb",
            "type": "object"
          }
        },
        "totalSize": {
          "description": "The total number of TiDB Cloud Premium instances that match the query.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "tidb_cloud_open_apinextgenv1beta2Tidb": {
      "type": "object",
      "properties": {
        "annotations": {
          "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.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "capacityUpdateTime": {
          "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.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "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",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ],
          "readOnly": true
        },
        "createTime": {
          "description": "The timestamp when the TiDB Cloud Premium instance was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "creator": {
          "description": "The email address or public API key of the user who created the TiDB Cloud Premium instance.",
          "type": "string",
          "readOnly": true
        },
        "displayName": {
          "description": "The user-defined name of the TiDB Cloud Premium instance.",
          "type": "string",
          "example": "foo-bar",
          "maxLength": 64,
          "minLength": 4,
          "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
        },
        "dualLayerDataEncryption": {
          "description": "The dual-layer data encryption configuration for the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
            }
          ]
        },
        "endpoints": {
          "description": "The connection endpoints for accessing the TiDB Cloud Premium instance.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta2TidbEndpoint",
            "type": "object"
          },
          "readOnly": true
        },
        "highAvailabilityType": {
          "description": "The high availability configuration for the TiDB Cloud Premium instance.\n- `REGIONAL`: high availability across multiple availability zones within a region. This is the only supported mode for TiDB Cloud Premium instances. 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. This mode is not supported for TiDB Cloud Premium instances and is reserved for other service plans. For more information, see [Zonal high availability architecture](https://docs.pingcap.com/tidbcloud/serverless-high-availability/#zonal-high-availability-architecture).",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbHighAvailabilityType"
            }
          ],
          "readOnly": true
        },
        "labels": {
          "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.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "maxRcu": {
          "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.",
          "type": "string",
          "format": "int64"
        },
        "minRcu": {
          "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)`.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "description": "The unique identifier for the TiDB Cloud Premium instance, which is generated by the API and follows the format `tidbs/{tidbId}`.",
          "type": "string",
          "readOnly": true
        },
        "regionDisplayName": {
          "description": "The display name of the region where the TiDB Cloud Premium instance is deployed. For example, `Oregon (us-west-2)`.",
          "type": "string",
          "readOnly": true
        },
        "regionId": {
          "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`.",
          "type": "string"
        },
        "reservedCapacity": {
          "description": "The current Reserved capacity information. This field is only returned for\nPremium Reserved instances.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ReservedCapacity"
            }
          ],
          "readOnly": true
        },
        "reservedCapacityTemplateId": {
          "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.",
          "type": "string",
          "format": "int64"
        },
        "resourcePoolDisplayName": {
          "description": "The current display name of the selected BYOC resource pool.",
          "type": "string",
          "readOnly": true,
          "x-nullable": true
        },
        "resourcePoolId": {
          "description": "The BYOC resource pool selected for this TiDB Cloud Premium instance.",
          "type": "string",
          "x-nullable": true
        },
        "rootPassword": {
          "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.",
          "type": "string",
          "example": "my-shining-password",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        },
        "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"
            }
          ]
        },
        "state": {
          "description": "The current state of the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/commonv1beta1ClusterState"
            }
          ],
          "readOnly": true
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tidbId": {
          "description": "The ID of the TiDB Cloud Premium instance.",
          "type": "string",
          "readOnly": true
        },
        "tidbVersion": {
          "description": "The version of the TiDB instance.",
          "type": "string",
          "readOnly": true
        },
        "updateTime": {
          "description": "The timestamp when the TiDB Cloud Premium instance was last updated, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
      },
      "required": ["displayName", "regionId", "maxRcu", "servicePlan"]
    },
    "tidb_cloud_open_apinextgenv1beta2UnbindTagsResponse": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/commonv1beta1Tag",
            "type": "object"
          }
        }
      }
    },
    "v1beta1RegionCloudProvider": {
      "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.",
      "type": "string",
      "enum": ["aws", "gcp", "azure", "alicloud"]
    },
    "v1beta2ClassicBackupInfo": {
      "type": "object",
      "properties": {
        "backupTime": {
          "description": "The timestamp when the backup was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "cloudProvider": {
          "description": "The cloud provider where the backup object storage is located.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ],
          "readOnly": true
        },
        "regionId": {
          "description": "The region where the backup object storage is located, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`.",
          "type": "string",
          "readOnly": true
        },
        "sizeBytes": {
          "description": "The backup size in bytes.",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "version": {
          "description": "The TiDB version of the backup data.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "v1beta2CloudProviderInfo": {
      "type": "object",
      "properties": {
        "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",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1RegionCloudProvider"
            }
          ],
          "readOnly": true
        },
        "nodeRole": {
          "description": "The node role or identity used to grant storage access.\nFor Azure, this is the kubelet identity object ID.",
          "type": "string",
          "readOnly": true
        },
        "tidbCloudAccountExternalId": {
          "description": "The external ID of the TiDB Cloud account, which is used for assuming Identity and Access Management (IAM) roles for cross-account access.",
          "type": "string",
          "readOnly": true
        },
        "tidbCloudAccountId": {
          "description": "The TiDB Cloud account ID for the underlying cloud infrastructure of the TiDB Cloud Premium instance.",
          "type": "string",
          "readOnly": true
        },
        "tidbId": {
          "description": "The ID of the TiDB Cloud Premium instance.",
          "type": "string"
        }
      },
      "required": ["tidbId"]
    },
    "v1beta2CreateTidbBackupResponse": {
      "type": "object",
      "properties": {
        "backupId": {
          "description": "The ID of the created backup.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "v1beta2GetRestoreStatusResponse": {
      "type": "object",
      "properties": {
        "message": {
          "description": "The detailed error message if the restore operation fails.",
          "type": "string",
          "readOnly": true
        },
        "progress": {
          "description": "The restore progress percentage, from `0` to `100`.",
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the restore operation.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2RestoreState"
            }
          ],
          "readOnly": true
        }
      }
    },
    "v1beta2ListPremiumReservedCapacityOptionsResponse": {
      "type": "object",
      "properties": {
        "nextPageToken": {
          "type": "string"
        },
        "reservedCapacities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta2ReservedCapacity",
            "type": "object"
          }
        }
      }
    },
    "v1beta2ListTidbBackupsResponse": {
      "type": "object",
      "properties": {
        "backups": {
          "description": "A list of backups that match the query.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/nextgenv1beta2Backup",
            "type": "object"
          }
        },
        "nextPageToken": {
          "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.",
          "type": "string"
        },
        "totalSize": {
          "description": "The total number of backups that match the query.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "v1beta2ReservedCapacity": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "readOnly": true
        },
        "id": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "readOnly": true
        },
        "peakQps": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "purchasedVcpu": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "scope": {
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ReservedCapacityScope"
            }
          ],
          "readOnly": true
        },
        "templateCode": {
          "type": "string",
          "readOnly": true
        },
        "workloadType": {
          "type": "string",
          "readOnly": true
        }
      }
    },
    "v1beta2ReservedCapacityScope": {
      "type": "string",
      "enum": ["DEFAULT", "ORG_PRIVATE"]
    },
    "v1beta2RestoreTidbRequest": {
      "type": "object",
      "properties": {
        "backupId": {
          "description": "The ID of the backup to restore from.\n\nThis field is required when `restoreMode` is `\"SNAPSHOT\"` or `\"DEDICATED_SNAPSHOT\"`.",
          "type": "string"
        },
        "classicBackupStorage": {
          "description": "The classic backup storage configuration.\n\nThis field is required when `restoreMode` is `\"CLASSIC_SNAPSHOT\"`.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ClassicBackupStorage"
            }
          ]
        },
        "pointInTime": {
          "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\"`.",
          "type": "string",
          "format": "date-time"
        },
        "restoreMode": {
          "$ref": "#/definitions/nextgenv1beta2RestoreMode"
        },
        "sourceTidbId": {
          "description": "The ID of the source TiDB Cloud Premium instance containing the backup data.",
          "type": "string"
        },
        "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"
            }
          ]
        },
        "validateOnly": {
          "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
          "type": "boolean"
        }
      },
      "required": ["tidb", "restoreMode"]
    },
    "v1beta2RestoreTidbResponse": {
      "type": "object",
      "properties": {
        "tidb": {
          "description": "The restored TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/tidb_cloud_open_apinextgenv1beta2Tidb"
            }
          ],
          "readOnly": true
        }
      }
    },
    "v1beta2TidbDualLayerDataEncryption": {
      "description": "The dual-layer data encryption configuration for a TiDB Cloud Premium instance. Specify exactly one of the following options: `noEncryption`, `defaultKey`, or `cmek`.",
      "type": "object",
      "properties": {
        "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"
            }
          ]
        },
        "defaultKey": {
          "description": "Enables dual-layer data encryption using the TiDB Cloud default key.",
          "type": "object",
          "properties": {}
        },
        "noEncryption": {
          "description": "Disables dual-layer data encryption. The TiDB Cloud Premium instance uses the default encryption provided by the cloud provider.",
          "type": "object",
          "properties": {}
        }
      }
    },
    "v1beta2TidbDualLayerEncryption": {
      "type": "object",
      "properties": {
        "encryption": {
          "description": "The encryption configuration.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerDataEncryption"
            }
          ]
        },
        "message": {
          "description": "Human-readable status or error detail.",
          "type": "string",
          "readOnly": true
        },
        "state": {
          "description": "The current encryption state.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbDualLayerEncryptionState"
            }
          ],
          "readOnly": true
        },
        "tidbId": {
          "description": "The ID of the TiDB Cloud Premium instance.",
          "type": "string"
        }
      },
      "required": ["tidbId"]
    },
    "v1beta2TidbDualLayerEncryptionState": {
      "type": "string",
      "enum": ["MODIFYING", "ENABLED"]
    },
    "v1beta2TidbEndpoint": {
      "type": "object",
      "properties": {
        "connectionReachability": {
          "description": "The reachability status of the endpoint connection.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2ConnectionReachability"
            }
          ],
          "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).",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbEndpointConnectionType"
            }
          ],
          "readOnly": true
        },
        "host": {
          "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.",
          "type": "string",
          "readOnly": true
        },
        "port": {
          "description": "The port number of the endpoint.",
          "type": "integer",
          "format": "int32",
          "readOnly": true
        }
      }
    },
    "v1beta2TidbEndpointConnectionType": {
      "type": "string",
      "enum": ["PUBLIC", "PRIVATE_ENDPOINT", "VPC_PEERING"]
    },
    "v1beta2TidbHighAvailabilityType": {
      "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.",
      "type": "string",
      "enum": ["REGIONAL", "ZONAL"]
    },
    "v1beta2TidbServiceBindTagsBody": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["tags"]
    },
    "v1beta2TidbServiceResetRootPasswordBody": {
      "type": "object",
      "properties": {
        "rootPassword": {
          "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.",
          "type": "string",
          "example": "my-shining-password",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        }
      },
      "required": ["rootPassword"]
    },
    "v1beta2TidbServiceUnbindTagsBody": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["tags"]
    },
    "v1beta2UpdateTidbRequestTidb": {
      "type": "object",
      "properties": {
        "displayName": {
          "description": "The user-defined name of the TiDB Cloud Premium instance.",
          "type": "string",
          "example": "foo-bar",
          "maxLength": 64,
          "minLength": 4,
          "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
        },
        "maxRcu": {
          "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.",
          "type": "string",
          "format": "int64"
        },
        "minRcu": {
          "description": "Deprecated: min_rcu is now automatically managed.\nAny value provided here will be ignored in favor of max(5000, max_rcu / 4).",
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "reservedCapacityTemplateId": {
          "description": "The target capacity template ID for Premium Reserved resize.",
          "type": "string",
          "format": "int64"
        },
        "tidbId": {
          "description": "The ID of the TiDB Cloud Premium instance to update.",
          "type": "string"
        }
      },
      "required": ["tidbId"]
    },
    "v1beta2ValidateClassicBackupRequest": {
      "type": "object",
      "properties": {
        "classicBackupStorage": {
          "$ref": "#/definitions/nextgenv1beta2ClassicBackupStorage"
        },
        "servicePlan": {
          "$ref": "#/definitions/commonv1beta1ServicePlan"
        }
      },
      "required": ["classicBackupStorage", "servicePlan"]
    },
    "v1beta2ValidateClassicBackupResponse": {
      "type": "object",
      "properties": {
        "classicBackupInfo": {
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ClassicBackupInfo"
            }
          ],
          "readOnly": true,
          "title": "only return when validate pass"
        }
      }
    }
  }
}
