Queries all Message Queue for Apache RocketMQ instances in a region within the current account.

Request limit

Each Alibaba Cloud account can call this operation up to 50 times per second. If the number of requests that you send to call this operation within one second reaches the request limit of this operation, new requests fail. This may interrupt your business. For information about the request limit of each operation, see API rate limits.

Authorization

By default, only Alibaba Cloud accounts can call this operation. If an instance uses a namespace, a Resource Access Management (RAM) user can call this operation to query the information about the instance only after the RAM user is granted the required permissions. For information about how to grant permissions, see Policies and examples.

  • If an instance does not use a namespace, RAM users can call this operation to query the information about the instance without authorization.
  • If an instance uses a namespace, RAM users must be granted the mq:QueryInstanceBaseInfo permission on the instance before they call this operation. Otherwise, this operation does not return the information about the instance. The following table describes the permissions that must be granted to a RAM user to query an instance that uses a namespace.

API

Action

Resource

OnsInstanceInServiceList

mq:QueryInstanceBaseInfo

acs:mq:*:*:{instanceId}

Request parameters

Parameter Type Required Example Description
Action String Yes OnsInstanceInServiceList

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

Tag.N.Key String Yes CartService

The key of a tag that is attached to the instances you want to query. This parameter is not required. If you configure this parameter, you must also configure the Tag.N.Value parameter. If you include the Tag.N.Key and Tag.N.Value parameters in a request, this operation queries only the instances that use the specified tags. If you do not include these parameters in a request, this operation queries all instances that you can access.

  • The value of N must be an integer value from 1 to 20.
  • If you include this parameter in a request, the value of this parameter cannot be an empty string.
  • The value of this parameter must be up to 128 characters in length and cannot start with acs: or aliyun, or contain http:// or https://.
Tag.N.Value String Yes SericeA

The value of a tag that is attached to the instances you want to query. This parameter is not required. If you configure this parameter, you must also configure the Tag.N.Key parameter. If you include the Tag.N.Key and Tag.N.Value parameters in a request, this operation queries only the instances that use the specified tags. If you do not include these parameters in a request, this operation queries all instances that you can access.

  • The value of N must be an integer value from 1 to 20.
  • The value of this parameter can be an empty string.
  • The value of this parameter must be up to 128 characters in length and cannot start with acs: or aliyun, or contain http:// or https://.

Response parameters

Parameter Type Example Description
RequestId String 0598E46F-DB06-40E2-AD7B-C45923EE****

The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID.

Data Array of InstanceVO

The information about the instances that are queried.

InstanceVO
IndependentNaming Boolean true

Indicates whether the instance uses a namespace. Valid values:

  • true: The instance uses a namespace. The identifier of each resource in the instance must be unique within the instance. However, the identifier of a resource in the instance can be the same as the identifier of a resource in another instance that uses a different namespace.
  • false: The instance does not use a namespace. The identifier of each resource in the instance must be unique across instances.
InstanceName String test1

The name of the instance.

The instance name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

ReleaseTime Long 1551024000000

The point in time when the instance expires. If the instance is an Enterprise Platinum Edition instance, this parameter is returned.

InstanceStatus Integer 5

The status of the instance. Valid values:

  • 0: The instance is being deployed. This value is available only for Enterprise Platinum Edition instances.
  • 2: The instance has overdue payments. This value is available for Standard Edition instances.
  • 5: The instance is running.
  • 7: The instance is being upgraded and is running. This value is available only for Enterprise Platinum Edition instances.
Tags Array of Tag

The tags that are attached to the instance.

Tag
Key String CartService

The key of the tag.

Value String ServiceA

The value of the tag.

InstanceId String MQ_INST_188077086902****_BXSuW61e

The ID of the instance.

InstanceType Integer 2

The edition of the instance. Valid values:

  • 1: Standard Edition
  • 2: Enterprise Platinum Edition

For more information about the instance editions and differences between the editions, see Instance editions.

Examples

Sample requests

http(s)://ons.cn-zhangjiakou.aliyuncs.com/?Action=OnsInstanceInServiceList
&Tag.1.Key=CartService
&Tag.1.Value=SericeA
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<OnsInstanceInServiceListResponse>
<RequestId>0598E46F-DB06-40E2-AD7B-C45923EE****</RequestId>
<Data>
    <InstanceVO>
        <InstanceName>test1</InstanceName>
        <InstanceId>MQ_INST_188077086902****_BXSuW61e</InstanceId>
        <ReleaseTime>1551024000000</ReleaseTime>
        <InstanceStatus>5</InstanceStatus>
        <IndependentNaming>true</IndependentNaming>
        <InstanceType>2</InstanceType>
        <Tags>
            <Tag>
                <Value>ServiceA</Value>
                <Key>CartService</Key>
            </Tag>
        </Tags>
    </InstanceVO>
</Data>
</OnsInstanceInServiceListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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