Queries the topics of a data source in the rules engine.
QPS limits
You can call this API operation up to 10 times per second per account.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListDataSourceItem | The operation that you want to perform. Set the value to ListDataSourceItem. |
DataSourceId | Long | Yes | 1001 | The ID of the data source. You can call the ListParserDataSource operation to obtain the IDs of all data sources of the instance. |
Page | Integer | Yes | 1 | The number of the page to return. Valid values: 1 to 100000. |
PageSize | Integer | Yes | 10 | The number of entries to return on each page. Valid values: 1 to 100. |
IotInstanceId | String | No | iot-0pp1n8t*** | The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console. Important
For more information, see Overview. |
SearchName | String | No | thing | The substring that is extracted from the topic name. The operation returns the topics whose names match the substring. |
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | iot.system.SystemException | The error code that is returned if the call fails. For more information, see Error codes. |
DataSourceItems | Array of dataSourceItem | The information about the topics that are returned. |
|
dataSourceItem | |||
DataSourceItemId | Long | 129322 | The ID of the topic of the data source. |
DeviceName | String | lightDevice | The name of the device to which the topic belongs. Note If the topic belongs to a product or device that is managed over open source Message Queuing Telemetry Transport (MQTT), an MQTT gateway, or an MQTT device, this parameter is returned. |
ProductKey | String | aw3**** | The ProductKey of the product to which the topic belongs. Note If the topic belongs to a product or device that is managed over open source MQTT, an MQTT gateway, or an MQTT device, this parameter is returned. |
ScopeType | String | PRODUCT | The effective scope of the subscribed topic. Valid values:
Note If the topic belongs to a product or device that is managed over open source MQTT, an MQTT gateway, or an MQTT device, this parameter is returned. |
Topic | String | /gyh***z/+/thing/event/property/post | The name of the topic of the data source. |
ErrorMessage | String | A system exception occurred. | The error message returned if the call fails. |
Page | Integer | 1 | The page number of the returned page. |
PageSize | Integer | 10 | The number of entries returned per page. |
RequestId | String | E4C0FF92-2A86-41DB-92D3-73B60310D25E | The ID of the request. |
Success | Boolean | true | Indicates whether the call was successful.
|
Total | Integer | 100 | The total number of entries returned. |
Examples
Sample requests
http(s)://iot.cn-shanghai.aliyuncs.com/?Action=ListDataSourceItem
&DataSourceId=1001
&Page=1
&PageSize=10
&<Common request parameters>
Sample success responses
XML
format
<ListDataSourceItemResponse>
<DataSourceItems>
<dataSourceItem>
<DataSourceItemId>129322</DataSourceItemId>
<Topic>/gyh***z/+/thing/event/property/post</Topic>
</dataSourceItem>
</DataSourceItems>
<PageSize>1</PageSize>
<RequestId>E4C0FF92-2A86-41DB-92D3-73B60310D25E</RequestId>
<Total>1</Total>
<Page>1</Page>
<Success>true</Success>
</ListDataSourceItemResponse>
JSON
format
{
"DataSourceItems": {
"dataSourceItem": [
{
"DataSourceItemId": "129322",
"Topic": "/gyh***z/+/thing/event/property/post"
}
]
},
"PageSize": "1",
"RequestId": "E4C0FF92-2A86-41DB-92D3-73B60310D25E",
"Total": "1",
"Page": "1",
"Success": "true"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | iot.system.SystemException | An internal error occurred. Try again later. | The error message returned because a system exception occurred. |
400 | iot.common.InvalidPageParams | The specified pagination size or pagination parameter is invalid. | The error message returned because the specified page size or page number is invalid. |
400 | Iot.Device.NotExistedDevice | The device does not exist. | The error message returned because the specified device does not exist or is not activated. |
For a list of error codes, see Service error codes.