You can call this operation to query group IDs under your account rather than the details about each group ID.

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 OnsGroupList

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

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance corresponding to the group IDs that you want to query.

GroupId String No GID_test_group_id

The group ID that you want to query. This parameter is required only when you want to query a specified group ID. If this parameter is not specified, all group IDs are queried.

GroupType String No tcp

The protocol that is applicable to the group ID that you want to query. TCP-based instances cannot be located in the same group with HTTP-based instances. You must create group IDs for TCP-based instances and for HTTP-based instances separately. Valid values:

  • tcp: specifies that the group ID is applicable only to messages sent and received over TCP. The value is the default value.
  • http: specifies that the group ID is applicable only to messages sent and received over HTTP.

Response parameters

Parameter Type Example Description
Data Array

The returned query results.

SubscribeInfoDo
CreateTime Long 1568896605000

The time when the group ID was created.

GroupId String GID_test_group_id

The returned consumer group ID.

GroupType String tcp

The protocol that is applicable to the queried group ID. TCP-based instances cannot be located in the same group with HTTP-based instances. You must create group IDs for TCP-based instances and for HTTP-based instances separately. Valid values:

  • tcp: indicates that the group ID is applicable only to messages sent and received over TCP.
  • http: indicates that the group ID is applicable only to messages sent and received over HTTP.
IndependentNaming Boolean true

Indicates whether any namespace is configured for the Message Queue for Apache RocketMQ instance corresponding to the group ID. Valid values:

  • true: An independent namespace is configured for the Message Queue for Apache RocketMQ instance. Resource names must be unique within the Message Queue for Apache RocketMQ instance but can be the same across different Message Queue for Apache RocketMQ instances.
  • false: No independent namespace is configured for the Message Queue for Apache RocketMQ instance. Resource names must be globally unique across all Message Queue for Apache RocketMQ instances.
InstanceId String MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance corresponding to the group ID.

Owner String 138015630679****

The owner of the consumer group.

Remark String test

The description of the consumer group.

UpdateTime Long 1570700979000

The time when the group ID was updated.

RequestId String 16996623-AC4A-43AF-9248-FD9D2D75C8E8

The ID of the request. This is a common parameter.

Examples

Sample requests

http(s)://[Endpoint]/? Action=OnsGroupList
&GroupId=GID_test_group_id
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&<Common request parameters>

Sample success responses

XML format

<OnsGroupListResponse>
<RequestId>4BEEDAB7-FC7E-40E8-8A1D-6E543A81B5C0</RequestId>
<Data>
    <SubscribeInfoDo>
        <Owner>1380156306793859</Owner>
        <GroupType>tcp</GroupType>
        <InstanceId>MQ_INST_1380156306793859_BbCOxxsU</InstanceId>
        <CreateTime>1570700979000</CreateTime>
        <UpdateTime>1570700979000</UpdateTime>
        <IndependentNaming>true</IndependentNaming>
        <GroupId>GID_test_group_id</GroupId>
        <Remark>gag</Remark>
    </SubscribeInfoDo>
</Data>
/<OnsGroupListResponse>

JSON format

{
	"RequestId": "4BEEDAB7-FC7E-40E8-8A1D-6E543A81B5C0",
	"Data": {
		"SubscribeInfoDo": [
			{
				"Owner": "1380156306793859",
				"GroupType": "tcp",
				"InstanceId": "MQ_INST_1380156306793859_BbCOxxsU",
				"CreateTime": 1570700979000,
				"UpdateTime": 1570700979000,
				"IndependentNaming": true,
				"GroupId": "GID_test_group_id",
				"Remark": "gag"
			}
		]
	}
}

Error codes

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