调用该接口查询指定产品的已发布物模型TSL。
QPS限制
单个阿里云账号调用该接口的每秒请求数(QPS)最大限制为20。
说明 单个阿里云账号下的所有RAM用户共享该阿里云账号的配额。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetThingModelTslPublished | 系统规定参数。取值:GetThingModelTslPublished。 |
ProductKey | String | 是 | a1BwAGV**** | 产品的ProductKey。 |
IotInstanceId | String | 否 | iot-cn-0pp1n8t**** | 实例ID。您可在物联网平台控制台的实例概览页面,查看当前实例的ID。 重要
实例的更多信息,请参见实例概述。 |
ResourceGroupId | String | 否 | rg-acfm4l5tcwd**** | 资源组ID。 重要 目前,物联网平台仅支持实例维度的资源组管理。请求参数ResourceGroupId配置已无效,无需再传入。
|
Simple | Boolean | 否 | true | 是否获取精简版物模型信息。
|
ModelVersion | String | 否 | v1.0.0 | 物模型版本号。 可调用ListThingModelVersion查看产品下的物模型版本号。 为空时返回已发布的最新版本。 |
FunctionBlockId | String | 否 | BatteryModule | 物模型自定义模块标识符,在产品中具有唯一性。 不传入此参数时,查询默认模块数据。 |
调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见公共参数文档。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | String | iot.system.SystemException | 调用失败时,返回的错误码。更多信息,请参见错误码。 |
Data | Struct | 返回数据。 |
|
TslStr | String | {\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a14TeWI****\"},\"properties\":[{\"identifier\":\"Humidity\"}]} | 物模型的TSL字符串。 |
TslUri | String | https://iotx-pop-dsl.oss-cn-shanghai.aliyuncs.com/thing/a14TeWI****/model.json?Expires=1581947119&OSSAccessKeyId=LTAIuFOwFSR9****&Signature=5i389hacjdj3t%2FnrHmQpEUfnxw**** | 物模型数据在对象存储(OSS)上的存储地址URI。返回的URI有效期为60分钟。 |
ErrorMessage | String | 系统异常 | 调用失败时,返回的出错信息。 |
RequestId | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | 阿里云为该请求生成的唯一标识符。 |
Success | Boolean | true | 是否调用成功。
|
示例
请求示例
https://iot.cn-shanghai.aliyuncs.com/?Action=GetThingModelTslPublished
&ProductKey=a1BwAGV****
&<公共请求参数>
正常返回示例
XML
格式
<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":"湿度","accessMode":"rw","required":false,"dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"温度","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":"属性上报","method":"thing.event.property.post","outputData":[{"identifier":"Humidity","name":"湿度","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"温度","dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}]}],"services":[{"identifier":"set","name":"set","required":true,"callType":"async","desc":"属性设置","method":"thing.service.property.set","inputData":[{"identifier":"Humidity","name":"湿度","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"温度","dataType":{"type":"float","specs":{"min":"26","max":"28","unit":"°C","step":"0.01"}}}],"outputData":[]},{"identifier":"get","name":"get","required":true,"callType":"async","desc":"属性获取","method":"thing.service.property.get","inputData":["Humidity","Temperature"],"outputData":[{"identifier":"Humidity","name":"湿度","dataType":{"type":"int","specs":{"min":"55","max":"60","unit":"%","step":"1"}}},{"identifier":"Temperature","name":"温度","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
格式
{
"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\":\"湿度\",\"accessMode\":\"rw\",\"required\":false,\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"温度\",\"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\":\"属性上报\",\"method\":\"thing.event.property.post\",\"outputData\":[{\"identifier\":\"Humidity\",\"name\":\"湿度\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"温度\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}]}],\"services\":[{\"identifier\":\"set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性设置\",\"method\":\"thing.service.property.set\",\"inputData\":[{\"identifier\":\"Humidity\",\"name\":\"湿度\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"温度\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}],\"outputData\":[]},{\"identifier\":\"get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性获取\",\"method\":\"thing.service.property.get\",\"inputData\":[\"Humidity\",\"Temperature\"],\"outputData\":[{\"identifier\":\"Humidity\",\"name\":\"湿度\",\"dataType\":{\"type\":\"int\",\"specs\":{\"min\":\"55\",\"max\":\"60\",\"unit\":\"%\",\"step\":\"1\"}}},{\"identifier\":\"Temperature\",\"name\":\"温度\",\"dataType\":{\"type\":\"float\",\"specs\":{\"min\":\"26\",\"max\":\"28\",\"unit\":\"°C\",\"step\":\"0.01\"}}}]}]}"
},
"RequestId": "C4371E68-F6DB-4D7B-8AD0-D38336E1DF94",
"Success": true
}