Query objects in the database¶
Query the readable volumes and tables in the specified database.
POST $CLOUDSIGMA_API_BASE/catalog/database/children
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the database list to obtain the target database ID. Prepare the personal access token, target workspace ID, and database ID that can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/database/children" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"id": '"$DATABASE_ID"'
}'
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"list": [
{
"id": 10,
"name": "raw",
"type": "volume",
"children_count": 2,
"size": 1024,
"description": "原始文件",
"reserved": false,
"allowed_actions": [
"volume.read"
]
}
]
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
array of object |
List of child objects. An empty array when there are no readable objects. |
|
integer or string |
Object ID. |
|
string |
Object name. |
|
string |
Object type: |
|
integer |
The number of children. Return when applicable. |
|
integer |
Storage size. Return when applicable. |
|
string |
Creation time. Return when applicable. |
|
string |
Creator ID. Return when applicable. |
|
string |
Update time. Return when applicable. |
|
string |
Updater ID. Return when applicable. |
|
string |
Object description. |
|
string |
Object display name. Return when applicable. |
|
string |
Object display description. Return when applicable. |
|
boolean |
Whether it is a reserved object. |
|
boolean |
Whether it is a publishing object. Return when applicable. |
|
boolean |
Whether it is a subscription object. Return when applicable. |
|
array of string |
Currently an empty array is returned and no available operation determination is provided. |
Error response¶
{
"code": "ErrObjectNotFound",
"msg": "数据库不存在"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
error message. |