Mengkueri sumber data yang ditambahkan ke workspace DataWorks.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
ID workspace DataWorks tempat sumber data berada. Anda dapat memanggil operasi ListProjects untuk mengkueri ID. |
1 |
| Name |
string |
No |
Nama sumber data yang ingin Anda kueri. |
test |
| DataSourceType |
string |
No |
Jenis sumber data. Nilai yang valid:
|
rds |
| SubType |
string |
No |
Subjenis sumber data. Parameter ini hanya berlaku jika parameter DataSourceType disetel ke rds. Jika nilai parameter DataSourceType adalah rds, nilai parameter ini dapat berupa mysql, sqlserver, atau postgresql. |
mysql |
| Status |
string |
No |
Status sumber data. Nilai yang valid:
|
ENABLED |
| EnvType |
integer |
No |
Lingkungan tempat sumber data digunakan. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan lingkungan pengembangan. Nilai 1 menunjukkan lingkungan produksi. |
1 |
| PageSize |
integer |
No |
Jumlah entri per halaman. Nilai default: 10. Nilai maksimum: 100. |
10 |
| PageNumber |
integer |
No |
Nomor halaman. Halaman dimulai dari halaman 1. |
1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter respons. |
||
| HttpStatusCode |
integer |
Kode status HTTP. |
200 |
| RequestId |
string |
ID permintaan. |
0bc14115159376359**** |
| Success |
boolean |
Menunjukkan apakah permintaan berhasil. |
true |
| Data |
object |
Hasil kueri yang dikembalikan. |
|
| PageNumber |
integer |
Nomor halaman. |
1 |
| PageSize |
integer |
Jumlah entri per halaman. |
20 |
| TotalCount |
integer |
Jumlah total sumber data. |
233 |
| DataSources |
array<object> |
Sumber data. |
|
|
object |
Informasi tentang sumber data. |
||
| Status |
integer |
The status of the data source. Valid values:
|
1 |
| ProjectId |
integer |
The ID of the workspace to which the data source belongs. |
123 |
| SubType |
string |
The subtype of the data source. This parameter takes effect only when the DataSourceType parameter is set to rds. |
mysql |
| GmtModified |
string |
The time when the data source was last modified. Example: Mar 17, 2021 4:09:32 PM. |
Mar 17, 2021 4:09:32 PM |
| EnvType |
integer |
The environment in which the data source is used. Valid values:
|
1 |
| ConnectStatus |
integer |
The status of the data source. Valid values:
|
1 |
| Sequence |
integer |
The sequence number of the data source. Data sources are sorted in descending order based on the value of this parameter. |
300 |
| Description |
string |
The description of the data source. |
a connection |
| DataSourceType |
string |
The type of the data source. Valid values:
|
rds |
| GmtCreate |
string |
The time when the data source was created. Example: Mar 17, 2021 4:09:32 PM. |
Mar 17, 2021 4:09:32 PM |
| DefaultEngine |
boolean |
Indicates whether the compute engine that is associated with the data source is the default compute engine used by data sources of the same type. |
false |
| Shared |
boolean |
Indicates whether the data source is a shared data source. |
false |
| Operator |
string |
The ID of the Alibaba Cloud account that is used to last modify the data source. |
193543050**** |
| Name |
string |
The name of the data source. |
abc |
| Content |
string |
The data connection string. The value of this parameter is in the JSON format. Examples of connection strings of common data sources:
|
{"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 ID of the compute engine with which the data source is associated. |
123 |
| TenantId |
integer |
The tenant ID. |
1234567 |
Contoh
Respons sukses
JSONformat
{
"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
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | |
| 400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | |
| 400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | |
| 403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | |
| 403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.