Obtaining Schemas (to Be Brought Offline)
Function
This API is used to obtain schemas. Only GaussDB(DWS) and RDS for PostgreSQL support schemas. Before calling this API, check whether the data source supports the schema field.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/{connection_id}/schemas
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Project ID and Account ID. |
|
connection_id |
Yes |
String |
Data connection ID, which can be obtained from the data connection list. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
database_name |
Yes |
String |
Database name |
|
limit |
No |
String |
Maximum number of data records |
|
offset |
No |
String |
Offset |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. This parameter is mandatory when token authentication is used. You can obtain it from the value of X-Subject-Token in the response message header returned by the "Obtaining a User Token" API of the IAM service. |
|
workspace |
Yes |
String |
Workspace ID |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_count |
Integer |
Number of schemas connected to the current data connection |
|
dw_id |
String |
Data connection ID. |
|
database |
String |
Database name |
|
schemas |
Array of SchemasList objects |
Schemas |
|
Parameter |
Type |
Description |
|---|---|---|
|
schema_name |
String |
Schema name |
|
description |
String |
Schema description |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Returned error information. |
|
error_code |
String |
Returned error code. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Returned error information. |
|
error_code |
String |
Returned error code. |
Example Requests
None
Example Responses
Status code: 200
The schema list is returned.
{
"dw_id" : "9b18c0ad6ef5404caef4e6cbaccdae6f",
"database" : "postgres",
"schemas" : [ {
"schema_name" : "dm_autotest",
"description" : ""
}, {
"schema_name" : "dbadmin",
"description" : ""
}, {
"schema_name" : "public",
"description" : "gs_roach_stop_backup"
}, {
"schema_name" : "schema",
"description" : ""
}, {
"schema_name" : "utl_file",
"description" : ""
}, {
"schema_name" : "utl_raw",
"description" : ""
} ],
"total_count" : 6
}
Status code: 400
Bad request.
{
"error_code" : "DAYU.4402",
"error_msg" : "The operation failed, detail msg {0}."
}
Status code: 500
Internal server error.
{
"error_code" : "DAYU.3531",
"error_msg" : "Internal server error: {0}"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The schema list is returned. |
|
400 |
Bad request. |
|
500 |
Internal server error. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot