Queries the metadata of a specified data source.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | GetDataSourceMeta | The operation that you want to perform. Set the value to GetDataSourceMeta. |
ProjectId | Long | Yes | 10000 | The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to obtain the ID. |
DatasourceName | String | Yes | mysql_name | The name of the data source. |
PageNumber | Long | Yes | 1 | The page number. |
PageSize | Long | Yes | 10 | The number of entries per page. |
EnvType | String | No | 1 | The environment in which the data source resides. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
Success | Boolean | true | Indicates whether the request was successful. Valid values:
|
RequestId | String | 0000-ABCD-EFG | The request ID. You can locate logs and troubleshoot issues based on the ID. |
Data | Object | The returned result. | |
Status | String | success | Indicates whether the metadata of the data source is obtained. Valid values:
|
Message | String | read datasource time out | The reason why the metadata of the data source fails to be obtained. If the metadata of the data source is obtained, no value is returned for this parameter. |
Meta | String | {"dbTables":[{"dbName":"testdb","schema":[{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table1","tableName":"table1"}]},{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table2","tableName":"table2"}]}]}]} | The returned metadata of the data source. The returned metadata is in the JSON format.
Parameter description:
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=GetDataSourceMeta
&ProjectId=10000
&DatasourceName=mysql_name
&PageNumber=1
&PageSize=10
&EnvType=1
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetDataSourceMetaResponse>
<Success>true</Success>
<RequestId>0000-ABCD-EFG </RequestId>
<Data>
<Status>success</Status>
<Message>read datasource time out</Message>
<Meta>{"dbTables":[{"dbName":"testdb","schema":[{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table1","tableName":"table1"}]},{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table2","tableName":"table2"}]}]}]}</Meta>
</Data>
</GetDataSourceMetaResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Success" : true,
"RequestId" : "0000-ABCD-EFG\t",
"Data" : {
"Status" : "success",
"Message" : "read datasource time out",
"Meta" : "{\"dbTables\":[{\"dbName\":\"testdb\",\"schema\":[{\"tableInfos\":[{\"dbName\":\"testdb\",\"enable\":true,\"table\":\"table1\",\"tableName\":\"table1\"}]},{\"tableInfos\":[{\"dbName\":\"testdb\",\"enable\":true,\"table\":\"table2\",\"tableName\":\"table2\"}]}]}]}"
}
}
Error codes
HTTP status code | Error code | Error message | Description |
400 | Invalid.DI.Parameter | The parameter is invalid. | One or more parameters are invalid. |
403 | Forbidden.DI.NoPrivilege | No access. | You do not have the required permissions. |
500 | InternalError.DI.Parameter | A DI internal error occurred. | An internal error has occurred in Data Integration. |
For a list of error codes, see Service error codes.