All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsInstanceInServiceList

Last Updated:Dec 12, 2025

Queries all ApsaraMQ for RocketMQ 4.x instances in a specified region.

Operation description

Important The OpenAPI provided by Alibaba Cloud is a management Application Programming Interface (API). Use this API to manage and query resources for Alibaba Cloud services. Integrate the API for management purposes only. Do not rely on the API for core data links that send and receive messages. This can introduce threats to your data links.

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:QueryInstanceBaseInfo

list

Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

Tag

array<object>

No

A list of tags attached to the instance. The list can contain up to 20 elements.

object

No

A tag attached to the instance.

Key

string

No

The tag key. Specify both Key and Value to filter instances by tag. Omit both to query all instances.

  • This parameter cannot be an empty string.

  • The tag key can be up to 128 characters long. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

CartService

Value

string

No

The tag value. Specify both Key and Value to filter instances by tag. Omit both to query all instances.

  • This parameter can be an empty string.

  • The tag value can be up to 128 characters long. It cannot start with aliyun or acs:. It cannot contain http:// or https://.

SericeA

NeedResourceInfo

boolean

No

Specifies whether to return resource statistics. The statistics include the number of topics and groups in the instance.

true

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. This is a common parameter. Each request has a unique ID. Use this ID to troubleshoot and locate issues.

0598E46F-DB06-40E2-AD7B-C45923EE****

Data

object

InstanceVO

array<object>

A list of all published instances.

array<object>

A list of all published instances.

IndependentNaming

boolean

Indicates whether the instance has a namespace. Valid values:

  • true: The instance has an independent namespace. Resource names must be unique within the instance, but can be the same as resource names in other instances.

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

true

InstanceName

string

The name of the instance.

test1

ReleaseTime

integer

The expiration time of the Platinum instance.

1551024000000

InstanceStatus

integer

The status of the instance. Valid values:

  • 0: The Platinum instance is being deployed.

  • 2: The payment for the standard instance is overdue.

  • 5: The standard or Platinum instance is in service.

  • 7: The Platinum instance is being upgraded and is available.

5

Tags

object

Tag

array<object>

The tags attached to the instance.

object

The tags attached to the instance.

Key

string

The tag key.

CartService

Value

string

The tag value.

ServiceA

InstanceId

string

The ID of the instance.

MQ_INST_188077086902****_BXSuW61e

InstanceType

integer

The type of the instance. Valid values:

  • 1: Standard instance

  • 2: Platinum instance

For information about the specifications and differences between instance types, see Instance types.

2

CreateTime

integer

The time when the instance was created. This value is a UNIX timestamp in milliseconds.

1640847284000

TopicCount

integer

The number of topics.

1

GroupCount

integer

The number of consumer groups.

3

Examples

Success response

JSON format

{
  "RequestId": "0598E46F-DB06-40E2-AD7B-C45923EE****",
  "Data": {
    "InstanceVO": [
      {
        "IndependentNaming": true,
        "InstanceName": "test1",
        "ReleaseTime": 1551024000000,
        "InstanceStatus": 5,
        "Tags": {
          "Tag": [
            {
              "Key": "CartService",
              "Value": "ServiceA"
            }
          ]
        },
        "InstanceId": "MQ_INST_188077086902****_BXSuW61e",
        "InstanceType": 2,
        "CreateTime": 1640847284000,
        "TopicCount": 1,
        "GroupCount": 3
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.