Help Center/ Data Admin Service/ API Reference/ APIs/ Intelligent O&M/ Obtaining the OBS Object List
Updated on 2026-08-25 GMT+08:00

Obtaining the OBS Object List

Function

This API is used to obtain the OBS object list.

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    das::showCloudDBAInfo

    Read

    Instance

    -

    -

    -

URI

GET /v3/{project_id}/connections/{connection_id}/obs/objects

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are supported.

Default Value

N/A

connection_id

Yes

String

Definition

Connection ID established between a database account and the database. The database user ID is created using the API in Creating an Instance Connection.

Constraints

N/A

Range

The value is a UUID containing 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

bucket_name

Yes

String

Definition

OBS bucket name

Constraints

N/A

Range

N/A

Default Value

N/A

max_keys

Yes

Integer

Definition

The maximum number of objects returned in lexicographical order

Constraints

N/A

Range

The value ranges from 1 to 1000. If the specified value is greater than 1000, only 1,000 objects are returned.

Default Value

1000

marker

No

String

Definition

Identifier as the start position for listing objects in a bucket. Objects are returned in lexicographical order of object names starting from this identifier.

Constraints

This parameter is only available for listing objects without multiple versions.

Range

1 to 1,024 characters

Default Value

None

prefix

No

String

Definition

Name prefix that objects to be listed must contain

Constraints

The object name must be in the correct format.

Range

1 to 1,024 characters

Default Value

None

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

bucket_name

String

Definition

OBS bucket name

Range

N/A

marker

String

Definition

Identifier as the start position for listing objects in a bucket. Objects are returned in lexicographical order of object names starting from this identifier.

Assume that you have the following objects: test/a, test/b, test/c, and test/d. If you specify test/b as the identifier, objects test/c and test/d will be returned.

Range

1 to 1,024 characters

next_marker

String

Definition

The last object in the returned list. This parameter is returned when not all the objects are listed. You can set the Marker value to list the remaining objects in follow-up requests.

Range

A string indicating the name of an object from which the next request starts

is_truncated

Boolean

Definition

Whether all results are returned in this request

Range

N/A

max_keys

Integer

Definition

The maximum number of objects returned in lexicographical order

Range

The value ranges from 1 to 1000. If a value exceeds the range, 1000 is used.

prefix

String

Definition

Name prefix that objects to be listed must contain

Assume that you have the following objects: logs/day1, logs/day2, logs/day3, and ExampleObject.jpg. If you specify logs/ as the prefix, logs/day1, logs/day2, and logs/day3 will be returned. If this parameter is left blank and there are no other filters, all objects in the bucket will be returned.

Range

N/A

common_prefixes

Array of Strings

Definition

Group information

Range

N/A

contents

Array of Table 4 objects

Definition

Object metadata

Range

N/A

Example Requests

Table 4 ObsObjectInfo

Parameter

Type

Description

object_key

String

Definition

Object name

Range

N/A

content_length

Long

Definition

Size of an object file

Range

N/A

GET ST https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/connections/179e525e-0e9c-4dcc-9dd7-ee2f36121e23/obs/objects?bucket_name=5257&max_keys=1000&prefix=&marker=
 
{ 
 "datastore_type": "MySQL" 
}

Example Responses

Status code: 200

Success.

{
    "bucket_name": "5257",
    "marker": "",
    "truncated": false,
    "max_keys": 1000,
    "prefix": "",
    "common_prefixes": [],
    "contents": [
        {
            "object_key": "DAS_Imexport_Export_40d349d2b11c444384e0a3960f8651b3_all_sql.zip",
            "content_length": 314
        },
        {
            "object_key": "DAS_Imexport_Export_e8388837919049bf9887167241b56f85_all_sql.zip",
            "content_length": 3852040027
        },
        {
            "object_key": "fullsql_bcfa975193f1402fa11a6d4fd6baf5fbin01_1764576400379.zip",
            "content_length": 3753
        }
    ]
}

Status Codes

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Codes

See Error Codes.