SAP IoT AE API用于列出具有数据的事物

2020-09-23 19:52发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)您好, 在使用AE应用程序时,...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


您好,

在使用AE应用程序时,我需要一个api,以提供一个包(或至少来自同一事物类型)中所有事物的详细信息(基本数据,最新时间序列数据)。

我找到了一个提供有关一件事的详细信息的API:/appiot-mds/Snapshot(thingId ='',fromTime ='',dataCategory ='')

我还找到了一种从一种事物类型中获取所有事物的方法,但是这一方法仅给出了有关事物的一些通用数据(id,描述,名称等)。 我还需要Thing属性目录中的基本数据和最新的时间序列数据(类似于提供第一个API的数据):/appiot-mds/Things?$ filter = _thingType eq''...

您知道是否存在这样的api吗? (上述两种方法的结合)
这将使我们能够创建一个简单的视图,以查看来自同一事物类型/程序包的所有不同事物,包括名称,id等以外的一些数据

谢谢,
乔里斯

1条回答
悻福寶寶
2020-09-23 20:18 .采纳回答

我建议您尝试使用 https ://help.sap.com/viewer/350cb3262cb8496b9f5e9e8b039b52db/latest/zh-CN/c969a7b0927d4a9da787570d79e761e8.html

以下是基于教程和我们在 developer.sap.com >提供的有限试用版中的一个示例。 物联网应用程序启用:

获取/advancedlist-thing-sap/CompositeThings/v1/Things?$ expand = DYN_ENT_sap_iotaehandson2_computeriotdevice__Default%2cDYN_ENT_sap_iotaehandson2_computeriotdevice__resource_sensors_2&$ format = json HTTP/1.1
 主持人:sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com
 内容类型:application/json
 sap-iot-pst:sap.iotaehandson2.computeriotdevice:默认,sap.iotaehandson2.computeriotdevice:resource_sensors_2
 

返回以下内容(缩写)。 如您所见,包括主数据和测量值在内的多种内容:

 {
     " d":{
         "结果":[
             {
                 " __metadata":{
                     " id":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('0079945DCD0A46EA959FC0ADCF435365')",
                     " uri":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('0079945DCD0A46EA959FC0ADCF435365')",
                     " type":" com.sap.appiot.Thing"
                 },
                 " ThingId":" 0079945DCD0A46EA959FC0ADCF435365",
                 " ISOCode":" en",
                 "事物描述":" Vk001",
                 " ThingName":" Vk001",
                 " ThingExternalId":" Vk001",
                 " ThingType":" sap.iotaehandson2.computeriotdevice:generic_computer",
                 " ObjectGroup":" C6484A9DC2274E4A87BCED73AAEA8650",
                 " BusinessPartnerName":null,
                 " BPLandlinePhoneNumber":null,
                 " BPMobilePhoneNumber":null,
                 " ThingCustomerId":null,
                 " ThingRegionDescription":null,
                 " ThingCountryDescription":null,
                 " ThingCountryId":null,
                 " ThingCommunicationData":null,
                 " ThingLocationId":null,
                 "纬度":null,
                 "经度":null,
                 " DYN_ENT_sap_iotaehandson2_computeriotdevice__Default":{
                     " ThingId":" 0079945DCD0A46EA959FC0ADCF435365",
                     " Default.common_name":" Vinayak-001",
                     " Default.common_name.Timestamp":"/日期(1520247077000)/"
                 },
                 " HierarchyElements":{
                     " __deferred":{
                         " uri":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('0079945DCD0A46EA959FC0ADCF435365')/HierarchyElements
                     }
                 },
                 " DYN_ENT_sap_iotaehandson2_computeriotdevice__resource_sensors_2":{
                     " ThingId":" 0079945DCD0A46EA959FC0ADCF435365",
                     " resource_sensors_2.cpu_type":空,
                     " resource_sensors_2.cpu_type.Timestamp":null,
                     " resource_sensors_2.cpu_usage":空,
                     " resource_sensors_2.cpu_usage.UpperThreshold88882":" 45.0",
                     " resource_sensors_2.cpu_usage.UoM82586":空,
                     " resource_sensors_2.cpu_usage.UpperUpperThreshold65329":" 90.0",
                     " resource_sensors_2.cpu_usage.Timestamp":null,
                     " resource_sensors_2.cpu_usage.UpperUpperThreshold65329.Timestamp":"/img/Date(1520247146000)/",
                     " resource_sensors_2.cpu_usage.UoM82586.Timestamp":"/img/Date(1520247146000)/",
                     " resource_sensors_2.cpu_usage.UpperThreshold88882.Timestamp":"/img/Date(1520247146000)/"
                 }
             },
             {
                 " __metadata":{
                     " id":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('012D2C6443E642C294B116EE76E57FA4')",
                     " uri":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('012D2C6443E642C294B116EE76E57FA4')",
                     " type":" com.sap.appiot.Thing"
                 },
                 " ThingId":" 012D2C6443E642C294B116EE76E57FA4",
                 " ISOCode":" en",
                 " ThingDescription":" Edwin的计算机",
                 " ThingName":" computer_P001298_2",
                 " ThingExternalId":" computer_P001298_2",
                 " ThingType":" sap.iotaehandson2.computeriotdevice:generic_computer",
                 " ObjectGroup":" C6484A9DC2274E4A87BCED73AAEA8650",
                 " BusinessPartnerName":null,
                 " BPLandlinePhoneNumber":null,
                 " BPMobilePhoneNumber":null,
                 " ThingCustomerId":null,
                 " ThingRegionDescription":null,
                 " ThingCountryDescription":null,
                 " ThingCountryId":null,
                 " ThingCommunicationData":null,
                 " ThingLocationId":null,
                 "纬度":null,
                 "经度":null,
                 " DYN_ENT_sap_iotaehandson2_computeriotdevice__Default":{
                     " ThingId":" 012D2C6443E642C294B116EE76E57FA4",
                     " Default.common_name":" WDFN31644964A",
                     " Default.common_name.Timestamp":"/日期(1519310067000)/"
                 },
                 " HierarchyElements":{
                     " __deferred":{
                         " uri":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('012D2C6443E642C294B116EE76E57FA4')/HierarchyElements"
                     }
                 },
                 " DYN_ENT_sap_iotaehandson2_computeriotdevice__resource_sensors_2":{
                     " ThingId":" 012D2C6443E642C294B116EE76E57FA4",
                     " resource_sensors_2.cpu_type":"通用",
                     " resource_sensors_2.cpu_type.Timestamp":"/img/Date(1519862400000)/",
                     " resource_sensors_2.cpu_usage":" 10.9",
                     " resource_sensors_2.cpu_usage.UpperThreshold88882":" 45.0",
                     " resource_sensors_2.cpu_usage.UoM82586":空,
                     " resource_sensors_2.cpu_usage.UpperUpperThreshold65329":" 90.0",
                     " resource_sensors_2.cpu_usage.Timestamp":"/img/Date(1519312068000)/",
                     " resource_sensors_2.cpu_usage.UpperUpperThreshold65329.Timestamp":"/img/Date(1519310067000)/",
                     " resource_sensors_2.cpu_usage.UoM82586.Timestamp":"/img/Date(1519310067000)/",
                     " resource_sensors_2.cpu_usage.UpperThreshold88882.Timestamp":"/img/Date(1519310067000)/"
                 }
             },
             {
                 " __metadata":{
                     " id":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('01BD28E868964B189E00700D5AABA7C3')",
                     " uri":" https://sap-iotaehandson2.iot-sap.cfapps.eu10.hana.ondemand.com/advancedlist-thing-sap/CompositeThings/v1/Things('01BD28E868964B189E00700D5AABA7C3')",
                     " type":" com.sap.appiot.Thing"
                 },
                 " ThingId":" 01BD28E868964B189E00700D5AABA7C3",
                 " ISOCode":" en",
                 "事物描述":"毕马威计算机"
                 " ThingName":" Roopa_Computer",
                 " ThingExternalId":" Roopa_Computer",
                 " ThingType":" sap.iotaehandson2.computeriotdevice:generic_computer",
                 " ObjectGroup":" C6484A9DC2274E4A87BCED73AAEA8650",
                 " BusinessPartnerName":null,
 

一周热门 更多>