All Products
Search
Document Center

DataWorks:GetDataSourceMeta

Last Updated:Oct 17, 2024

Queries the metadata of a specified data source.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdlongYes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to obtain the ID.

10000
DatasourceNamestringYes

The name of the data source.

mysql_name
PageNumberlongYes

The page number.

1
PageSizelongYes

The number of entries per page.

10
EnvTypestringNo

The environment in which the data source resides. Valid values:

  • 0: development environment
  • 1: production environment
1

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
RequestIdstring

The request ID. You can locate logs and troubleshoot issues based on the ID.

0000-ABCD-EFG
Dataobject

The returned result.

Statusstring

Indicates whether the metadata of the data source is obtained. Valid values:

  • success: The metadata of the data source is obtained.
  • fail: The metadata of the data source failed to be obtained. You can troubleshoot issues based on the Message parameter.
success
Messagestring

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.

read datasource time out
Metastring

The returned metadata of the data source. The returned metadata is in the JSON format.

{"dbTables":[{"dbName":"testdb","schema":[{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table1","tableName":"table1"}]},{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table2","tableName":"table2"}]}]}]}

Parameter description:

  • dbName: the name of the database in which the data source resides.
  • schema: the schema of the database.
  • enable: indicates whether the database is available. The valid values are true and false. The value true indicates that the database is available. The value false indicates that the database is unavailable.
  • tableName: the name of the table in the database.
  • tableInfos: the information about the table in the database.
{"dbTables":[{"dbName":"testdb","schema":[{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table1","tableName":"table1"}]},{"tableInfos":[{"dbName":"testdb","enable":true,"table":"table2","tableName":"table2"}]}]}]}

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400Invalid.DI.ParameterThe parameter is invalid.
403Forbidden.DI.NoPrivilegeNo access.
500InternalError.DI.ParameterA DI internal error occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-14The Error code has changedView Change Details