Queries all consumer groups under the current account when you use AMQP server-side subscriptions. You can also call this operation to perform a fuzzy search based on a consumer group name.

Limits

Each Alibaba Cloud account can run a maximum of 5 queries per second (QPS).

Note RAM users of an Alibaba Cloud account share the quota of the account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryConsumerGroupList

The operation that you want to perform. Set the value to QueryConsumerGroupList.

CurrentPage Integer Yes 1

The number of the page to return. Pages start from page 1.

PageSize Integer Yes 2

The number of entries to return on each page. Valid values: 1 to 1000.

IotInstanceId String No iot-cn-0pp1n8t****

The ID of the instance. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.

Fuzzy Boolean No false

Specifies whether to use fuzzy search. Valid values:

  • true: uses fuzzy search. You must specify the GroupName parameter.
  • false: queries all consumer groups under the current account.

Default value: false.

GroupName String No Consumer group A

The name of the consumer group to be queried. This parameter is required if the Fuzzy parameter is set to true.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API operation. For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String iot.system.SystemException

The error code returned if the call fails. For more information about error codes, see Error codes.

CurrentPage Integer 1

The page number of the returned page.

Data Array

The details about the consumer group. This parameter is returned if the call is successful. For more information about details, see ConsumerGroupDTO.

ConsumerGroupDTO
CreateTime String 2020-05-20T00:05:20.000Z

The time when the consumer group was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ss.SSSZ format. The time is displayed in UTC and accurate to milliseconds.

GroupId String nJRaJPn5U1JITGf******

The ID of the consumer group.

GroupName String Consumer group 1

The name of the consumer group.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

PageCount Integer 4

The total number of returned pages.

PageSize Integer 2

The number of entries returned per page.

RequestId String 73B9DF43-7780-47DE-8BED-077729D28BD2

The ID of the request.

Success Boolean True

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.
Total Interger 8

The total number of entries.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryConsumerGroupList
&CurrentPage=1
&PageSize=2
&Fuzzy=true
&GroupName=Consumer group A
&<Common request parameters>

Sample success responses

XML format

<QueryConsumerGroupListResponse>
    <PageSize>2</PageSize>
    <PageCount>4</PageCount>
    <CurrentPage>1</CurrentPage>
    <Total>8</Total>
    <Data>
        <ConsumerGroupDTO>
            <GroupId>nJRaJPn5U1JITGf******</GroupId>
            <GroupName>Consumer group 1</GroupName>
            <CreateTime>2020-05-29T03:37:56.000Z</CreateTime>
        </ConsumerGroupDTO>
        <ConsumerGroupDTO>
            <GroupId>qJRaJPndeefwgef******</GroupId>
            <GroupName>Consumer group 2</GroupName>
            <CreateTime>2020-01-17T07:27:01.000Z</CreateTime>
        </ConsumerGroupDTO>
    </Data>
    <RequestId>73B9DF43-7780-47DE-8BED-077729D28BD2</RequestId>
    <Success>true</Success>
</QueryConsumerGroupListResponse>

JSON format

{
    "PageSize": 2,
    "PageCount": 4,
    "CurrentPage": 1,
    "Total": 8,
    "Data": {
        "ConsumerGroupDTO": [
            {
                "GroupId": "nJRaJPn5U1JITGf******",
                "GroupName": "Consumer group 1",
                "CreateTime": "2020-05-29T03:37:56.000Z"
            },
            {
                "GroupId": "qJRaJPndeefwgef******",
                "GroupName": "Consumer group 2",
                "CreateTime": "2020-01-17T07:27:01.000Z"
            }
        ]
    },
  "RequestId": "73B9DF43-7780-47DE-8BED-077729D28BD2",
  "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.