Creates a data destination to which you want to forward data.
QPS limits
Each Alibaba Cloud account can run up to 10 queries per second (QPS).
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDestination |
The operation that you want to perform. Set the value to CreateDestination. |
Name | String | Yes | DataPurpose |
The name of the data destination. |
Type | String | Yes | REPUBLISH |
The operation that you want to perform on the data of the data destination. Valid values:
|
Configuration | String | Yes | {"topic":"/a1POX0c****/device1/user/get","topicType":1} |
The configurations of the data destination. Set the value to a JSON string. The configurations vary based on the type of rule actions. The following tables describe the required syntax and relevant examples. |
IotInstanceId | String | No | iot-2w**** |
The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console. Notice
For more information, see Overview. |
Description | String | No | The data that you want to forward to a database. |
Enter a description of the data destination. |
Parameter |
Description |
---|---|
productKey |
The ProductKey of the product to which the destination topic belongs. |
Examples
{
"productKey":"hf****3xn"
}
The configurations of the AMQP type
Parameter |
Description |
---|---|
groupId |
The ID of the consumer group. |
Example
{
"groupId":"ZTh1JmuZcUfv44p4z00****"
}
The configurations of the OTS type
Parameter |
Description |
---|---|
instanceName |
The name of the Tablestore instance that you want to use to receive data. |
regionName |
The code of the region whereTablestore is deployed. Example: cn-shanghai. |
tableName |
The name of the table that you want to use to receive data. |
role |
The information about the RAM role. You can grant IoT Platform the access to Tablestore by assigning a service role to IoT Platform. The syntax of a RAM role: {"roleName":"AliyunIOTAccessingOTSRole","roleArn":"acs:ram::${uid}:role/aliyuniotaccessingotsrole"}
|
Example
{
"instanceName":"${instanceName}",
"regionName":"cn-shanghai",
"tableName":"test_table",
"role":{
"roleName":"AliyunIOTAccessingOTSRole",
"roleArn":"acs:ram::${uid}:role/aliyuniotaccessingotsrole"
}
}
The configurations of the DATAHUB type
Parameter |
Description |
---|---|
projectName |
The name of the DataHub project that you want to use to receive data. |
topicName |
The name of the DataHub topic that you want to use to receive data. |
regionName |
The code of the region where DataHub is deployed. Example: cn-shanghai. |
role |
The information about the RAM role. You can grant IoT Platform the access to DataHub by assigning a service role to IoT Platform. The syntax of a RAM role: {"roleArn":"acs:ram::${uid}:role/aliyuniotaccessingdatahubrole","roleName": "AliyunIOTAccessingDataHubRole"}
|
Example
{
"role":{
"roleArn": "acs:ram::${uid}:role/aliyuniotaccessingdatahubrole",
"roleName": "AliyunIOTAccessingDataHubRole"
},
"ProjectName": "test_project_name",
"RegionName": "cn-shanghai",
"TopicName": "test_topic"
}
The configurations of the MNS type
Parameter |
Description |
---|---|
themeName |
The name of the MNS topic that you want to use to receive data. |
regionName |
The code of the region where MNS is deployed. Example: cn-shanghai. |
role |
The information about the RAM role. To grant IoT Platform the access to MNS, you can assign a service role to IoT Platform. The syntax of a RAM role: {"roleArn":"acs:ram::${uid}:role/aliyuniotaccessingmnsrole","roleName": "AliyunIOTAccessingMNSRole"}
|
Example
{
"themeName": "test_name",
"role":{
"roleArn": "acs:ram::${uid}:role/aliyuniotaccessingmnsrole",
"roleName": "AliyunIOTAccessingMNSRole"
},
"regionName": "cn-shanghai"
}
The configurations of the ONS type
Parameter |
Description |
---|---|
instanceId |
The ID of the Message Queue for Apache RocketMQ instance that you want to use to receive data. |
topic |
The name of the Message Queue for Apache RocketMQ topic that you want to use to receive data. |
regionName |
The code of the region where Message Queue for Apache RocketMQ is deployed. Example: cn-shanghai. You can forward data only within the same region. |
role |
The information about the RAM role. You can grant IoT Platform the access to Message Queue for Apache RocketMQ by assigning a service role to IoT Platform. The syntax of a RAM role: {"roleArn":"acs:ram::${uid}:role/aliyuniotaccessingmqrole","roleName": "AliyunIOTAccessingMQRole"}
|
Example
{
"instanceId": "${MQ_INST_ID}",
"role":
{
"roleArn": "acs:ram::${uid}:role/aliyuniotaccessingmqrole",
"roleName": "AliyunIOTAccessingMQRole"
},
"regionName": "cn-shanghai",
"topic": "test_topic"
}
The configurations of the FC type
Parameter |
Description |
---|---|
functionName |
The name of the function that you want to use to receive data. |
serviceName |
The name of the service that you want to use to receive data. |
regionName |
The ID of the region where Function Compute is deployed. Example: cn-shanghai. |
role |
The information about the RAM role. You can grant IoT Platform the access to Function Compute by assigning a service role to IoT Platform. The syntax of a RAM role: {"roleArn":"acs:ram::${uid}:role/aliyuniotaccessingfcrole","roleName": "AliyunIOTAccessingFCRole"}
|
Example
{
"role":
{
"roleArn": "acs:ram::${uid}:role/aliyuniotaccessingfcrole",
"roleName": "AliyunIOTAccessingFCRole"
},
"functionName": "${function_name}",
"serviceName": "${service_name}",
"regionName": "cn-shanghai"
}
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information, see Common request parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | iot.system.SystemException |
The error code returned if the call fails. For more information, see Error codes. |
Destination | Struct |
The returned information about the data destination after the data destination is created. |
|
Configuration | String | {"topic":"/a1POX0c****/device1/user/get","topicType":1} |
The configuration data of the data destination. |
DestinationId | Long | 1003 |
The ID of the data destination. |
IsFailover | Boolean | false |
Indicates whether the data destination is configured to forward error operation data. The error operation data indicates the data that failed to be forwarded and re-forwarded to other Alibaba Cloud services
Default value: false. |
Name | String | DataPurpose |
The name of the data destination. |
Type | String | REPUBLISH |
The operation that is performed on the data of the data destination. |
UtcCreated | String | 2022-03-27T12:45:43.000Z |
The time when the data destination was created. The time is displayed in UTC. Format:
|
ErrorMessage | String | A system exception occurred. |
The error message returned if the request fails. |
RequestId | String | E4C0FF92-2A86-41DB-92D3-73B60310D25E |
The ID of the request. The ID uniquely identifies this request. |
Success | Boolean | true |
Indicates whether the call was successful.
|
Examples
Sample requests
http(s)://iot.cn-shanghai.aliyuncs.com/?Action=CreateDestination
&Configuration={"topic":"/a1POX0c****/device1/user/get","topicType":1}
&Name=DataPurpose
&Type=REPUBLISH
&<Common request parameters>
Sample success responses
XML
format
<CreateDestinationResponse>
<Destination>
<Type>REPUBLISH</Type>
<UtcCreated>2022-03-27T12:45:43.000Z</UtcCreated>
<Configuration>{"topic":"/a1POX0c****/device1/user/get","topicType":1}</Configuration>
<IsFailover>false</IsFailover>
<DestinationId>1003</DestinationId>
<Name>DataPurpose</Name>
</Destination>
<RequestId>E4C0FF92-2A86-41DB-92D3-73B60310D25E</RequestId>
<Success>true</Success>
</CreateDestinationResponse>
JSON
format
{
"Destination": {
"Type": "REPUBLISH",
"UtcCreated": "2022-03-27T12:45:43.000Z",
"Configuration": "{\"topic\":\"/a1POX0c****/device1/user/get\",\"topicType\":1}",
"IsFailover": false,
"DestinationId": 1003,
"Name": "DataPurpose"
},
"RequestId": "E4C0FF92-2A86-41DB-92D3-73B60310D25E",
"Success": true
}