元数据查询接口

MetadataCoreRestful 类

getColumns

接口地址:/api/rest_j/v1/metadatamanager/columns/{dataSourceId}/db/{database}/table/{table}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述: 获取数据表的column信息

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
databasedatabasepathtruestring
systemsystemquerytruestring
tabletablepathtruestring

响应示例:

  1. {
  2. "method": null,
  3. "status": 0,
  4. "message": "OK",
  5. "data": {
  6. "columns": [
  7. {
  8. "index": 1,
  9. "primaryKey": true,
  10. "name": "id",
  11. "type": "INT"
  12. },
  13. {
  14. "index": 2,
  15. "primaryKey": false,
  16. "name": "datasource_name",
  17. "type": "VARCHAR"
  18. },
  19. {
  20. "index": 3,
  21. "primaryKey": false,
  22. "name": "datasource_desc",
  23. "type": "VARCHAR"
  24. },
  25. {
  26. "index": 4,
  27. "primaryKey": false,
  28. "name": "datasource_type_id",
  29. "type": "INT"
  30. },
  31. {
  32. "index": 5,
  33. "primaryKey": false,
  34. "name": "create_identify",
  35. "type": "VARCHAR"
  36. },
  37. {
  38. "index": 6,
  39. "primaryKey": false,
  40. "name": "create_system",
  41. "type": "VARCHAR"
  42. },
  43. {
  44. "index": 7,
  45. "primaryKey": false,
  46. "name": "parameter",
  47. "type": "VARCHAR"
  48. },
  49. {
  50. "index": 8,
  51. "primaryKey": false,
  52. "name": "create_time",
  53. "type": "DATETIME"
  54. },
  55. {
  56. "index": 9,
  57. "primaryKey": false,
  58. "name": "modify_time",
  59. "type": "DATETIME"
  60. },
  61. {
  62. "index": 10,
  63. "primaryKey": false,
  64. "name": "create_user",
  65. "type": "VARCHAR"
  66. },
  67. {
  68. "index": 11,
  69. "primaryKey": false,
  70. "name": "modify_user",
  71. "type": "VARCHAR"
  72. },
  73. {
  74. "index": 12,
  75. "primaryKey": false,
  76. "name": "labels",
  77. "type": "VARCHAR"
  78. },
  79. {
  80. "index": 13,
  81. "primaryKey": false,
  82. "name": "version_id",
  83. "type": "INT"
  84. },
  85. {
  86. "index": 14,
  87. "primaryKey": false,
  88. "name": "expire",
  89. "type": "TINYINT"
  90. },
  91. {
  92. "index": 15,
  93. "primaryKey": false,
  94. "name": "published_version_id",
  95. "type": "INT"
  96. }
  97. ]
  98. }
  99. }

getDatabases

接口地址:/api/rest_j/v1/metadatamanager/dbs/{dataSourceId}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述:获取数据源的数据库名称列表

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
systemsystemquerytruestring

响应示例:

  1. {
  2. "method": null,
  3. "status": 0,
  4. "message": "OK",
  5. "data": {
  6. "dbs": [
  7. "information_schema",
  8. "linkis",
  9. "linkis_sit"
  10. ]
  11. }
  12. }

getPartitions

接口地址:/api/rest_j/v1/metadatamanager/partitions/{dataSourceId}/db/{database}/table/{table}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述:

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
databasedatabasepathtruestring
systemsystemquerytruestring
tabletablepathtruestring
traversetraversequeryfalseboolean

响应示例:

  1. {
  2. "method": null,
  3. "status": 0,
  4. "message": "OK",
  5. "data": {
  6. "props": {
  7. "partKeys": [
  8. "ds"
  9. ],
  10. "root": {}
  11. }
  12. }
  13. }

getTableProps

接口地址:/api/rest_j/v1/metadatamanager/props/{dataSourceId}/db/{database}/table/{table}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述:

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
databasedatabasepathtruestring
systemsystemquerytruestring
tabletablepathtruestring

响应示例:

  1. {
  2. "method": null,
  3. "status": 0,
  4. "message": "OK",
  5. "data": {
  6. "props": {
  7. "skip.header.line.count": "1",
  8. "columns.types": "int:int:string:string:string:string:string:string:string:string:string:string:string:string:string:string:string:string",
  9. "columns": "id,age,job,marital,education,default,balance,housing,loan,contact,day,month,duration,campaign,pdays,previous,poutcome,y",
  10. "field.delim": ",",
  11. "transient_lastDdlTime": "1646732554",
  12. "partition_columns.types": "string",
  13. "columns.comments": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
  14. "bucket_count": "-1",
  15. "serialization.ddl": "struct demo_data { i32 id, i32 age, string job, string marital, string education, string default, string balance, string housing, string loan, string contact, string day, string month, string duration, string campaign, string pdays, string previous, string poutcome, string y}",
  16. "file.outputformat": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat",
  17. "partition_columns": "ds",
  18. "colelction.delim": "-",
  19. "serialization.lib": "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe",
  20. "name": "dss_autotest.demo_data",
  21. "location": "hdfs://bdpdev01/user/hive/warehouse/hadoop/dss_autotest.db/demo_data",
  22. "mapkey.delim": ":",
  23. "file.inputformat": "org.apache.hadoop.mapred.TextInputFormat",
  24. "serialization.format": ",",
  25. "column.name.delimiter": ","
  26. }
  27. }
  28. }

getPartitionProps

接口地址:/api/rest_j/v1/metadatamanager/props/{dataSourceId}/db/{database}/table/{table}/partition/{partition}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述:

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
databasedatabasepathtruestring
partitionpartitionpathtruestring
systemsystemquerytruestring
tabletablepathtruestring

响应示例:

  1. {
  2. "data": {},
  3. "message": "",
  4. "method": "",
  5. "status": 0
  6. }

getTables

接口地址:/api/rest_j/v1/metadatamanager/tables/{dataSourceId}/db/{database}

请求方式:GET

请求数据类型:application/x-www-form-urlencoded

响应数据类型:application/json

接口描述: 获取数据源的某个数据库的数据表列表

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
dataSourceIddataSourceIdpathtruestring
databasedatabasepathtruestring
systemsystemquerytruestring

响应示例:

  1. {
  2. "method": null,
  3. "status": 0,
  4. "message": "OK",
  5. "data": {
  6. "tables": [
  7. "test",
  8. "test_0317a",
  9. "test_import_sqoop_1",
  10. "test_linkis_sqoop_1",
  11. "test_linkis_sqoop_2",
  12. "test_linkis_sqoop_3",
  13. "upload_test"
  14. ]
  15. }
  16. }