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