Help Center/ ROMA Connect/ API Reference/ Message Integration APIs/ Topic Management/ Querying the Disk Usage Status of Topics
Updated on 2025-10-22 GMT+08:00

Querying the Disk Usage Status of Topics

Function

This API is used to query the broker disk usage of topics.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

GET /v2/{project_id}/mqs/instances/{instance_id}/topics/diskusage

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

instance_id

Yes

String

Instance ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

minSize

No

String

Occupied disk size, in KB, MB, or GB. Range: 1–10000. (The minSize, top, and percentage parameters cannot be empty at the same time.)

top

No

String

Querying partitions by top disk usage. Value range: 1–1000. (The minSize, top, and percentage parameters cannot be empty at the same time.)

percentage

No

String

Querying partitions by the percentage of the used disk space. Value range: 1–100. (The minSize, top, and percentage parameters cannot be empty at the same time.)

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

broker_name

String

Broker name.

data_disk_size

String

Disk space.

data_disk_use

String

Used disk space.

data_disk_free

String

Free disk space.

data_disk_use_percentage

Integer

Disk usage.

status

String

Querying status.

topic_list

Array of TopicListEnity objects

Topic list.

Table 5 TopicListEnity

Parameter

Type

Description

size

String

Disk space.

topic_name

String

Topic name.

topic_partition

Integer

Partition.

percentage

String

Used percentage.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Query succeeded.

"GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics/diskusage?minSize=1G"

{
  "broker_list" : [ {
    "broker_name" : "broker-0",
    "data_disk_size" : "66G",
    "data_disk_use" : "53M",
    "data_disk_free" : "63G",
    "data_disk_use_percentage" : "1",
    "status" : "Success get info",
    "topic_list" : [ {
      "size" : "12K",
      "topic_name" : "topic-test",
      "topic_partition" : "2",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "12K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "4",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "12K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "3",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "6",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "4",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "2",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "0",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "topic-test",
      "topic_partition" : "0",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "topic-1568537362",
      "topic_partition" : "2",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "7",
      "percentage" : 1.1559688683712121E-5
    } ]
  } ]
}

Example Responses

Status code: 200

OK

{
  "broker_list" : [ {
    "broker_name" : "broker-0",
    "data_disk_size" : "66G",
    "data_disk_use" : "53M",
    "data_disk_free" : "63G",
    "data_disk_use_percentage" : "1",
    "status" : "Success get info",
    "topic_list" : [ {
      "size" : "12K",
      "topic_name" : "topic-test",
      "topic_partition" : "2",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "12K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "4",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "12K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "3",
      "percentage" : 1.7339533025568183E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "6",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "4",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "2",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__trace",
      "topic_partition" : "0",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "topic-test",
      "topic_partition" : "0",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "topic-1568537362",
      "topic_partition" : "2",
      "percentage" : 1.1559688683712121E-5
    }, {
      "size" : "8.0K",
      "topic_name" : "__consumer_offsets",
      "topic_partition" : "7",
      "percentage" : 1.1559688683712121E-5
    } ]
  } ]
}

Status code: 400

Query failed.

{
  "error_code" : 400,
  "error_msg" : "Bad Request"
}

Status code: 403

Query failed.

{
  "error_code" : 403,
  "error_msg" : "Forbidden"
}

Status Codes

Status Code

Description

200

OK

400

Query failed.

403

Query failed.

Error Codes

See Error Codes.