调用该接口获取数据算法服务API详情。
限制条件
单阿里云账号调用该接口的每秒请求数(QPS)最大限制为1。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetDataAPIServiceDetail |
系统规定参数。取值:GetDataAPIServiceDetail。 |
ApiSrn | String | 是 | acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2 |
API资源标识符,API的全局唯一标识。 调用CreateDataAPIService接口成功创建API,返回的ApiSrn值。 格式: 示例: 以上示例中的信息说明如下:
|
IotInstanceId | String | 否 | iot_instc_pu****_c*-v64******** |
公共实例不传此参数;您购买的实例需传入实例ID。 |
调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见 公共参数文档。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | String | Success |
调用失败时,返回的错误码。详情请参见错误码。 |
Data | Struct |
调用成功时,返回的数据。 |
|
ApiPath | String | /device/getDeviceCountByStatus |
API调用地址的自定义部分。 |
ApiSrn | String | acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2 |
API资源标识符,API的全局唯一标识。 示例: 以上示例中的信息说明如下:
|
CreateTime | Long | 1557839468865 |
API的创建时间,单位为毫秒(ms)。 |
DateFormat | String | JSON |
返回类型行。 |
Description | String | 描述 |
API的描述信息。 |
DisplayName | String | 根据状态获取设备数 |
API名称。 |
LastUpdateTime | Long | 1557839468865 |
API的最后更新时间,单位为毫秒(ms)。 |
RequestMethod | String | GET/POST |
请求方式。 |
RequestProtocol | String | HTTPS |
协议类型。 |
SqlTemplateDTO | Struct |
SQL模板信息。 调用成功时,返回的SQL模板数据。详情参见下表SqlTemplateDTO。 |
|
OriginSql | String | SELECT COUNT(*) FROM ${system.device} WHERE status = 1 |
API对应的原始SQL。 |
RequestParams | Array |
调用API的请求参数列表。 |
|
RequestParams | |||
Desc | String | 设备状态 |
参数描述。 |
Example | String | 0 |
参数值示例。 |
Name | String | status |
请求参数名称。 |
Required | Boolean | true |
该参数是否必填。
默认值为true。 |
Type | String | INTEGER |
参数类型,请参见JDBCType。目前仅支持:ARRAY、VARCHAR、INTEGER、BIGINT、BOOLEAN、DECIMAL、TIMESTAMP。 |
ResponseParams | Array |
API的响应参数列表。 |
|
ResponseParams | |||
Desc | String | 设备数 |
参数描述。 |
Example | String | 100 |
参数值示例。 |
Name | String | deviceCount |
返回参数名称。 |
Required | Boolean | true |
该参数是否必填。
返回参数中,无需配置该参数。 |
Type | String | INTEGER |
参数类型,请参见JDBCType。目前仅支持:ARRAY、VARCHAR、INTEGER、BIGINT、BOOLEAN、DECIMAL、TIMESTAMP。 |
TemplateSql | String | SELECT COUNT(*) as deviceCount FROM ${system.device} WHERE status = ${status} |
原始SQL的模板化SQL。 |
Status | Integer | 1 |
API的状态。
|
ErrorMessage | String | 请求参数错误 |
调用失败时,返回的出错信息。 |
RequestId | String | 57b144cf-09fc-4916-a272-a62902d5b207 |
阿里云为该请求生成的唯一标识符。 |
Success | Boolean | true |
表示是否调用成功。true表示调用成功,false表示调用失败。 |
示例
请求示例
http(s)://iot.cn-shanghai.aliyuncs.com/?Action=GetDataAPIServiceDetail
&ApiSrn=acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2
&<公共请求参数>
正常返回示例
XML
格式
<GetDataAPIServiceDetailResponse>
<RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
<Success>true</Success>
<Data>
<ApiSrn>acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2</ApiSrn>
<CreateTime>1557839468865</CreateTime>
<LastUpdateTime>1557839468865</LastUpdateTime>
<Status>1</Status>
<DisplayName>根据状态获取设备数</DisplayName>
<ApiPath>/device/getDeviceCountByStatus</ApiPath>
<Description>描述</Description>
<SqlTemplateDTO>
<OriginSql>SELECT COUNT(*) FROM ${system.device} WHERE status = 1</OriginSql>
<TemplateSql>SELECT COUNT(*) as deviceCount FROM ${system.device} WHERE status = ${status}</TemplateSql>
<RequestParams>
<name>status</name>
<type>INTEGER</type>
<desc>设备状态</desc>
<example>0</example>
<required>true</required>
</RequestParams>
<ResponseParams>
<name>deviceCount</name>
<type>INTEGER</type>
<desc>设备数</desc>
<example>100</example>
</ResponseParams>
</SqlTemplateDTO>
</Data>
</GetDataAPIServiceDetailResponse>
JSON
格式
{
"RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
"Success":true,
"Data":{
"ApiSrn":"acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2",
"CreateTime":1557839468865,
"LastUpdateTime":1557839468865,
"Status": 1,
"DisplayName":"根据状态获取设备数",
"ApiPath":"/device/getDeviceCountByStatus",
"Description":"描述",
"SqlTemplateDTO":{
"OriginSql":"SELECT COUNT(*) FROM ${system.device} WHERE status = 1",
"TemplateSql":"SELECT COUNT(*) as deviceCount FROM ${system.device} WHERE status = ${status}",
"RequestParams":[
{
"name":"status",
"type":"INTEGER",
"desc":"设备状态",
"example":"0",
"required":true
}
],
"ResponseParams":[
{
"name":"deviceCount",
"type":"INTEGER",
"desc":"设备数",
"example":"100"
}
]
}
}
}
在文档使用中是否遇到以下问题
更多建议
匿名提交