Queries data sources in a DataWorks workspace.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. You can call ListProjects to obtain the ID. |
1 |
| Name |
string |
No |
The data source name to query. |
test |
| DataSourceType |
string |
No |
The data source type. Valid values:
|
rds |
| SubType |
string |
No |
The data source subtype. Applies only when DataSourceType is set to rds. Valid values: mysql, sqlserver, and postgresql. |
mysql |
| Status |
string |
No |
The data source status. Valid values:
|
ENABLED |
| EnvType |
integer |
No |
The environment type. Valid values: 0 (development) and 1 (production). |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. Maximum value: 100. |
10 |
| PageNumber |
integer |
No |
The page number. Starts from 1. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| RequestId |
string |
The request ID. |
0bc14115159376359**** |
| Success |
boolean |
Indicates whether the request was successful. |
true |
| Data |
object |
The query result. |
|
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
20 |
| TotalCount |
integer |
The total number of data sources. |
233 |
| DataSources |
array<object> |
The data sources. |
|
|
object |
The data source details. |
||
| Status |
integer |
The data source status. Valid values:
|
1 |
| ProjectId |
integer |
The workspace ID. |
123 |
| SubType |
string |
The data source subtype. Applies only when DataSourceType is rds. |
mysql |
| GmtModified |
string |
The last modification time. Example: Mar 17, 2021 4:09:32 PM. |
Mar 17, 2021 4:09:32 PM |
| EnvType |
integer |
The environment type. Valid values:
|
1 |
| ConnectStatus |
integer |
The connectivity status. Valid values:
|
1 |
| Sequence |
integer |
The sequence number. Data sources are sorted by this value in descending order. |
300 |
| Description |
string |
The data source description. |
a connection |
| DataSourceType |
string |
The data source type. Valid values:
|
rds |
| GmtCreate |
string |
The creation time. Example: Mar 17, 2021 4:09:32 PM. |
Mar 17, 2021 4:09:32 PM |
| DefaultEngine |
boolean |
Whether the associated compute engine is the default engine for this data source type. |
false |
| Shared |
boolean |
Whether the data source is shared. |
false |
| Operator |
string |
The Alibaba Cloud account ID that last modified the data source. |
193543050**** |
| Name |
string |
The name of the data source. |
abc |
| Content |
string |
The connection string in JSON format. Examples:
|
{"pubEndpoint":"http://service.cn.maxcompute.aliyun.com/api","accessId":"TMP.3KecGjvzy3i8MYfn2BGHgF7EHGyBFZcHm7GgngrABVRyvvKQrfF5kskR36xP361C3dqwbGo7SGYptAeGyiTwHXqLaBUvYC","securityToken":null,"endpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","accessKey":"***","name":"PRE_PROJECT_A_engine","project":"PRE_PROJECT_A","vpcEndpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","region":"cn-shanghai","authType":"2"} |
| Id |
integer |
The data source ID. |
1 |
| BindingCalcEngineId |
integer |
The associated compute engine ID. |
123 |
| TenantId |
integer |
The tenant ID. |
1234567 |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"RequestId": "0bc14115159376359****",
"Success": true,
"Data": {
"PageNumber": 1,
"PageSize": 20,
"TotalCount": 233,
"DataSources": [
{
"Status": 1,
"ProjectId": 123,
"SubType": "mysql",
"GmtModified": "Mar 17, 2021 4:09:32 PM",
"EnvType": 1,
"ConnectStatus": 1,
"Sequence": 300,
"Description": "a connection",
"DataSourceType": "rds",
"GmtCreate": "Mar 17, 2021 4:09:32 PM",
"DefaultEngine": false,
"Shared": false,
"Operator": "193543050****",
"Name": "abc",
"Content": "{\"pubEndpoint\":\"http://service.cn.maxcompute.aliyun.com/api\",\"accessId\":\"TMP.3KecGjvzy3i8MYfn2BGHgF7EHGyBFZcHm7GgngrABVRyvvKQrfF5kskR36xP361C3dqwbGo7SGYptAeGyiTwHXqLaBUvYC\",\"securityToken\":null,\"endpoint\":\"http://service.cn.maxcompute.aliyun-inc.com/api\",\"accessKey\":\"***\",\"name\":\"PRE_PROJECT_A_engine\",\"project\":\"PRE_PROJECT_A\",\"vpcEndpoint\":\"http://service.cn.maxcompute.aliyun-inc.com/api\",\"region\":\"cn-shanghai\",\"authType\":\"2\"}",
"Id": 1,
"BindingCalcEngineId": 123,
"TenantId": 1234567
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | The connection does not exist. |
| 400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | The project does not exist. |
| 400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | The user is not in the project. |
| 403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | The user is not a project administrator or owner. |
| 403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. | The user is not in tenant. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.