{
  "swagger": "2.0",
  "info": {
    "title": "TiDB Cloud Premium API",
    "description": "*TiDB Cloud API is in beta.*\n\nThis API manages [TiDB Cloud Premium](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-premium) instances. For more information about TiDB Cloud API, see [TiDB Cloud API Overview](https://docs.pingcap.com/api/tidb-cloud-api-overview/).\n\n# Overview\n\nThe TiDB Cloud Premium API (v1beta2) provides [REST](https://en.wikipedia.org/wiki/REST) endpoints to manage TiDB Cloud Premium instances and related resources.\n\nYou can use this API to manage the following resources:\n\n- **TiDB Cloud Premium instance**: manage the lifecycle and configuration of TiDB Cloud Premium instances, including passwords, CA certificates, and cloud provider information.\n- **Backup**: manage backups for TiDB Cloud Premium instances, including backup-based restore.\n- **Region**: retrieve available regions for deploying TiDB Cloud Premium instances.\n\n# Get Started\n\nThis guide helps you make your first API call to the TiDB Cloud Premium API. You will learn how to authenticate a request, build a request, and interpret the response.\n\n1. Create a [TiDB Cloud account](https://tidbcloud.com/signup) if you do not already have one.\n2. In the [TiDB Cloud console](https://tidbcloud.com/), go to **Organization** > **API Keys** and create an API key. For more information, see [API key management](#section/Authentication/API-key-management).\n3. Make your first API call.\n\n\tTo get all TiDB Cloud Premium instances in your organization, run the following command in your terminal. Replace `YOUR_PUBLIC_KEY` and `YOUR_PRIVATE_KEY` with your own key values.\n\n\t```bash\n\tcurl --digest \\\n\t  --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n\t  --request GET \\\n\t  --url 'https://cloud.tidbapi.com/v1beta2/tidbs' \\\n\t  --header 'Accept: application/json'\n\t```\n\n4. The API returns a JSON list of your TiDB Cloud Premium instances. If none exist, the response contains an empty list.\n\n# Authentication\n\nThe TiDB Cloud API uses [HTTP Digest Authentication](https://en.wikipedia.org/wiki/Digest_access_authentication). It protects your private key from being sent over the network. For more details about HTTP Digest Authentication, refer to the [IETF RFC](https://datatracker.ietf.org/doc/html/rfc7616).\n\n## API key overview\n\n- The API key contains a public key and a private key, which act as the username and password required in the HTTP Digest Authentication. The private key only displays upon the key creation.\n- The API key belongs to your organization and acts as the `Organization Owner` role. You can check [permissions of owner](https://docs.pingcap.com/tidbcloud/manage-user-access#configure-member-roles).\n- You must provide the correct API key in every request. Otherwise, TiDB Cloud responds with a `401` error.\n\n## API key management\n\n### Create an API key\n\nOnly the **owner** of an organization can create an API key.\n\nTo create an API key in an organization, perform the following steps:\n\n1. In the [TiDB Cloud console](https://tidbcloud.com), switch to your target organization using the combo box in the upper-left corner.\n2. In the left navigation pane, click **Organization Settings** > **API Keys**.\n3. On the **API Keys** page, click **Create API Key**.\n4. Enter a description for your API key.\n5. Configure the role and scope for the API key. For more information about the permissions of a role, see [User roles](https://docs.pingcap.com/tidbcloud/manage-user-access/#user-roles).\n6. Click **Generate API Key**. Copy and save the public key and the private key.\n7. Make sure that you have copied and saved the private key in a secure location. The private key only displays upon the creation. After leaving this page, you will not be able to get the full private key again.\n8. Click **Done**.\n\n### View details of an API key\n\nTo view details of an API key, perform the following steps:\n\n1. In the [TiDB Cloud console](https://tidbcloud.com), switch to your target organization using the combo box in the upper-left corner.\n2. In the left navigation pane, click **Organization Settings** > **API Keys**.\n3. You can view the details of the API keys on the page.\n\n### Edit an API key\n\nOnly the **owner** of an organization can modify an API key.\n\nTo edit an API key in an organization, perform the following steps:\n\n1. In the [TiDB Cloud console](https://tidbcloud.com), switch to your target organization using the combo box in the upper-left corner.\n2. In the left navigation pane, click **Organization Settings** > **API Keys**.\n3. On the **API Keys** page, click **...** in the API key row that you want to change, and then click **Update Role**.\n4. You can update the description and role of the API key.\n5. Click **Update**.\n\n### Delete an API key\n\nOnly the **owner** of an organization can delete an API key.\n\nTo delete an API key in an organization, perform the following steps:\n\n1. In the [TiDB Cloud console](https://tidbcloud.com), switch to your target organization using the combo box in the upper-left corner.\n2. In the left navigation pane, click **Organization Settings** > **API Keys**.\n3. On the **API Keys** page, click **...** in the API key row that you want to delete, and then click **Delete**.\n4. Click **I understand, delete it.**\n\n# API Changelog\n\nThis changelog lists all changes to the TiDB Cloud Premium API (v1beta2).\n\n<!-- In reverse chronological order -->\n\n## 20260428\n\n- Initial release of the TiDB Cloud Premium API (v1beta2), including the following resources and endpoints:\n\t* TiDB Cloud Premium instance\n\t\t* [List TiDB Cloud Premium instances](#tag/TiDB-Instance/operation/TidbService_ListTidbs)\n\t\t* [Create a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_CreateTidb)\n\t\t* [Get a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_GetTidb)\n\t\t* [Delete a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_DeleteTidb)\n\t\t* [Update a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_UpdateTidb)\n\t\t* [Reset the root password of a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_ResetRootPassword)\n\t\t* [Get cloud provider information for a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_GetCloudProviderInfo)\n\t\t* [Get the CA certificate download URL for a TiDB Cloud Premium instance](#tag/TiDB-Instance/operation/TidbService_GetCaCertificateDownloadUrl)\n\t* Backup\n\t\t* [List backups for a TiDB Cloud Premium instance](#tag/Backup/operation/TidbService_ListTidbBackups)\n\t\t* [Delete a backup for a TiDB Cloud Premium instance](#tag/Backup/operation/TidbService_DeleteTidbBackup)\n\t\t* [Restore a TiDB Cloud Premium instance from a backup](#tag/Backup/operation/TidbService_RestoreTidb)\n\t\t* [Get restore status for a TiDB Cloud Premium instance](#tag/Backup/operation/TidbService_GetRestoreStatus)\n\t* Region\n\t\t* [List regions](#tag/Region/operation/RegionService_ListRegions)\n",
    "version": "v1beta2"
  },
  "tags": [
    {
      "name": "TiDB Cloud Premium Instance",
      "description": "Manage the lifecycle and configuration of TiDB Cloud Premium instances, including passwords, CA certificates, and cloud provider information."
    },
    {
      "name": "Backup",
      "description": "Manage backups for TiDB Cloud Premium instances, including backup-based restore."
    },
    {
      "name": "Region",
      "description": "Retrieve available regions for deploying TiDB Cloud Premium instances."
    }
  ],
  "host": "cloud.tidbapi.com",
  "basePath": "/v1beta2",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/tidbs": {
      "get": {
        "summary": "List TiDB Cloud Premium instances",
        "description": "Lists all TiDB Cloud Premium instances in your organization. You can filter results by service plan, region, name, or ID.",
        "operationId": "TidbService_ListTidbs",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListTidbsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "servicePlan",
            "description": "The plan of the service. If specified, only TiDB Cloud Premium instances of the specified plan are returned.\n\n- `Premium`: [TiDB Cloud Premium](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-premium)\n\n- `Premium_Reserved`: TiDB Cloud Premium Reserved",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "Starter",
              "Essential",
              "Premium",
              "BYOC",
              "Dedicated",
              "Premium_Reserved",
              "Essential_V2"
            ]
          },
          {
            "name": "regionIds",
            "description": "A list of region IDs. If specified, only TiDB Cloud Premium instances in these regions are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "name",
            "description": "The display name to filter by. If specified, only TiDB Cloud Premium instances whose display name contains this value are returned.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "tags",
            "description": "A list of tags. If specified, only TiDB Cloud Premium instances tagged with any of these values are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "tidbIds",
            "description": "A list of TiDB Cloud Premium instance IDs. If specified, only the ones matching these IDs are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "resourcePoolIds",
            "description": "A list of resource pool IDs. If specified, only TiDB Cloud BYOC instances in these resource pools are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "pageSize",
            "description": "The maximum number of TiDB Cloud Premium instances to return. If not specified, at most 10 will be returned. The maximum value is `100`. Values greater than `100` are set to `100`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "10"
          },
          {
            "name": "pageToken",
            "description": "The pagination token received from a previous [List TiDB Cloud Premium instances](#tag/TiDB-Instance/operation/TidbService_ListTidbs) request. Use this token to retrieve the next page of results.\n\n**Note**: When paginating, all other parameters must match the original request.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "skip",
            "description": "The number of TiDB Cloud Premium instances to skip before returning results. If the value exceeds the total number of TiDB Cloud Premium instances, the response is `200` with an empty list and no `nextPageToken`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "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/nextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidb",
            "description": "The TiDB Cloud Premium instance to create.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2Tidb"
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"displayName\": \"my-tidb\",\n  \"regionId\": \"aws-us-west-2\",\n  \"maxRcu\": 20000,\n  \"servicePlan\": \"Premium\"\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}": {
      "get": {
        "summary": "Get a TiDB Cloud Premium instance",
        "description": "Retrieves details of a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/nextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to retrieve.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "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/nextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to delete.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request DELETE 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}:resumeTidb": {
      "post": {
        "summary": "Resume a TiDB Cloud Premium instance",
        "description": "Accepts an asynchronous request to resume a paused TiDB Cloud Premium or Premium Reserved instance. Resuming an instance resumes its underlying resource pool and every instance in that pool. Poll the instance state with GetTidb to observe completion.",
        "operationId": "TidbService_ResumeTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ResumeTidbResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of a paused TiDB Cloud Premium or Premium Reserved instance.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ]
      }
    },
    "/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/nextgenv1beta2Tidb"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidb.tidbId",
            "description": "The ID of the TiDB Cloud Premium instance to update.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "tidb",
            "description": "The TiDB Cloud Premium instance to update.",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "displayName": {
                  "type": "string",
                  "example": "foo-bar",
                  "description": "The user-defined name of the TiDB Cloud Premium instance.",
                  "maxLength": 64,
                  "minLength": 4,
                  "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
                },
                "minRcu": {
                  "type": "string",
                  "format": "int64",
                  "description": "Deprecated: min_rcu is now automatically managed.\nAny value provided here will be ignored in favor of max(5000, max_rcu / 4).",
                  "readOnly": true
                },
                "maxRcu": {
                  "type": "string",
                  "format": "int64",
                  "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
                },
                "reservedCapacityTemplateId": {
                  "type": "string",
                  "format": "int64",
                  "description": "The target capacity template ID for Premium Reserved resize."
                }
              },
              "title": "The TiDB Cloud Premium instance to update.",
              "required": [
                "tidb"
              ]
            }
          },
          {
            "name": "validateOnly",
            "description": "If set to `true`, the request is validated but not executed. Defaults to `false`.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request PATCH 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"displayName\": \"my-updated-tidb\",\n  \"maxRcu\": 40000\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}:resetRootPassword": {
      "post": {
        "summary": "Reset the root password of a TiDB Cloud Premium instance",
        "description": "Sets a new password for the TiDB Cloud Premium instance's root user. The new password is not returned in the response for security reasons, so save your password in a secure location.",
        "operationId": "TidbService_ResetRootPassword",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ResetRootPasswordResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "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/TidbServiceResetRootPasswordBody"
            }
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}:resetRootPassword' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"rootPassword\": \"your-new-password\"\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}/cloudProviderInfo": {
      "get": {
        "summary": "Get cloud provider information for a TiDB Cloud Premium instance",
        "description": "Retrieves the TiDB Cloud account ID and external ID for the underlying cloud infrastructure of a specific TiDB Cloud Premium instance.",
        "operationId": "TidbService_GetCloudProviderInfo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2CloudProviderInfo"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to retrieve cloud provider information.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "TiDB Cloud Premium Instance"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/cloudProviderInfo' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs/{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/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to list backups.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "states",
            "description": "A list of backup states. If specified, only backups matching these states are returned.\n\n - UNKNOWN: The backup state is unknown.\n - PENDING: The backup is pending.\n - RUNNING: The backup is in progress.\n - SUCCEEDED: The backup completed successfully.\n - FAILED: The backup has failed.\n - CANCELLED: The backup is cancelled.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "UNKNOWN",
                "PENDING",
                "RUNNING",
                "SUCCEEDED",
                "FAILED",
                "CANCELLED"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "regionIds",
            "description": "A list of region IDs. If specified, only backups in these regions are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "triggerTypes",
            "description": "A list of backup trigger types. If specified, only backups matching these trigger types are returned.\n\n - AUTO: The backup is triggered automatically by TiDB Cloud.\n - MANUAL: The backup is triggered manually by a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUTO",
                "MANUAL"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "startTime",
            "description": "The inclusive start of the backup time range, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If specified, only backups at or after this time are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endTime",
            "description": "The inclusive end of the backup time range, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If specified, only backups at or before this time are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "pageSize",
            "description": "The maximum number of backups to return. If not specified, at most 10 backups will be returned. The maximum value is `100`. Values greater than `100` are set to `100`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "10"
          },
          {
            "name": "pageToken",
            "description": "The pagination token received from a previous [List backups for a TiDB Cloud Premium instance](#tag/Backup/operation/TidbService_ListTidbBackups) request. Use this token to retrieve the next page of results.\n\n**Note**: When paginating, all other parameters must match the original request.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "skip",
            "description": "The number of backups to skip before returning results. If the value exceeds the total number of backups, the response is `200` with an empty list and no `nextPageToken`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "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'"
          }
        ]
      }
    },
    "/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/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "backupId",
            "description": "The ID of the backup to delete.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request DELETE 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}/backups/{backup_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs:restore": {
      "post": {
        "summary": "Restore a TiDB Cloud Premium instance from a backup",
        "description": "Restores a new TiDB Cloud Premium instance from a backup. Supported restore modes: `SNAPSHOT`, `PITR`, `DEDICATED_SNAPSHOT`, and `CLASSIC_SNAPSHOT`.",
        "operationId": "TidbService_RestoreTidb",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2RestoreTidbResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1beta2RestoreTidbRequest"
            }
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl (SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"SNAPSHOT\",\n  \"backupId\": \"{backup_id}\"\n}'"
          },
          {
            "label": "curl (PITR)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"PITR\",\n  \"pointInTime\": \"2023-10-01T12:00:00Z\"\n}'"
          },
          {
            "label": "curl (DEDICATED_SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"sourceTidbId\": \"{source_tidb_id}\",\n  \"restoreMode\": \"DEDICATED_SNAPSHOT\",\n  \"backupId\": \"{backup_id}\"\n}'"
          },
          {
            "label": "curl (CLASSIC_SNAPSHOT)",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs:restore' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Content-Type: application/json' \\\n--header 'Accept: application/json' \\\n--data '{\n  \"tidb\": {\n    \"displayName\": \"my-restored-tidb\",\n    \"regionId\": \"aws-us-west-2\",\n    \"maxRcu\": 20000,\n    \"servicePlan\": \"Premium\"\n  },\n  \"restoreMode\": \"CLASSIC_SNAPSHOT\",\n  \"classicBackupStorage\": {\n    \"cloudProvider\": \"aws\",\n    \"bucketUri\": \"s3://my-backup-bucket/tidb-backups/\",\n    \"auth\": {\n      \"accessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n      \"accessKeySecret\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"\n    }\n  }\n}'"
          }
        ]
      }
    },
    "/tidbs/{tidbId}: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/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/tidbs/{tidb_id}:getRestoreStatus' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/tidbs/{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/v1beta2CaCertificateDownloadUrl"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbId",
            "description": "The ID of the TiDB Cloud Premium instance for which to retrieve the CA certificate.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "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'"
          }
        ]
      }
    },
    "/backups": {
      "get": {
        "summary": "List backups",
        "description": "Lists all backups in your organization. You can filter results by TiDB Cloud Premium instance, state, service plan, region, or time range.",
        "operationId": "BackupService_ListBackups",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListBackupsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "tidbIds",
            "description": "A list of TiDB Cloud Premium instance IDs. If specified, only backups belonging to these TiDB Cloud Premium instances are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "states",
            "description": "A list of backup states. If specified, only backups with these states are returned.\n\n - UNKNOWN: The backup state is unknown.\n - PENDING: The backup is pending.\n - RUNNING: The backup is in progress.\n - SUCCEEDED: The backup completed successfully.\n - FAILED: The backup has failed.\n - CANCELLED: The backup is cancelled.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "UNKNOWN",
                "PENDING",
                "RUNNING",
                "SUCCEEDED",
                "FAILED",
                "CANCELLED"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "servicePlans",
            "description": "A list of service plans. If specified, only backups belonging to these service plans are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Starter",
                "Essential",
                "Premium",
                "BYOC",
                "Dedicated",
                "Premium_Reserved",
                "Essential_V2"
              ]
            },
            "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": "tidbStates",
            "description": "A list of TiDB Cloud Premium instance states. If specified, only backups from TiDB Cloud Premium instances in these states are returned.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "DELETED"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "triggerTypes",
            "description": "A list of trigger types. If specified, only backups with these trigger types are returned.\n\n - AUTO: The backup is triggered automatically by TiDB Cloud.\n - MANUAL: The backup is triggered manually by a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AUTO",
                "MANUAL"
              ]
            },
            "collectionFormat": "multi"
          },
          {
            "name": "startTime",
            "description": "The start time of the time range filter. If specified, only backups created after this time are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "endTime",
            "description": "The end time of the time range filter. If specified, only backups created 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.\nThe 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 `ListBackups` 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 individual resources to skip before starting to return results.\nIf the skip value causes the cursor to move past the end of the collection,\nthe response will be 200 OK with an empty result set and no next_page_token.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/backups' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/backups/{backupId}": {
      "delete": {
        "summary": "Delete a backup",
        "description": "Deletes a backup by `backupId`.",
        "operationId": "BackupService_DeleteBackup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "backupId",
            "description": "The ID of the backup to delete.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Backup"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location --request DELETE 'https://cloud.tidbapi.com/v1beta2/backups/{backup_id}' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    },
    "/regions": {
      "get": {
        "summary": "List regions",
        "description": "Lists the regions where you can create a TiDB Cloud Premium instance. You can filter results by cloud provider or service plan.",
        "operationId": "RegionService_ListRegions",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1beta2ListRegionsResponse"
            }
          },
          "400": {
            "description": "A request field is invalid.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "401": {
            "description": "The API key cannot be authenticated.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "403": {
            "description": "The API key does not have permission to access the resource.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "429": {
            "description": "You have exceeded the rate limit.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "500": {
            "description": "Internal server error.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "cloudProvider",
            "description": "The cloud provider. If specified, only regions belonging to the specified cloud provider are returned.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "servicePlan",
            "description": "The plan of the service. If specified, only regions that support the specified service plan are returned.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "Starter",
              "Essential",
              "Premium",
              "BYOC",
              "Dedicated",
              "Premium_Reserved",
              "Essential_V2"
            ]
          },
          {
            "name": "pageSize",
            "description": "The maximum number of regions to return. If not specified, at most 10 regions 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 regions](#tag/Region/operation/RegionService_ListRegions) 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 regions to skip before returning results. If the value exceeds the total number of regions, the response is `200` with an empty list and no `nextPageToken`.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Region"
        ],
        "x-code-samples": [
          {
            "label": "curl",
            "lang": "curl",
            "source": "curl --location 'https://cloud.tidbapi.com/v1beta2/regions' \\\n--digest --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \\\n--header 'Accept: application/json'"
          }
        ]
      }
    }
  },
  "definitions": {
    "BackupTriggerType": {
      "type": "string",
      "enum": [
        "AUTO",
        "MANUAL"
      ],
      "description": "The trigger type of a backup.\n\n - AUTO: The backup is triggered automatically by TiDB Cloud.\n - MANUAL: The backup is triggered manually by a user."
    },
    "CmekAccessIamPrincipalAliyunCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The Alibaba Cloud account ID of the CMEK IAM principal.",
          "readOnly": true
        }
      }
    },
    "CmekAccessIamPrincipalAwsCmekPrincipal": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "The AWS account ID of the CMEK IAM principal.",
          "readOnly": true
        },
        "externalId": {
          "type": "string",
          "description": "The AWS STS AssumeRole `ExternalId` that must be pinned in the KMS\nkey policy's `Condition` block when granting access to this principal.",
          "readOnly": true
        }
      }
    },
    "ConnectionReachabilityDetail": {
      "type": "object",
      "properties": {
        "serviceActive": {
          "type": "boolean",
          "description": "Indicates whether the service is active.",
          "readOnly": true
        },
        "endpointActive": {
          "type": "boolean",
          "description": "Indicates whether the endpoint is active.",
          "readOnly": true
        },
        "dnsReachable": {
          "type": "boolean",
          "description": "Indicates whether the DNS is reachable.",
          "readOnly": true
        },
        "message": {
          "type": "string",
          "description": "A human-readable message that describes the reachability status.",
          "readOnly": true
        }
      }
    },
    "CustomerManagedEncryptionKeyAliyunKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "type": "string",
          "description": "The Alibaba Cloud KMS key ARN used for encryption, e.g.\n`acs:kms:ap-southeast-1:5841052134823325:key/key-sgp68887a54phjt9703ut`."
        }
      },
      "required": [
        "kmsKeyArn"
      ]
    },
    "CustomerManagedEncryptionKeyAwsKms": {
      "type": "object",
      "properties": {
        "kmsKeyArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the AWS KMS key used for encryption."
        }
      },
      "required": [
        "kmsKeyArn"
      ]
    },
    "EndpointConnectionType": {
      "type": "string",
      "enum": [
        "PUBLIC",
        "PRIVATE_ENDPOINT",
        "VPC_PEERING"
      ]
    },
    "RegionCloudProvider": {
      "type": "string",
      "enum": [
        "aws",
        "gcp",
        "azure",
        "alicloud"
      ],
      "description": "Enum of cloud provider names.\n\n - aws: Amazon Web Services.\n - gcp: Google Cloud Platform.\n - azure: Microsoft Azure.\n - alicloud: Alibaba Cloud."
    },
    "ReservedCapacityScope": {
      "type": "string",
      "enum": [
        "DEFAULT",
        "ORG_PRIVATE"
      ]
    },
    "TidbDualLayerDataEncryption": {
      "type": "object",
      "properties": {
        "noEncryption": {
          "type": "object",
          "properties": {},
          "description": "Disables dual-layer data encryption. The TiDB Cloud Premium instance uses the default encryption provided by the cloud provider."
        },
        "defaultKey": {
          "type": "object",
          "properties": {},
          "description": "Enables dual-layer data encryption using the TiDB Cloud default key."
        },
        "cmek": {
          "description": "Enables dual-layer data encryption using a customer-managed encryption key (CMEK).\nConfigure the key according to the cloud provider:\n- AWS: set `awsKms` and `awsPrincipal`.\n- Alibaba Cloud: set `aliyunKms` and `aliyunPrincipal`.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2CustomerManagedEncryptionKey"
            }
          ]
        }
      },
      "description": "The dual-layer data encryption configuration for a TiDB Cloud Premium instance. Specify exactly one of the following options: `noEncryption`, `defaultKey`, or `cmek`."
    },
    "TidbEndpoint": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "The hostname of the endpoint.\n\nWhen `connectionType` is `\"PRIVATE_ENDPOINT\"`, the behavior of the `host` field varies by cloud provider:\n- For AWS, this field is available after the Private Link service is ready.\n- For Google Cloud and Azure, this field is available after you create a private endpoint connection.",
          "readOnly": true
        },
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The port number of the endpoint.",
          "readOnly": true
        },
        "connectionType": {
          "description": "The connection type of the endpoint.\n\n- `PUBLIC`: a public endpoint. For more information, see [Network](https://docs.pingcap.com/tidbcloud/connect-to-tidb-instance/#network).\n\n- `PRIVATE_ENDPOINT`: a private endpoint. For more information, see [Network](https://docs.pingcap.com/tidbcloud/connect-to-tidb-instance/#network).\n\n- `VPC_PEERING`: a VPC peering endpoint (not yet supported, planned for a future release).",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/EndpointConnectionType"
            }
          ]
        },
        "connectionReachability": {
          "description": "The reachability status of the endpoint connection.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ConnectionReachability"
            }
          ]
        },
        "egressIps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The public egress IP addresses used by the TiDB Cloud Premium instance.\n\nThis field is returned only for public endpoints. You can use these IP addresses\nto configure allowlists on upstream services when connecting through a public endpoint.",
          "readOnly": true
        }
      }
    },
    "TidbServiceResetRootPasswordBody": {
      "type": "object",
      "properties": {
        "rootPassword": {
          "type": "string",
          "example": "my-shining-password",
          "description": "The new root password.\n\nThis field supports two input formats:\n- Plaintext password (legacy behavior)\n- RSA-OAEP-SHA256 encrypted payload prefixed with `rsa_oaep_sha256:`\n\nIf the marker prefix is present, the server parses and decrypts the encrypted payload.\nAny parse/decrypt failure returns an explicit parameter error without plaintext fallback.\nIf the marker prefix is absent, the value is treated as plaintext for backward compatibility.\n\nFor plaintext input, the password must be between 8 and 64 characters long.",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        }
      },
      "required": [
        "rootPassword"
      ]
    },
    "nextgenv1beta2Tidb": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The unique identifier for the TiDB Cloud Premium instance, which is generated by the API and follows the format `tidbs/{tidbId}`.",
          "readOnly": true
        },
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "displayName": {
          "type": "string",
          "example": "foo-bar",
          "description": "The user-defined name of the TiDB Cloud Premium instance.",
          "maxLength": 64,
          "minLength": 4,
          "pattern": "^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$"
        },
        "regionId": {
          "type": "string",
          "description": "The unique identifier of the region where the TiDB Cloud Premium instance is deployed, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`."
        },
        "cloudProvider": {
          "description": "The cloud provider where the TiDB Cloud Premium instance is deployed.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud\n\n- `\"azure\"`: Microsoft Azure\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/RegionCloudProvider"
            }
          ]
        },
        "regionDisplayName": {
          "type": "string",
          "description": "The display name of the region where the TiDB Cloud Premium instance is deployed. For example, `Oregon (us-west-2)`.",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the TiDB Cloud Premium instance.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1ClusterState"
            }
          ]
        },
        "rootPassword": {
          "type": "string",
          "example": "my-shining-password",
          "description": "The root password of the TiDB Cloud Premium instance.\n\nThis field supports two input formats:\n- Plaintext password (legacy behavior)\n- RSA-OAEP-SHA256 encrypted payload prefixed with `rsa_oaep_sha256:`\n\nIf the marker prefix is present, the server parses and decrypts the encrypted payload.\nAny parse/decrypt failure returns an explicit parameter error without plaintext fallback.\nIf the marker prefix is absent, the value is treated as plaintext for backward compatibility.\n\nFor plaintext input, the password must be between 8 and 64 characters long and can contain letters,\nnumbers, and special characters.",
          "pattern": "^(rsa_oaep_sha256:.+|.{8,64})$"
        },
        "minRcu": {
          "type": "string",
          "format": "int64",
          "description": "The minimum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance.\n\nThis field is read-only and is automatically calculated as `max(5000, maxRcu / 4)`.",
          "readOnly": true
        },
        "maxRcu": {
          "type": "string",
          "format": "int64",
          "description": "The maximum number of Request Capacity Units (RCUs) for the TiDB Cloud Premium instance."
        },
        "servicePlan": {
          "description": "The plan of the service.\n\n- `Premium`: [TiDB Cloud Premium](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-premium)\n\n- `Premium_Reserved`: TiDB Cloud Premium Reserved",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1ServicePlan"
            }
          ]
        },
        "reservedCapacityTemplateId": {
          "type": "string",
          "format": "int64",
          "description": "The capacity template ID for Premium Reserved. This field is only accepted\nwhen `service_plan` is `Premium_Reserved`; it is not returned in responses."
        },
        "reservedCapacity": {
          "description": "The current Reserved capacity information. This field is only returned for\nPremium Reserved instances.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ReservedCapacity"
            }
          ]
        },
        "resourcePoolId": {
          "type": "string",
          "x-nullable": true,
          "description": "The resource pool selected for this TiDB Cloud instance.\nCurrently, this field is only used for TiDB Cloud BYOC instances."
        },
        "resourcePoolDisplayName": {
          "type": "string",
          "x-nullable": true,
          "description": "The current display name of the selected resource pool.\nCurrently, this field is only returned for TiDB Cloud BYOC instances.",
          "readOnly": true
        },
        "highAvailabilityType": {
          "description": "The high availability configuration for the TiDB Cloud instance.\n- `REGIONAL`: high availability across multiple availability zones within a region. For more information, see [Regional high availability architecture](https://docs.pingcap.com/tidbcloud/serverless-high-availability/#regional-high-availability-architecture).\n- `ZONAL`: high availability within a single availability zone. For more information, see [Zonal high availability architecture](https://docs.pingcap.com/tidbcloud/serverless-high-availability/#zonal-high-availability-architecture).\nTiDB Cloud Premium and Premium Reserved support only `REGIONAL`.\nIf omitted for TiDB Cloud Essential, the selected resource pool determines the value.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2TidbHighAvailabilityType"
            }
          ]
        },
        "annotations": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The annotations for the TiDB Cloud Premium instance. The following lists some predefined annotations:\n- `tidb.cloud/has-set-password`: indicates whether the TiDB Cloud Premium instance has a root password set.\n- `tidb.cloud/available-features`: lists available features of the TiDB Cloud Premium instance."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The labels for the TiDB Cloud Premium instance.\n- `tidb.cloud/organization`: the ID of the organization where the TiDB Cloud Premium instance belongs.\n- `tidb.cloud/project`: the ID of the project where the TiDB Cloud Premium instance belongs."
        },
        "creator": {
          "type": "string",
          "description": "The email address or public API key of the user who created the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the TiDB Cloud Premium instance was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "updateTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the TiDB Cloud Premium instance was last updated, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "automaticResumeAt": {
          "type": "string",
          "format": "date-time",
          "description": "The scheduled time when the Resource Pool will automatically resume this instance's pool.\nThis field is set only while the Resource Pool is paused.",
          "readOnly": true
        },
        "endpoints": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/TidbEndpoint"
          },
          "description": "The connection endpoints for accessing the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "dualLayerDataEncryption": {
          "description": "The dual-layer data encryption configuration for the TiDB Cloud Premium instance.",
          "allOf": [
            {
              "$ref": "#/definitions/TidbDualLayerDataEncryption"
            }
          ]
        },
        "tidbVersion": {
          "type": "string",
          "description": "The version of the TiDB instance.",
          "readOnly": true
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "capacityUpdateTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the capacity of the TiDB Cloud Premium instance was last updated, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        }
      },
      "required": [
        "displayName",
        "regionId",
        "maxRcu",
        "servicePlan"
      ]
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
          "description": "A URL or resource name that uniquely identifies the type of the serialized protocol buffer message."
        }
      },
      "additionalProperties": {},
      "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&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    }"
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "description": "The error code returned with this error."
        },
        "message": {
          "type": "string",
          "description": "The error message returned with this error."
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          },
          "description": "A list of messages with additional error details."
        }
      },
      "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)."
    },
    "v1beta1ClusterState": {
      "type": "string",
      "enum": [
        "CREATING",
        "DELETING",
        "ACTIVE",
        "RESTORING",
        "MAINTENANCE",
        "DELETED",
        "INACTIVE",
        "UPGRADING",
        "IMPORTING",
        "MODIFYING",
        "PAUSING",
        "PAUSED",
        "RESUMING"
      ],
      "description": "Enum of possible states of a cluster.\n\n - CREATING: Cluster is being created.\n - DELETING: Cluster is being deleted.\n - ACTIVE: Cluster is active for use.\n - RESTORING: Cluster data is being restored.\n - MAINTENANCE: Cluster is under maintenance.\n - DELETED: Cluster has been deleted.\n - INACTIVE: Cluster is not active, but not being deleted.\n - UPGRADING: Cluster is being updated.\nOnly for Dedicated Cluster.\n - IMPORTING: Cluster is being imported.\nOnly for Dedicated Cluster.\n - MODIFYING: Cluster is being modified.\nOnly for Dedicated Cluster.\n - PAUSING: Cluster is being paused.\nOnly for Dedicated Cluster.\n - PAUSED: Cluster is paused.\nOnly for Dedicated Cluster.\n - RESUMING: Cluster is resuming.\nOnly for Dedicated Cluster."
    },
    "v1beta1EngineType": {
      "type": "string",
      "enum": [
        "MYSQL_COMPATIBLE",
        "POSTGRESQL_COMPATIBLE"
      ]
    },
    "v1beta1Region": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "example": "regions/aws-us-west-2",
          "description": "The unique name of the region, in the format of `regions/{region_id}`. For example, `regions/aws-us-west-2`.",
          "pattern": "^regions/(aws|gcp|azure)-(.+)$"
        },
        "regionId": {
          "type": "string",
          "example": "aws-us-west-2",
          "description": "The unique identifier for the region, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`.",
          "readOnly": true,
          "pattern": "^(aws|gcp|azure|alicloud)-[a-z0-9-]+$"
        },
        "cloudProvider": {
          "example": "aws",
          "description": "The cloud provider that offers the region.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud\n\n- `\"azure\"`: Microsoft Azure\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/RegionCloudProvider"
            }
          ]
        },
        "displayName": {
          "type": "string",
          "example": "Oregon (us-west-2)",
          "description": "A human-readable name for the region. For example, `Oregon (us-west-2)`.",
          "readOnly": true
        },
        "provider": {
          "type": "string",
          "x-nullable": true,
          "example": "aws",
          "description": "**Deprecated.** Use `cloudProvider` instead. The name of the cloud provider. For example, `aws`, `gcp`, `azure`, or `alicloud`.",
          "title": "Deprecated",
          "readOnly": true
        },
        "servicePlans": {
          "type": "array",
          "example": [
            "Premium",
            "Essential_V2",
            "Premium_Reserved"
          ],
          "items": {
            "$ref": "#/definitions/v1beta1ServicePlan"
          },
          "description": "The service plans available in this region. Premium, Essential_V2, and Premium_Reserved can appear together in the same logical region. Starter, Essential, and BYOC are standalone service plans and cannot share a logical region with any other service plan.",
          "title": "ServicePlan",
          "readOnly": true
        },
        "supportedServicePlans": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta1ServicePlanInfo"
          },
          "readOnly": true
        }
      },
      "description": "A representation of a region for deploying TiDB clusters."
    },
    "v1beta1ServicePlan": {
      "type": "string",
      "enum": [
        "Starter",
        "Essential",
        "Premium",
        "BYOC",
        "Dedicated",
        "Premium_Reserved",
        "Essential_V2"
      ]
    },
    "v1beta1ServicePlanInfo": {
      "type": "object",
      "properties": {
        "servicePlan": {
          "$ref": "#/definitions/v1beta1ServicePlan"
        },
        "displayName": {
          "type": "string"
        },
        "supportedEngineTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1beta1EngineType"
          }
        }
      }
    },
    "v1beta2Backup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier of the backup.",
          "readOnly": true
        },
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance to which the backup belongs.",
          "readOnly": true
        },
        "organizationId": {
          "type": "string",
          "description": "The ID of the organization to which the backup belongs.",
          "readOnly": true
        },
        "servicePlan": {
          "example": "Premium",
          "description": "The service plan of the backup. The possible value is `Premium`.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta1ServicePlan"
            }
          ]
        },
        "displayName": {
          "type": "string",
          "description": "The name of the backup.",
          "readOnly": true
        },
        "description": {
          "type": "string",
          "description": "The description of the backup."
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the backup was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "sizeBytes": {
          "type": "string",
          "format": "int64",
          "description": "The size of the backup in bytes.",
          "readOnly": true
        },
        "state": {
          "description": "The current state of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2BackupState"
            }
          ]
        },
        "type": {
          "description": "The type of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2BackupType"
            }
          ]
        },
        "triggerType": {
          "description": "The trigger type of the backup.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/BackupTriggerType"
            }
          ]
        },
        "expirationTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the backup expires, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        },
        "backupTs": {
          "type": "string",
          "description": "The backup timestamp.",
          "readOnly": true
        },
        "regionId": {
          "type": "string",
          "description": "The ID of the region where the backup is stored.",
          "readOnly": true
        },
        "customerManaged": {
          "type": "boolean",
          "description": "Whether the source cluster used a customer-managed key at backup time. Combine with encryption_key_id: \"0\" means not encrypted; non-zero key id with false means SMEK; non-zero key id with true means CMEK.",
          "title": "Whether the source cluster used a customer-managed key at backup time.\nCombine with `encryption_key_id`:\n- `encryption_key_id == \"0\"`: backup was not encrypted\n- `encryption_key_id != \"0\" && customer_managed == false`: backup used SMEK\n- `encryption_key_id != \"0\" && customer_managed == true`: backup used CMEK",
          "readOnly": true
        },
        "encryptionKeyId": {
          "type": "string",
          "description": "Source cluster encryption key ID at backup time. \"0\" means no encryption key was used.",
          "readOnly": true
        }
      }
    },
    "v1beta2BackupState": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "PENDING",
        "RUNNING",
        "SUCCEEDED",
        "FAILED",
        "CANCELLED"
      ],
      "description": "The state of a backup.\n\n - UNKNOWN: The backup state is unknown.\n - PENDING: The backup is pending.\n - RUNNING: The backup is in progress.\n - SUCCEEDED: The backup completed successfully.\n - FAILED: The backup has failed.\n - CANCELLED: The backup is cancelled."
    },
    "v1beta2BackupStorageAuth": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "type": "string",
          "description": "The access key ID used to access the backup storage."
        },
        "accessKeySecret": {
          "type": "string",
          "description": "The access key secret used to access the backup storage."
        }
      },
      "required": [
        "accessKeyId",
        "accessKeySecret"
      ]
    },
    "v1beta2BackupType": {
      "type": "string",
      "enum": [
        "SNAPSHOT"
      ],
      "description": "The type of a backup.\n\n - SNAPSHOT: A full snapshot backup."
    },
    "v1beta2CaCertificateDownloadUrl": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The download URL for the CA certificate of the TiDB Cloud Premium instance.",
          "readOnly": true
        }
      }
    },
    "v1beta2ClassicBackupStorage": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "example": "aws",
          "description": "The cloud provider where the backup object storage is located.\n\n**Note**: Currently, only `\"aws\"` and `\"alicloud\"` are supported.",
          "allOf": [
            {
              "$ref": "#/definitions/RegionCloudProvider"
            }
          ]
        },
        "regionId": {
          "type": "string",
          "description": "The region where the backup object storage is located, in the format of `{cloud_provider}-{region_code}`. For example, `alicloud-cn-shanghai`.\n\nThis field is required when `cloud_provider` is `\"alicloud\"`."
        },
        "bucketUri": {
          "type": "string",
          "example": "s3://my-backup-bucket/tidb-backups/",
          "description": "The URI of the backup bucket.\n\n- For Amazon S3, use the format `s3://{bucket_name}/{path}`. For example, `s3://my-backup-bucket/tidb-backups/`.\n\n- For Alibaba Cloud OSS, use the format `oss://{bucket_name}/{path}`. For example, `oss://my-backup-bucket/tidb-backups/`."
        },
        "auth": {
          "description": "The authentication credentials for accessing the backup storage.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2BackupStorageAuth"
            }
          ]
        }
      },
      "description": "The storage configuration for a classic backup.",
      "required": [
        "cloudProvider",
        "bucketUri",
        "auth"
      ]
    },
    "v1beta2CloudProviderInfo": {
      "type": "object",
      "properties": {
        "tidbId": {
          "type": "string",
          "description": "The ID of the TiDB Cloud Premium instance."
        },
        "cloudProvider": {
          "description": "The cloud provider where the TiDB Cloud Premium instance is deployed.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud\n\n- `\"azure\"`: Microsoft Azure\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/RegionCloudProvider"
            }
          ]
        },
        "tidbCloudAccountId": {
          "type": "string",
          "description": "The TiDB Cloud account ID for the underlying cloud infrastructure of the TiDB Cloud Premium instance.",
          "readOnly": true
        },
        "tidbCloudAccountExternalId": {
          "type": "string",
          "description": "The external ID of the TiDB Cloud account, which is used for assuming Identity and Access Management (IAM) roles for cross-account access.",
          "readOnly": true
        },
        "nodeRole": {
          "type": "string",
          "description": "The node role or identity used to grant storage access.\nFor Azure, this is the kubelet identity object ID.",
          "readOnly": true
        }
      },
      "required": [
        "tidbId"
      ]
    },
    "v1beta2ConnectionReachability": {
      "type": "object",
      "properties": {
        "reachable": {
          "type": "boolean",
          "description": "Indicates whether the endpoint is reachable.",
          "readOnly": true
        },
        "detail": {
          "description": "The detailed reachability status of the endpoint connection.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/ConnectionReachabilityDetail"
            }
          ]
        }
      }
    },
    "v1beta2CustomerManagedEncryptionKey": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The unique name of the CMEK, in the format of `cmeks/{cmek_id}`.",
          "readOnly": true
        },
        "customerManagedEncryptionKeyId": {
          "type": "string",
          "description": "The ID of the CMEK.",
          "readOnly": true
        },
        "regionId": {
          "type": "string",
          "description": "The region where the CMEK is located, in the format of `{cloud_provider}-{region_code}`. For example, `aws-us-west-2`."
        },
        "cloudProvider": {
          "description": "The cloud provider where the CMEK is located.\n\n- `\"aws\"`: Amazon Web Services\n\n- `\"gcp\"`: Google Cloud (not yet supported, planned for a future release)\n\n- `\"azure\"`: Microsoft Azure (not yet supported, planned for a future release)\n\n- `\"alicloud\"`: Alibaba Cloud",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/RegionCloudProvider"
            }
          ]
        },
        "servicePlan": {
          "$ref": "#/definitions/v1beta1ServicePlan"
        },
        "awsKms": {
          "description": "The configuration for AWS KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/CustomerManagedEncryptionKeyAwsKms"
            }
          ]
        },
        "aliyunKms": {
          "description": "The configuration for Alibaba Cloud KMS.",
          "allOf": [
            {
              "$ref": "#/definitions/CustomerManagedEncryptionKeyAliyunKms"
            }
          ]
        },
        "awsPrincipal": {
          "description": "AWS IAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/CmekAccessIamPrincipalAwsCmekPrincipal"
            }
          ]
        },
        "aliyunPrincipal": {
          "description": "Alibaba Cloud RAM principal.",
          "allOf": [
            {
              "$ref": "#/definitions/CmekAccessIamPrincipalAliyunCmekPrincipal"
            }
          ]
        },
        "createTime": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the CMEK was created, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
          "readOnly": true
        }
      },
      "required": [
        "regionId",
        "servicePlan"
      ]
    },
    "v1beta2GetRestoreStatusResponse": {
      "type": "object",
      "properties": {
        "state": {
          "description": "The current state of the restore operation.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2RestoreState"
            }
          ]
        },
        "message": {
          "type": "string",
          "description": "The detailed error message if the restore operation fails.",
          "readOnly": true
        },
        "progress": {
          "type": "integer",
          "format": "int32",
          "description": "The restore progress percentage, from `0` to `100`.",
          "readOnly": true
        }
      }
    },
    "v1beta2ListBackupsResponse": {
      "type": "object",
      "properties": {
        "backups": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta2Backup"
          },
          "description": "A list of backups that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of backups that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "A token, which can be sent as `pageToken` to retrieve the next page.\nIf this field is omitted, there are no subsequent pages."
        }
      }
    },
    "v1beta2ListRegionsResponse": {
      "type": "object",
      "properties": {
        "regions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta1Region"
          },
          "description": "A list of regions that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of regions that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "The token to retrieve the next page of results. Use this value as the `pageToken` parameter in the next request. This field is empty when there are no more pages."
        }
      }
    },
    "v1beta2ListTidbBackupsResponse": {
      "type": "object",
      "properties": {
        "backups": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1beta2Backup"
          },
          "description": "A list of backups that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of backups that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "The token to retrieve the next page of results. Use this value as the `pageToken` parameter in the next request. This field is empty when there are no more pages."
        }
      }
    },
    "v1beta2ListTidbsResponse": {
      "type": "object",
      "properties": {
        "tidbs": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/nextgenv1beta2Tidb"
          },
          "description": "A list of TiDB Cloud Premium instances that match the query."
        },
        "totalSize": {
          "type": "integer",
          "format": "int32",
          "description": "The total number of TiDB Cloud Premium instances that match the query."
        },
        "nextPageToken": {
          "type": "string",
          "description": "The token to retrieve the next page of results. Use this value as the `pageToken` parameter in the next request. This field is empty when there are no more pages."
        }
      }
    },
    "v1beta2ReservedCapacity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "readOnly": true
        },
        "templateCode": {
          "type": "string",
          "readOnly": true
        },
        "purchasedVcpu": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "peakQps": {
          "type": "string",
          "format": "int64",
          "readOnly": true
        },
        "workloadType": {
          "type": "string",
          "readOnly": true
        },
        "description": {
          "type": "string",
          "readOnly": true
        },
        "scope": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/ReservedCapacityScope"
            }
          ]
        }
      }
    },
    "v1beta2ResetRootPasswordResponse": {
      "type": "object"
    },
    "v1beta2RestoreMode": {
      "type": "string",
      "enum": [
        "SNAPSHOT",
        "PITR",
        "DEDICATED_SNAPSHOT",
        "CLASSIC_SNAPSHOT"
      ],
      "description": "The mode used to restore a TiDB Cloud Premium instance.\n\n - SNAPSHOT: Restores from native snapshot backup data of a TiDB Cloud Premium instance.\n - PITR: Restores from native point-in-time recovery (PITR) backup data of a TiDB Cloud Premium instance.\n - DEDICATED_SNAPSHOT: Restores from snapshot backup data of a TiDB Cloud Dedicated cluster.\n - CLASSIC_SNAPSHOT: Restores from snapshot backup data stored in object storage of a classic TiDB."
    },
    "v1beta2RestoreState": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "PENDING",
        "RUNNING",
        "SUCCEEDED",
        "FAILED",
        "CANCELLED"
      ],
      "description": "The current state of the restore operation.\n\n - UNKNOWN: The state of the restore operation is unknown.\n - PENDING: The restore operation is pending.\n - RUNNING: The restore operation is in progress.\n - SUCCEEDED: The restore operation completed successfully.\n - FAILED: The restore operation has failed.\n - CANCELLED: The restore operation is cancelled."
    },
    "v1beta2RestoreTidbRequest": {
      "type": "object",
      "properties": {
        "tidb": {
          "description": "The configuration of the TiDB Cloud Premium instance to create.\n\n**Note**: Currently, only TiDB Cloud Premium instances with `servicePlan` set to `Premium` are supported.",
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2Tidb"
            }
          ]
        },
        "sourceTidbId": {
          "type": "string",
          "description": "The ID of the source TiDB Cloud Premium instance containing the backup data."
        },
        "restoreMode": {
          "$ref": "#/definitions/v1beta2RestoreMode"
        },
        "backupId": {
          "type": "string",
          "description": "The ID of the backup to restore from.\n\nThis field is required when `restoreMode` is `\"SNAPSHOT\"` or `\"DEDICATED_SNAPSHOT\"`."
        },
        "pointInTime": {
          "type": "string",
          "format": "date-time",
          "description": "The point in time to restore data to, in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nThis field is required when `restoreMode` is `\"PITR\"`."
        },
        "classicBackupStorage": {
          "description": "The classic backup storage configuration.\n\nThis field is required when `restoreMode` is `\"CLASSIC_SNAPSHOT\"`.",
          "allOf": [
            {
              "$ref": "#/definitions/v1beta2ClassicBackupStorage"
            }
          ]
        },
        "validateOnly": {
          "type": "boolean",
          "description": "If set to `true`, the request is validated but not executed. Defaults to `false`."
        }
      },
      "required": [
        "tidb",
        "restoreMode"
      ]
    },
    "v1beta2RestoreTidbResponse": {
      "type": "object",
      "properties": {
        "tidb": {
          "description": "The restored TiDB Cloud Premium instance.",
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/nextgenv1beta2Tidb"
            }
          ]
        }
      }
    },
    "v1beta2ResumeTidbResponse": {
      "type": "object"
    },
    "v1beta2TidbHighAvailabilityType": {
      "type": "string",
      "enum": [
        "REGIONAL",
        "ZONAL"
      ],
      "description": "The high availability configuration for the TiDB Cloud Premium instance.\n\n - REGIONAL: High availability across multiple availability zones within a region.\n - ZONAL: High availability within a single availability zone."
    }
  },
  "x-tagGroups": [
    {
      "name": "Endpoints",
      "tags": [
        "TiDB Cloud Premium Instance",
        "Backup",
        "Region"
      ]
    }
  ]
}
