文档

GetDataAPIServiceDetail

更新时间:

调用该接口获取数据算法服务API详情。

QPS限制

单个阿里云账号调用该接口的每秒请求数(QPS)最大限制为1。

说明 RAM用户共享阿里云账号配额。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetDataAPIServiceDetail

系统规定参数。取值:GetDataAPIServiceDetail。

ApiSrn String acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2

API资源标识符,API的全局唯一标识。 调用CreateDataAPIService接口成功创建API,返回的ApiSrn值。

格式:acs:iot:*:${aliyunuserID}:serveapi/${ApiPath}

示例:acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2

以上示例中的信息说明如下:

  • 127103983461****是阿里云主账号ID。
  • /device/getDeviceCountByStatus是请求参数ApiPath的值,即API调用地址的自定义部分。
IotInstanceId String iot_instc_pu****_c*-v64********

实例ID。您可在物联网平台控制台的实例概览页面,查看当前实例的ID

重要
  • 若有ID值,必须传入该ID值,否则调用会失败。
  • 若无实例概览页面或ID值,则无需传入。

实例的更多信息,请参见实例概述

调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见 公共参数文档

返回数据

名称 类型 示例值 描述
Code String Success

调用失败时,返回的错误码。更多信息,请参见错误码

Data Struct

调用成功时,返回的数据。

ApiPath String /device/getDeviceCountByStatus

API调用地址的自定义部分。

ApiSrn String acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2

API资源标识符,API的全局唯一标识。

示例:acs:iot:*:127103983461****:serveapi/device/getDeviceCountByStatus2

以上示例中的信息说明如下:

  • 127103983461****是阿里云主账号ID。
  • /device/getDeviceCountByStatus是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模板数据。详情参见SqlTemplateDTO下参数描述。

OriginSql String SELECT COUNT(*) FROM ${system.device} WHERE status = 1

API对应的原始SQL。

RequestParams Array of RequestParams

调用API的请求参数列表。

RequestParams
Desc String 设备状态

请求参数描述。

Example String 0

请求参数值示例。

Name String status

请求参数名称。

Required Boolean true

该请求参数是否必填。

  • true(默认):必填。
  • false:非必填。
Type String INTEGER

请求参数类型,目前仅支持:

  • ARRAY
  • VARCHAR
  • INTEGER
  • BIGINT
  • BOOLEAN
  • DECIMAL
  • TIMESTAMP

具体说明,请参见JDBCType

ResponseParams Array of ResponseParams

API的返回参数列表。

ResponseParams
Desc String 设备数

返回参数描述。

Example String 100

返回参数值示例。

Name String deviceCount

返回参数名称。

Required Boolean true

该返回参数是否必须返回。

  • true:必须返回。
  • false:非必须返回。

返回参数中,无需配置该参数。

Type String INTEGER

参数类型,目前仅支持:

  • ARRAY
  • VARCHAR
  • INTEGER
  • BIGINT
  • BOOLEAN
  • DECIMAL
  • TIMESTAMP

请参见JDBCType

TemplateSql String SELECT COUNT(*) as deviceCount FROM ${system.device} WHERE status = ${status}

原始SQL的模板化SQL。

Status Integer 1

API的状态。

  • 0:可编辑。
  • 1:已测试。
  • 2:已发布。
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"
            }
         ]
      }
   }
}
  • 本页导读 (1)
文档反馈