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

QPS limit

The queries per second (QPS) limit on this operation is 50 per user. When the number of calls of this operation per second exceeds the QPS limit, throttling is triggered. If throttling is triggered, your business may be affected. We recommend that you take note of the QPS limit on this operation. For more information, see QPS limit.

Authorization information

Alibaba Cloud accounts and RAM users can call this operation without authorization. For more information, see Policies and examples.

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 the tag that is attached to the instance. This parameter is not required. However, if you configure this parameter, you must also configure the Tag.N.Value parameter. If you configure both the Tag.N.Key and Tag.N.Value parameters, the instances are filtered based on the tag. If you do not configure these parameters, all instances are queried.

  • Valid values of N: 1 to 20.
  • The parameter value cannot be an empty string.
  • The value can be up to 128 characters in length. It cannot start with aliyun or acs: or contain http:// or https://.
Tag.N.Value String Yes SericeA

The value of the tag that is attached to the instance. This parameter is not required. However, if you configure this parameter, you must also configure the Tag.N.Key parameter. If you configure both the Tag.N.Key and Tag.N.Value parameters, the instances are filtered based on the tag. If you do not configure these parameters, all instances are queried.

  • Valid values of N: 1 to 20.
  • The parameter value can be an empty string.
  • The value can be up to 128 characters in length. It cannot start with aliyun or acs: or contain http:// or https://.

Response parameters

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

The ID of the request. This is a common parameter. Each request has a unique ID. This facilitates troubleshooting and fault locating.

Data Array of InstanceVO

The returned list of all published instances.

InstanceVO
IndependentNaming Boolean true

Indicates whether a namespace is configured for the Message Queue for Apache RocketMQ instance. Valid values:

  • true: A separate namespace is configured for the instance. Resource names must be unique within the instance. However, resources in different instances can have the same name.
  • false: No separate namespace is configured for the instance. The resource names must be unique across all instances.
InstanceName String test1

The name of the instance.

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

ReleaseTime Long 1551024000000

The time when an Enterprise Platinum Edition instance expires.

InstanceStatus Integer 5

The status of the instance. Valid values:

  • 0: The instance is an Enterprise Platinum Edition instance that is being deployed.
  • 2: The instance is a Standard Edition instance for which payment is overdue.
  • 5: The instance is a Standard Edition or Enterprise Platinum Edition instance that is running.
  • 7: The instance is an Enterprise Platinum Edition instance that is being upgraded and is available.
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 Message Queue for Apache RocketMQ instance.

InstanceType Integer 2

The edition of the instance. Valid values:

  • 1: Standard Edition
  • 2: Enterprise Platinum Edition

For more information, 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.