Sign InTry Free

Manage a Data App

A Data App in Data Service (beta) is a collection of endpoints that you can use to access data for a specific application. You can configure authorization settings using API keys to restrict access to endpoints in a Data App.

This document describes how to manage your Data Apps in the TiDB Cloud console. On the Data Service page, you can manage all Data Apps, endpoints, and API keys.

Create a Data App

To create a Data App for your project, perform the following steps:

  1. On the Data Service page of your project, click Create DataApp in the left pane.

  2. Enter a name, a description, and select clusters that you want the Data App to access.

  3. (Optional) To automatically deploy endpoints of the Data App to your preferred GitHub repository and branch, enable Connect to GitHub, and then do the following:

    1. Click Install on GitHub, and then follow the on-screen instructions to install TiDB Cloud Data Service as an application on your target repository.

    2. Click Authorize to authorize access to the application on GitHub.

    3. Specify the target repository, branch, and directory where you want to save the configuration files of your Data App.

  4. Click Create Data App.

    The newly created Data App is added to the top of the list. A default untitled endpoint is created for the new Data App.

  5. If you have configured to connect your Data App to GitHub, check your specified GitHub directory. You will find that the Data App configuration files have been committed to the directory by tidb-cloud-data-service, which means that your Data App is connected to GitHub successfully.

    For your new Data App, Auto Sync & Deployment and Review Draft are enabled by default so you can easily synchronize Data App changes between TiDB Cloud console and GitHub and review changes before the deployment. For more information about the GitHub integration, see Deploy your Data App changes with GitHub automatically.

Configure a Data App

You can edit the name, version, or description of a Data App, and manage its GitHub connection, linked data sources, API keys, endpoints, and deployments.

Edit Data App properties

You can edit the name, version, and description of a Data App. To edit Data App properties, perform the following steps:

  1. Navigate to the Data Service page of your project.
  2. In the left pane, click the name of your target Data App to view its details.
  3. In the Data App Properties area, click , modify the App name, version, or description, and then click Confirm.

Manage GitHub connection

For more information, see Deploy automatically with GitHub.

Integrate your Data App with GPTs

You can integrate your Data App with GPTs to enhance your applications with intelligent capabilities.

To integrate your Data App with GPTs, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, locate your target Data App and click the name of your target Data App to view its details.

  3. In the Integration with GPTs area, click Get Configuration.

    Get Configuration

  4. In the displayed dialog box, you can see the following fields:

    a. API Specification URL: copy the URL of the OpenAPI Specification of your Data App. For more information, see Use the OpenAPI Specification.

    b. API Key: enter the API key of your Data App. If you do not have an API key yet, click Create API Key to create one. For more information, see Create an API key.

    c. API Key Encoded: copy the base64 encoded string equivalent to the API key you have provided.

    GPTs Dialog Box

  5. Use the copied API Specification URL and the encoded API key in your GPT configuration.

Manage linked data sources

You can add or remove linked clusters for a Data App.

To link a cluster to a Data App, perform the following steps:

  1. Navigate to the Data Service page of your project.
  2. In the left pane, locate your target Data App and click the name of your target Data App to view its details.
  3. In the Linked Data Sources area, click Add Cluster.
  4. In the displayed dialog box, select a cluster from the list and click Add.

To remove a linked cluster from a Data App, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, locate your target Data App and click the name of your target Data App to view its details.

  3. In the Linked Data Sources area, locate the target linked cluster you want to remove from the Data App, and click Delete in the Action column.

  4. In the displayed dialog box, confirm the removal.

    After you remove a linked cluster, the cluster is not deleted, but the existing endpoints in the Data App cannot access it.

Manage an API key

For more information, see Manage an API key.

Manage an endpoint

For more information, see Manage an endpoint.

Manage a custom domain

For more information, see Manage a custom domain.

Manage deployments

To manage deployments, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, locate your target Data App and click the name of your target Data App to view its details.

  3. In the Deployment Configuration area, click Config. The dialog for deployment configuration is displayed.

  4. In the dialog, choose your desired setting of Auto Sync & Deployment and Review Draft.

    • Auto Sync & Deployment

      • This option can be enabled only when your Data App is connected to GitHub. For more information, see Deploy automatically with GitHub.
      • When it is enabled, the changes made in your specified GitHub directory can be automatically deployed in TiDB Cloud, and the changes made in the TiDB Cloud console can be pushed to GitHub as well. You can find the corresponding deployment and commit information in the Data App deployment history.
      • When it is disabled, the changes made in your specified GitHub directory will NOT be deployed in TiDB Cloud, and the changes made in the TiDB Cloud console will NOT be pushed to GitHub either.
    • Review Draft

      • When it is enabled, you can review the Data App changes you made in the TiDB Cloud console before the deployment. Based on the review, you can either deploy or discard the changes.
      • When it is disabled, the Data App changes you made in the TiDB Cloud console are deployed directly.
  5. In the Action column, you can edit or re-deploy your changes according to your needs.

Use the OpenAPI Specification

Data Service (beta) supports generating the OpenAPI Specification 3.0 for each Data App, which enables you to interact with your endpoints in a standardized format. You can use this specification to generate standardized OpenAPI documentation, client SDKs, and server stubs.

Download the OpenAPI Specification

To download the OpenAPI Specification in JSON or YAML format for a Data App, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, click the name of your target Data App to view its details.

  3. In the API Specification area, click Download and select JSON or YAML.

    If this is your first time downloading the OpenAPI Specification, you need to authorize the request when prompted.

  4. Then, the OpenAPI Specification is downloaded to your local machine.

View the OpenAPI documentation

Data Service (beta) provides autogenerated OpenAPI documentation for each Data App. In the documentation, you can view the endpoints, parameters, and responses, and try out the endpoints.

To access the OpenAPI documentation, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, click the name of your target Data App to view its details.

  3. In the upper-right corner of the page, click View API Docs.

    If this is your first time using the OpenAPI Specification, you need to authorize the request when prompted.

  4. Then, the OpenAPI documentation is opened in a new tab. In the documentation, you can view the following information:

    • Data App name, version, and description.
    • Endpoints grouped by tags.
  5. (Optional) To try out an endpoint, take the following steps:

    1. Click Authorize and enter your Data App public key as Username and private key as Password in the displayed dialog box.

      For more information, see Manage an API key.

    2. Locate your target endpoint, provide the required parameters, and then click Try it out. You can view the response in the Response body area.

    For more information about how to use the OpenAPI documentation, see Swagger UI.

Delete a Data App

To delete a Data App, perform the following steps:

  1. Navigate to the Data Service page of your project.

  2. In the left pane, locate your target Data App and click the name of your target Data App to view its details.

  3. In the Danger Zone area, click Delete Data App. A dialog box for confirmation is displayed.

  4. Type your <organization name>/<project name>/<data app name>, and then click I understand, delete.

    Once a Data App is deleted, the existing endpoints and API keys in the Data App are also deleted. If this Data App is connected to GitHub, deleting the App does not delete the files in the corresponding GitHub repository.

Learn more

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.