All Products
Search
Document Center

ApsaraMQ for Kafka:GetTopicStatus

Last Updated:Mar 15, 2024

Queries the status information about messages in a specified topic.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alikafka:ListTopicRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

alikafka_pre-cn-v0h15tjm****
TopicstringYes

The name of the topic.

normal_topic_9d034262835916103455551be06cc****
RegionIdstringNo

The region ID of the instance.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code returned. The HTTP status code 200 indicates that the request is successful.

200
Messagestring

The returned message.

operation success.
RequestIdstring

The ID of the request.

E475C7E2-8C35-46EF-BE7D-5D2A9F5D****
Successboolean

Indicates whether the request is successful.

true
TopicStatusobject

The status information about messages in the topic.

TotalCountlong

The number of messages in the topic.

423
LastTimeStamplong

The time when the last consumed message was generated.

1566470063575
OffsetTableobject []

The information about offsets in the topic.

Partitioninteger

The ID of the partition.

0
MinOffsetlong

The earliest offset in the partition of the topic.

0
LastUpdateTimestamplong

The last time when the partition was modified.

1566470063547
MaxOffsetlong

The latest offset in the partition of the topic.

76
Topicstring

The name of the topic.

testkafka

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "operation success.",
  "RequestId": "E475C7E2-8C35-46EF-BE7D-5D2A9F5D****",
  "Success": true,
  "TopicStatus": {
    "TotalCount": 423,
    "LastTimeStamp": 1566470063575,
    "OffsetTable": {
      "OffsetTable": [
        {
          "Partition": 0,
          "MinOffset": 0,
          "LastUpdateTimestamp": 1566470063547,
          "MaxOffset": 76,
          "Topic": "testkafka"
        }
      ]
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.