Query objects in the database

Query the readable volumes and tables in the specified database.

HTTP
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

Shell
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

id

integer

Yes

Database ID.

Successful response

JSON
{
  "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

code

string

OK on success.

msg

string

OK on success.

data.list

array of object

List of child objects. An empty array when there are no readable objects.

data.list[].id

integer or string

Object ID.

data.list[].name

string

Object name.

data.list[].type

string

Object type: volume or table.

data.list[].children_count

integer

The number of children. Return when applicable.

data.list[].size

integer

Storage size. Return when applicable.

data.list[].created_at

string

Creation time. Return when applicable.

data.list[].created_by

string

Creator ID. Return when applicable.

data.list[].updated_at

string

Update time. Return when applicable.

data.list[].updated_by

string

Updater ID. Return when applicable.

data.list[].description

string

Object description.

data.list[].display_name

string

Object display name. Return when applicable.

data.list[].display_description

string

Object display description. Return when applicable.

data.list[].reserved

boolean

Whether it is a reserved object.

data.list[].is_pub

boolean

Whether it is a publishing object. Return when applicable.

data.list[].is_sub

boolean

Whether it is a subscription object. Return when applicable.

data.list[].allowed_actions

array of string

Currently an empty array is returned and no available operation determination is provided.

Error response

JSON
{
  "code": "ErrObjectNotFound",
  "msg": "数据库不存在"
}

Field

Type

Description

code

string

error code.

msg

string

error message.

Last updated on