MetadataCoreRestful

getColumns

Interface address: /api/rest_j/v1/metadatamanager/columns/{dataSourceId}/db/{database}/table/{table}

Request method: GET

Request data type: application/x-www-form-urlencoded

Response data type: application/json

Interface description: Get the column information of the data table

Request Parameters:

Parameter name Parameter description Request type Required Data type schema
dataSourceId dataSourceId path true string
database database path true string
system system query true string
table table path true string

Sample Response:

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

Interface address:/api/rest_j/v1/metadatamanager/dbs/{dataSourceId}

Request method: GET

Request data type: application/x-www-form-urlencoded

Response data type: application/json

Interface description: Get the list of database names of the data source

Request Parameters:

Parameter name Parameter description Request type Required Data type schema
dataSourceId dataSourceId path true string
system system query true string

Sample Response:

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

Interface address:/api/rest_j/v1/metadatamanager/partitions/{dataSourceId}/db/{database}/table/{table}

Request method: GET

Request data type: application/x-www-form-urlencoded

Response data type: application/json

Interface description:

Request Parameters:

Parameter name Parameter description Request type Required Data type schema
dataSourceId dataSourceId path true string
database database path true string
system system query true string
table table path true string
traverse traverse query false boolean

Sample Response:

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

Interface address:/api/rest_j/v1/metadatamanager/props/{dataSourceId}/db/{database}/table/{table}

Request method: GET

Request data type: application/x-www-form-urlencoded

Response data type: application/json

Interface description:

Request Parameters:

Parameter name Parameter description Request type Required Data type schema
dataSourceId dataSourceId path true string
database database path true string
system system query true string
table table path true string

Sample Response:

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: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. }