Queries the published Thing Specification Language (TSL) model of a product.
QPS limits
You can call this 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 | GetThingModelTslPublished | The operation that you want to perform. Set the value to GetThingModelTslPublished. |
ProductKey | String | Yes | a1BwAGV**** | The ProductKey of the product. |
IotInstanceId | String | No | iot-cn-0pp1n8t**** | The instance ID. You can view the instance ID on the Overview page in the IoT Platform console. Important
For more information, see Overview. |
ResourceGroupId | String | No | rg-acfm4l5tcwd**** | The resource group ID. Important IoT Platform allows you to manage only instances by resource group. ResourceGroupId does not take effect. You do not need to specify this parameter. |
Simple | Boolean | No | true | Specifies whether to return a simplified TSL model. Valid values:
|
ModelVersion | String | No | v1.0.0 | The version number of the TSL model. You can call the ListThingModelVersion operation to query the version number of the TSL model for a product. If you do not specify this parameter, the last published TSL model version is used. |
FunctionBlockId | String | No | BatteryModule | The identifier of the custom TSL module. Each identifier is unique in a product. If you do not specify this parameter, the default module is used. |
In addition to the preceding operation-specific request parameters, you must specify 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 returned if the request failed. For more information, see Error codes. |
Data | Struct | The data returned. | |
TslStr | String | {\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a14TeWI****\"},\"properties\":[{\"identifier\":\"Humidity\"}]} | The string of the TSL model. |
TslUri | String | https://iotx-pop-dsl.oss-cn-shanghai.aliyuncs.com/thing/a14TeWI****/model.json?Expires=1581947119&OSSAccessKeyId=LTAIuFOwFSR9****&Signature=5i389hacjdj3t%2FnrHmQpEUfnxw**** | The uniform resource identifier (URI) of the TSL data that is stored in Object Storage Service (OSS). The validity period of the URI is 60 minutes. |
ErrorMessage | String | A system exception occurred. | The error message returned if the request failed. |
RequestId | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | The request ID. |
Success | Boolean | true | Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
https://iot.cn-shanghai.aliyuncs.com/?Action=GetThingModelTslPublished
&ProductKey=a1BwAGV****
&<Common request parameters>
Sample success responses
XML
format
<GetThingModelTslPublishedResponse>
<Data>
<TslUri>https://iotx-pop-dsl.oss-cn-shanghai.aliyuncs.com/thing/a14TeWI****/model.json?Expires=1581947119&OSSAccessKeyId=LTAIuFOwFSR9****&Signature=5i389hacjdj3t%2FnrHmQpEUfnx****</TslUri>
<TslStr>{"schema":"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json","profile":{"productKey":"a14TeWI****"},"properties":[{"identifier":"Humidity","name":"Humidity","accessMode":"rw","required":false,"dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"Temperature","accessMode":"rw","required":false,"dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}],"events":[{"identifier":"post","name":"post","type":"info","required":true,"desc":"Submit properties","method":"thing.event.property.post","outputData":[{"identifier":"Humidity","name":"Humidity","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"Temperature","dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}]}],"services":[{"identifier":"set","name":"set","required":true,"callType":"async","desc":"Set properties","method":"thing.service.property.set","inputData":[{"identifier":"Humidity","name":"Humidity","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"Temperature","dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}],"outputData":[]},{"identifier":"get","name":"get","required":true,"callType":"async","desc":"Query properties","method":"thing.service.property.get","inputData":["Humidity","Temperature"],"outputData":[{"identifier":"Humidity","name":"Humidity","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"Temperature","dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}]}]}</TslStr>
</Data>
<RequestId>C4371E68-F6DB-4D7B-8AD0-D38336E1DF94</RequestId>
<Success>true</Success>
</GetThingModelTslPublishedResponse>
JSON
format
{
"Data": {
"TslUri": "https://iotx-pop-dsl.oss-cn-shanghai.aliyuncs.com/thing/a14TeWI****/model.json?Expires=1581947119&OSSAccessKeyId=LTAIuFOwFSR9****&Signature=5i389hacjdj3t%2FnrHmQpEUfnx****",
"TslStr": "{\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a14TeWI****\"},\"properties\":[{\"identifier\":\"Humidity\",\"name\":\"Humidity\",\"accessMode\":\"rw\",\"required\":false,\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"Temperature\",\"accessMode\":\"rw\",\"required\":false,\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}],\"events\":[{\"identifier\":\"post\",\"name\":\"post\",\"type\":\"info\",\"required\":true,\"desc\":\"Submit properties\",\"method\":\"thing.event.property.post\",\"outputData\":[{\"identifier\":\"Humidity\",\"name\":\"Humidity\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"Temperature\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}]}],\"services\":[{\"identifier\":\"set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"Set properties\",\"method\":\"thing.service.property.set\",\"inputData\":[{\"identifier\":\"Humidity\",\"name\":\"Humidity\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"Temperature\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}],\"outputData\":[]},{\"identifier\":\"get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"Query properties\",\"method\":\"thing.service.property.get\",\"inputData\":[\"Humidity\",\"Temperature\"],\"outputData\":[{\"identifier\":\"Humidity\",\"name\":\"Humidity\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"Temperature\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}]}]}"
},
"RequestId": "C4371E68-F6DB-4D7B-8AD0-D38336E1DF94",
"Success": true
}
Error codes
For a list of error codes, see Service error codes.