Queries a list of data sources based on the business information of data sources.
Operation description
- This API operation is available for all DataWorks editions.
- You can call this operation only if you are assigned one of the following roles in DataWorks:
- Tenant Owner, Workspace Administrator, Deploy, Develop, Visitor, Workspace Owner, O&M, Model Designer, Security Administrator, Data Analyst, OpenPlatform Administrator, and Data Governance Administrator
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| dataworks:ListDataSources | get | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectId | long | Yes | The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID. You must configure this parameter to specify the DataWorks workspace to which the API operation is applied. | 17820 |
| Name | string | No | The name of the data source. Fuzzy match by data source name is supported. | test |
| Types | array | No | The data source types. This parameter specifies a filter condition. You can specify multiple data source types. | |
| string | No | The data source type. | mysql | |
| EnvType | string | No | The environment in which the data sources are used. Valid values:
| Prod |
| PageNumber | integer | No | The page number. Default value: 1. | 1 |
| PageSize | integer | No | The number of entries per page. Default value: 10. Maximum value: 100. | 10 |
| SortBy | string | No | The field that you want to use to sort the data sources. Valid values:
Default value: CreateTime | Id |
| Order | string | No | The order in which you want to sort the data sources. Valid values:
Default value: Desc | Asc |
| Tags | string | No | The tag of the data source. This parameter specifies a filter condition.
| ["tag1", "tag2", "tag3"] |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "7BE1433F-6D55-5D86-9344-CA6F7DD19B13",
"PagingInfo": {
"TotalCount": 131,
"PageSize": 10,
"PageNumber": 1,
"DataSources": [
{
"Name": "test",
"Type": "mysql",
"DataSource": [
{
"Id": 16035,
"ConnectionProperties": {
"envType": "Prod",
"regionId": "cn-beijing",
"instanceId": "hgprecn-cn-x0r3oun4k001",
"database": "testdb",
"securityProtocol": "authTypeNone",
"authType": "Executor",
"authIdentity": 1107550004253538
},
"ConnectionPropertiesMode": "UrlMode",
"Description": "test ",
"CreateTime": 1648711113000,
"CreateUser": 1624387842781448,
"ModifyTime": 1648711113000,
"ModifyUser": 1624387842781448,
"QualifiedName": "1648711121000:cn-beijing:odps:yongxunQA_beijing_standard"
}
]
}
]
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|
