Queries rules by page.
QPS limits
You can call this API operation up to 20 times per second per account.
The Resource Access Management (RAM) users of an Alibaba Cloud account share the quota of the account.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | ListRule | The operation that you want to perform. Set the value to ListRule. |
CurrentPage | Integer | Yes | 1 | The page number. Maximum value: 1000. Default value: 1. |
PageSize | Integer | Yes | 2 | The number of entries per page. Valid values: 1 to 100. Default value: 10. |
IotInstanceId | String | No | iot_instc_pu****_c*-v64******** | The instance ID. You can view the instance ID on the Overview tab of the IoT Platform console. Important
For more information about instances, see Overview. |
ResourceGroupId | String | No | rg-acfmxazb4ph**** | The resource group ID. Important IoT Platform supports resource group management only by instance. The ResourceGroupId parameter is invalid. You do not need to specify this parameter. |
In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
Code | String | iot.system.SystemException | The error code returned if the request failed. For more information, see Error codes. |
Data | Array of RuleInfo | The rules returned if the request was successful. For more information, see the description of the RuleInfo parameter in this topic. Note The returned rules are sorted in descending order based on the time when the rules were created. | |
RuleInfo | |||
CreateUserId | Long | 1231579085000000 | The ID of the user who created the rule. |
Created | String | Wed Feb 27 20:45:43 CST 2019 | The time when the rule was created. The time is displayed in UTC-6. |
DataType | String | JSON | The data type of the rule. Valid values: JSON and BINARY. |
Id | Long | 151454 | The rule ID. |
Modified | String | Wed Feb 27 20:45:43 CST 2019 | The time when the rule was last modified. The time is displayed in UTC-6. |
Name | String | test123 | The name of the rule. |
ProductKey | String | a1KiV****** | The ProductKey of the product to which the rule applies. |
RuleDesc | String | rule1Desc | The description of the rule. |
Select | String | deviceName() as deviceName | The content in the SELECT clause in the SQL statement of the rule. |
ShortTopic | String | +/thing/event/property/post | The name of the topic to which the rule applies, excluding the ProductKey. The value is in the format of Note The topic name may contain the |
Status | String | STOP | The state of the rule. Valid values:
|
Topic | String | /a1T27vz****/+/thing/event/property/post | The name of the topic to which the rule applies, including the ProductKey. The value is in the format of Note The topic name may contain the |
UtcCreated | String | 2019-02-27T12:40:43.000Z | The time when the rule was created. The time is displayed in UTC. |
UtcModified | String | 2019-02-27T12:45:43.000Z | The time when the rule was last modified. The time is displayed in UTC. |
Where | String | Temperature>35 | The condition in the WHERE clause in the SQL statement of the rule. |
ErrorMessage | String | A system exception occurred. | The error message returned if the request failed. |
Page | Integer | 1 | The page number. |
PageSize | Integer | 2 | The number of entries per page. |
RequestId | String | 1564B626-DE97-452D-9E9B-305888AC6105 | The request ID. |
Success | Boolean | true | Indicates whether the request was successful. Valid values:
|
Total | Integer | 25 | The total number of pages returned. |
Examples
Sample requests
https://iot.cn-shanghai.aliyuncs.com/?Action=ListRule
&PageSize=2
&CurrentPage=1
&<Common request parameters>
Sample success responses
XML
format
<ListRuleResponse>
<Data>
<RuleInfo>
<DataType>JSON</DataType>
<ProductKey>a1T27vz****</ProductKey>
<CreateUserId>198426864326****</CreateUserId>
<UtcModified>2020-02-26T06:38:27.000Z</UtcModified>
<UtcCreated>2020-02-26T02:50:44.000Z</UtcCreated>
<Where>Temperature>35</Where>
<Name>testrule2</Name>
<Status>STOP</Status>
<Select>deviceName() as DeviceName</Select>
<Created>Wed Feb 26 10:50:44 CST 2020</Created>
<Modified>Wed Feb 26 14:38:27 CST 2020</Modified>
<Topic>/a1T27vz****/+/thing/event/property/post</Topic>
<Id>497350</Id>
</RuleInfo>
</Data>
<Page>1</Page>
<PageSize>1</PageSize>
<RequestId>1A6131EC-7504-4673-B997-DEFC6B363A37</RequestId>
<Success>true</Success>
<Total>5</Total>
</ListRuleResponse>
JSON
format
{
"Data": {
"RuleInfo": [
{
"DataType": "JSON",
"ProductKey": "a1T27vz****",
"CreateUserId": "198426864326****",
"UtcModified": "2020-02-26T06:38:27.000Z",
"UtcCreated": "2020-02-26T02:50:44.000Z",
"Where": "Temperature>35",
"Name": "testrule2",
"Status": "STOP",
"Select": "deviceName() as DeviceName",
"Created": "Wed Feb 26 10:50:44 CST 2020",
"Modified": "Wed Feb 26 14:38:27 CST 2020",
"Topic": "/a1T27vz****/+/thing/event/property/post",
"Id": 497350
}
]
},
"Page": 1,
"PageSize": 1,
"RequestId": "1A6131EC-7504-4673-B997-DEFC6B363A37",
"Success": true,
"Total": 5
}
Error codes
For a list of error codes, see Service error codes.