Updated on 2022-09-14 GMT+08:00

Querying the Consumer Group List

Function

This API is used to query the consumer group list.

URI

GET /v2/{project_id}/instances/{instance_id}/groups

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

group

No

String

Consumer group name.

limit

No

Integer

Number of records to query.

Default: 10

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Default: 0

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Number

Total number of consumer groups.

groups

Array of ConsumerGroup objects

Consumer group list.

max

Number

Maximum number of consumer groups that can be created.

remaining

Number

Number of consumer groups that can still be created.

next_offset

Number

Offset of the next page.

previous_offset

Number

Offset of the previous page.

Table 4 ConsumerGroup

Parameter

Type

Description

enabled

Boolean

Enabled or not.

broadcast

Boolean

Whether to broadcast.

brokers

Array of strings

List of associated brokers.

name

String

Consumer group name.

retry_max_time

Number

Maximum number of retries.

from_beginning

Boolean

Whether consumption starts from the beginning.

Example Requests

Querying the consumer group list

GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups

Example Responses

Status code: 200

Consumer groups queried successfully.

{
  "total" : 1,
  "groups" : [ {
    "enabled" : true,
    "broadcast" : false,
    "brokers" : [ "broker-0" ],
    "name" : "aaaaa",
    "retry_max_time" : 16,
    "from_beginning" : false
  } ],
  "max" : 4000,
  "remaining" : 3999,
  "next_offset" : -1,
  "previous_offset" : -1
}

Status Codes

Status Code

Description

200

Consumer groups queried successfully.

Error Codes

See Error Codes.