Querying the Disk Usage Status of Topics
Function
This API is used to query the broker disk usage of topics.
URI
GET /v2/{project_id}/mqs/instances/{instance_id}/topics/diskusage
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID |
| instance_id | Yes | String | Instance ID |
| 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
| 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
| 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. |
| Parameter | Type | Description |
|---|---|---|
| size | String | Disk space. |
| topic_name | String | Topic name. |
| topic_partition | Integer | Partition. |
| percentage | String | Used percentage. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 403
| 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.