Querying Database Objects
Function
This API is used to query database objects.
Constraints
The guestAgent plug-in of the cluster is 8.2.1.1 or later.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/clusters/{cluster_id}/db-manager/objects
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
cluster_id |
Yes |
String |
Definition Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID. Constraints The value must be a valid DWS cluster ID. Range It is a 36-digit UUID. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Definition Object type. Constraints N/A Range DATABASE, SCHEMA, TABLE, VIEW, COLUMN, FUNCTION, SEQUENCE, or NODEGROUP Default Value null |
name |
No |
String |
Definition Object name. Constraints N/A Range N/A Default Value N/A |
database |
No |
String |
Definition Database name. Constraints N/A Range N/A Default Value N/A |
schema |
No |
String |
Definition Schema name. Constraints This parameter is mandatory when the object type is TABLE, VIEW, COLUMN, FUNCTION, or SEQUENCE. Range N/A Default Value N/A |
table |
No |
String |
Definition Table name. Constraints This parameter is mandatory when the object type is COLUMN. Range N/A Default Value N/A |
offset |
No |
Integer |
Definition Page offset, which starts from 0 (page number minus 1). Constraints N/A Range Greater than or equal to 0 Default Value 0 |
limit |
No |
Integer |
Definition Page size. Constraints N/A Range N/A Default Value 1000 |
is_fine_grained_disaster |
No |
String |
Definition Whether fine-grained DR is enabled. Constraints N/A Range true|false Default Value N/A |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition Type. Range DATABASE, SCHEMA, TABLE, VIEW, COLUMN, FUNCTION, SEQUENCE, or NODEGROUP |
object_list |
Array of DatabaseObjectInfo objects |
Definition Object list. Range N/A |
count |
String |
Definition Total number of objects. Range N/A |
Example Requests
Query the database list of a cluster.
GET https://{Endpoint}/v1/0536cdee2200d5912f7cc00b877980f1/clusters/a89aea88-7ea2-40bd-8ac8-8b93e169e5d6/db-manager/objects?type=DATABASE&database=&schema=&table=&name=&offset=0&limit=10
Example Responses
Status code: 200
Query succeeded.
{ "type" : "DATABASE", "object_list" : [ { "obj_name" : "gaussdb" }, { "obj_name" : "postgres" } ], "count" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
Query succeeded. |
400 |
Request error. |
401 |
Authentication failed. |
403 |
You do not have required permissions. |
404 |
No resources found. |
500 |
Internal server error. |
503 |
Service unavailable. |
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