Queries all group IDs within a specified account.
Usage notes
This operation is used to generate a resource list rather than detailed information.
QPS limit
The queries-per-second (QPS) limit on this operation is 10 per user. Throttling is triggered when the number of calls to this operation exceeds this limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.
Authorization information
Alibaba Cloud accounts and Resource Access Management (RAM) users can call this operation without the need to be authorized. However, when a RAM user calls this operation, only the data about resources that the user has permissions to publish and subscribe to is returned. To obtain more resource information, the RAM user must be granted permissions on the relevant resources by the Alibaba Cloud account. For more information, see Policies and examples.
Debugging
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 instance where the group IDs you want to query are located. |
Tag.N.Key | String | Yes | CartService |
The key of tag N bound to the resource.
|
Tag.N.Value | String | Yes | ServiceA |
The value of tag N bound to the resource.
|
GroupId | String | No | GID_test_group_id |
This parameter is required only when you query a specified group ID. If this parameter is not specified, all group IDs are queried. If you set this value to GID_ABC, fuzzy search will be performed by matching the prefix and suffix. All group IDs that contain *GID_ABC*, such as GID_test_GID_ABC_123 and GID_ABC_356, will be returned. |
GroupType | String | No | tcp |
The protocol that is applicable to the queried group ID. A TCP-based instance cannot share a group ID with an HTTP-based instance. You must create a group ID for each of them. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Data | Array of SubscribeInfoDo |
The returned set of subscriptions. |
|
SubscribeInfoDo | |||
CreateTime | Long | 1568896605000 |
The time when the group ID was created. |
GroupId | String | GID_test_group_id |
The returned group ID. |
GroupType | String | tcp |
The protocol that is applicable to the queried group ID. A TCP-based instance cannot share a group ID with an HTTP-based instance. You must create a group ID for each of them. Valid values:
|
IndependentNaming | Boolean | true |
Indicates whether a namespace is configured for the instance where the group ID is located. Valid values:
|
InstanceId | String | MQ_INST_111111111111_DOxxxxxx |
The ID of the instance. |
Owner | String | 138015630679**** |
The Alibaba Cloud account ID of the user who created the group ID. |
Remark | String | test |
The description of the consumer group. |
Tags | Array of Tag |
The tags bound to the group ID. |
|
Tag | |||
Key | String | CartService |
The key of the tag. |
Value | String | ServiceA |
The value of the tag. |
UpdateTime | Long | 1570700979000 |
The time when the group ID was updated. |
RequestId | String | 16996623-AC4A-43AF-9248-FD9D2D75**** |
The ID of the request, which is a common parameter. Each request has a unique ID to facilitate troubleshooting and fault locating. |
Examples
Sample requests
http(s)://ons.cn-hangzhou.aliyuncs.com/?Action=OnsGroupList
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Tag.1.Key=CartService
&Tag.1.Value=ServiceA
&<Common request parameters>
Sample success responses
XML
format
<OnsGroupListResponse>
<RequestId>16996623-AC4A-43AF-9248-FD9D2D75****</RequestId>
<Data>
<SubscribeInfoDo>
<Owner>138015630679****</Owner>
<GroupType>tcp</GroupType>
<InstanceId>MQ_INST_111111111111_DOxxxxxx</InstanceId>
<CreateTime>1568896605000</CreateTime>
<UpdateTime>1570700979000</UpdateTime>
<IndependentNaming>true</IndependentNaming>
<GroupId>GID_test_group_id</GroupId>
<Remark>test</Remark>
<Tags>
<Tag>
<Value>ServiceA</Value>
<Key>CartService</Key>
</Tag>
</Tags>
</SubscribeInfoDo>
</Data>
</OnsGroupListResponse>
JSON
format
{
"RequestId": "16996623-AC4A-43AF-9248-FD9D2D75****",
"Data": {
"SubscribeInfoDo": [
{
"Owner": "138015630679****",
"GroupType": "tcp",
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"CreateTime": 1568896605000,
"UpdateTime": 1570700979000,
"IndependentNaming": true,
"GroupId": "GID_test_group_id",
"Remark": "test",
"Tags": {
"Tag": [
{
"Value": "ServiceA",
"Key": "CartService"
}
]
}
}
]
}
}
Error codes
For a list of error codes, visit the API Error Center.