All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsGroupList

Last Updated:Oct 26, 2026

Queries all Group IDs of a specified instance.

Operation description

Important The OpenAPI operations provided by Alibaba Cloud are management APIs used to manage and query resources of Alibaba Cloud services. Integrate these APIs only into management workflows. Do not rely on OpenAPI operations in the core data link for message publishing and consumption. Otherwise, risks may occur in the link.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mq:ListGroup

list

Group

acs:mq:{#regionId}:{#accountId}:{#InstanceId}

None
  • mq:QueryInstanceBaseInfo

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The instance ID corresponding to the Group ID for which you want to retrieve the resources.

MQ_INST_111111111111_DOxxxxxx

GroupId

string

No

The Group ID used for fuzzy match. If you specify this parameter, a fuzzy match is performed. Otherwise, all Group IDs are queried.

If you specify GID_ABC, a fuzzy match is performed, and all Group IDs that contain *GID_ABC* are returned, such as GID_test_GID_ABC_123 and GID_ABC_356.

GID_test_group_id

GroupType

string

No

The protocol applicable to the Group ID. Group IDs for TCP and HTTP protocols cannot be shared and must be created separately. Valid values:

  • tcp: the default value. This value indicates that the Group ID is applicable only to message publishing and consumption over TCP.

  • http: This value indicates that the Group ID is applicable only to message publishing and consumption over HTTP.

tcp

Tag

array<object>

No

The tags bound to the Group IDs. You can specify a maximum of 20 tags.

object

No

Key

string

Yes

The tag key of the Group ID. You must specify both Key and Value or leave both empty. If you specify both, the system filters Group IDs based on the tag. If you leave both empty, all Group IDs are queried.

  • If you specify this parameter, the value cannot be an empty string.

  • The value can be up to 128 characters in length, and cannot start with aliyun or acs:. The value cannot contain http:// or https://.

CartService

Value

string

Yes

The tag value of the Group ID. You must specify both Key and Value or leave both empty. If you specify both, the system filters Group IDs based on the tag. If you leave both empty, all Group IDs are queried.

  • If you specify this parameter, the value can be an empty string.

  • The value can be up to 128 characters in length, and cannot start with aliyun or acs:. The value cannot contain http:// or https://.

ServiceA

Response elements

Element

Type

Description

Example

object

RequestId

string

The common parameter. The ID of each request is unique and active for troubleshooting and locating issues.

16996623-AC4A-43AF-9248-FD9D2D75****

Data

object

SubscribeInfoDo

array<object>

The queried subscription relationships.

array<object>

Owner

string

The owner of the publication information.

138015630679****

UpdateTime

integer

The update time of the Group ID.

1570700979000

IndependentNaming

boolean

Indicates whether the instance has a namespace. Valid values:

  • true: The instance has an independent namespace. Resource names are unique within the instance, but can be duplicated across instances.

  • false: The instance does not have an independent namespace. Resource names must be globally unique within and across instances.

true

GroupId

string

The Group ID, which is the consumer group ID.

GID_test_group_id

Remark

string

The description.

test

CreateTime

integer

The creation time of the Group ID.

1568896605000

Tags

object

Tag

array<object>

The tags bound to the Group ID.

object

Key

string

The tag key.

CartService

Value

string

The tag value.

ServiceA

InstanceId

string

The instance ID.

MQ_INST_111111111111_DOxxxxxx

GroupType

string

The protocol applicable to the Group ID. Group IDs for TCP and HTTP protocols cannot be shared and must be created separately. Valid values:

  • tcp: This value indicates that the Group ID is applicable only to message publishing and consumption over TCP.

  • http: This value indicates that the Group ID is applicable only to message publishing and consumption over HTTP.

tcp

Examples

Success response

JSON format

{
  "RequestId": "16996623-AC4A-43AF-9248-FD9D2D75****",
  "Data": {
    "SubscribeInfoDo": [
      {
        "Owner": "138015630679****",
        "UpdateTime": 1570700979000,
        "IndependentNaming": true,
        "GroupId": "GID_test_group_id",
        "Remark": "test",
        "CreateTime": 1568896605000,
        "Tags": {
          "Tag": [
            {
              "Key": "CartService",
              "Value": "ServiceA"
            }
          ]
        },
        "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
        "GroupType": "tcp"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.