Before you use DataService Studio to create an API, you must add your database or data warehouse to DataWorks as a data source. Then, you can use the data source to create an API. During API development, DataService Studio accesses the data source to obtain the schema of a data table based on which you want to create an API to help you configure the request parameters and response parameters of the API. This topic describes how to add a data source.
Prerequisites
To ensure that resource groups for DataService Studio can access data sources, you must configure network connectivity between the resource groups and data sources and configure IP address whitelists for the data sources. Otherwise, tasks that are related to DataService Studio cannot be run as expected.
For more information about how to configure network connectivity for the shared resource group, see Configure network connectivity between the shared resource group for DataService Studio and a data source.
For more information about how to configure network connectivity for an exclusive resource group for DataService Studio, see Configure network connectivity between an exclusive resource group for DataService Studio and a data source.
Procedure
Go to the Data Source page.
Log on to the DataWorks console. In the left-side navigation pane, click Management Center. On the page that appears, select the desired workspace from the drop-down list and click Go to Management Center.
In the left-side navigation pane of the page that appears, click Data Source. The Data Source page appears.
On the Data Source page, add a data source based on your business requirements. The following table describes the supported types of data sources and the configuration methods.
Data source type
Create an API by using the codeless UI
Create an API by using the code editor
Configuration method
Hologres
Supported
Supported
NoteHologres is compatible with PostgreSQL. PostgreSQL does not support the DATETIME data type. If your Hologres instance contains data of the DATETIME type, Hologres converts the data from the DATETIME type to the TIMESTAMP type of PostgreSQL. This way, DataService Studio can query the data.
ClickHouse
Supported
Supported
NoteThis type of data source supports only exclusive resource groups for DataService Studio. For information about exclusive resource groups for DataService Studio, see Create and use an exclusive resource group for DataService Studio.
ApsaraDB RDS
Supported
Supported
ApsaraDB RDS data sources that run the MySQL, PostgreSQL, or SQL Server engine are supported.
PolarDB-X 1.0
Supported
Supported
Add a PolarDB-X 1.0 data source
NoteYou can add this type of data source only in connection string mode.
MySQL
Supported
Supported
PostgreSQL
Supported
Supported
SQL Server
Supported
Supported
Oracle
Supported
Supported
NoteYou can add this type of data source only in connection string mode.
AnalyticDB for MySQL 2.0
Supported
Supported
AnalyticDB for MySQL 3.0
Supported
Supported
AnalyticDB for PostgreSQL
Supported
Supported
Tablestore
Supported
Supported
NoteYou can add this type of data source only in connection string mode.
This type of data source supports only exclusive resource groups for DataService Studio. For information about exclusive resource groups for DataService Studio, see Create and use an exclusive resource group for DataService Studio.
This type of data source can be used only in the China (Shanghai) and China (Hong Kong) regions.
MongoDB
Supported
Not supported
MaxCompute
Acceleration solution 1: Acceleration service
Acceleration solution 2: MCQA
Acceleration solution 1: Acceleration service
Acceleration solution 2: MCQA
ImportantAcceleration Solution 1 supports only single-table queries. Acceleration Solution 2 supports single-table queries and multi-table join queries.
In Acceleration Solution 1, you can use the shared resource group for DataService Studio or an exclusive resource group for DataService Studio. In Acceleration Solution 2, you can use only an exclusive resource group for DataService Studio.
The feature of generating an API by using this type of data source is available in the China (Beijing), China (Hangzhou), China (Shanghai), and China (Shenzhen) regions.
StarRocks
Supported
Supported
Doris
Supported
Supported
In the dialog box in which you add the data source, set the Resource Group connectivity parameter to Data Service and test network connectivity for the resource group for DataService Studio that you want to use. The following example shows how to add a MySQL data source.
NoteIf the network connectivity test fails, check your configurations. For more information, see Configure network connectivity.
After the data source passes the network connectivity test, return to DataService Studio to create an API based on the data source.