All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsGroupList

更新時間:Mar 03, 2024

Queries all groups on a specific instance.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mq:QueryInstanceBaseInfoList
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance to which the consumer group you want to query belongs.

MQ_INST_111111111111_DOxxxxxx
GroupIdstringNo

This parameter is required only when you query specific consumer groups by using the fuzzy search method. If this parameter is not configured, the system queries all consumer groups that can be accessed by the current account.

If you set this parameter to GID_ABC, the information about the consumer groups whose IDs contain GID_ABC is returned. For example, the information about the GID_test_GID_ABC_123 and GID_ABC_356 consumer groups is returned.

GID_test_group_id
GroupTypestringNo

The protocol over which the queried consumer group publishes and subscribes to messages. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different consumer groups for TCP clients and HTTP clients. Valid values:

  • tcp: specifies that the consumer group publishes or subscribes to messages over TCP. This value is the default value.
  • http: specifies that the consumer group publishes or subscribes to messages over HTTP.
tcp
Tagobject []No

The list of tags that are attached to the consumer group. A maximum of 20 tags can be included in the list.

KeystringYes

The key of the tag that is attached to the consumer group. This parameter is not required. If you configure this parameter, you must configure the Key parameter.**** If you configure both the Key and Value parameters, the consumer groups are filtered based on the specified tag. If you do not configure these parameters, all consumer groups are queried.

  • The value of this parameter cannot be an empty string.
  • The tag value must be 1 to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.
CartService
ValuestringYes

The value of the tag that is attached to the group. This parameter is not required. If you configure this parameter, you must configure the Key parameter.**** If you configure both the Key and Value parameters, the consumer groups are filtered based on the specified tag. If you do not configure these parameters, all consumer groups are queried.

  • The value of this parameter can be an empty string.
  • The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.
ServiceA

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

16996623-AC4A-43AF-9248-FD9D2D75****
Dataobject []

The returned list of subscriptions.

Ownerstring

The Alibaba Cloud account ID of the user who created the consumer group.

138015630679****
UpdateTimelong

The most recent point in time when the consumer group was updated.

1570700979000
IndependentNamingboolean

Indicates whether the instance uses a namespace. Valid values:

  • true: The instance uses a separate namespace. The name of each resource must be unique in the instance. The names of resources in different instances can be the same.
  • false: The instance does not use a separate namespace. The name of each resource must be globally unique within the instance and across all instances.
true
GroupIdstring

The ID of the consumer group.

GID_test_group_id
Remarkstring

The description of the consumer group.

test
CreateTimelong

The point in time when the consumer group was created.

1568896605000
Tagsobject []

The tags that are attached to the consumer group.

Keystring

The key of the tag that is attached to the consumer group.

CartService
Valuestring

The value of the tag that is attached to the consumer group.

ServiceA
InstanceIdstring

The ID of the instance

MQ_INST_111111111111_DOxxxxxx
GroupTypestring

The protocol over which the queried consumer group publishes and subscribes to messages. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different consumer groups for TCP clients and HTTP clients. Valid values:

  • tcp: indicates that the consumer group publishes and subscribes to messages over TCP.
  • http: indicates that the consumer group publishes and subscribes to messages over HTTP.
tcp

Examples

Sample success responses

JSONformat

{
  "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history