简体   繁体   English

Proficy Historian RestAPI - 使用包含“#”的标签检索插值数据

[英]Proficy Historian RestAPI - retrieving interpolated data with tags which contain "#"

I am having trouble accessing interpolated data for tags that contain either "#" or "/" from a proficy historian using the restAPI.我无法从使用 restAPI 的专业历史学家那里访问包含“#”或“/”的标签的插值数据。 I am able to get interpolated data for all other tags.我能够获得所有其他标签的插值数据。

eg accessing interpolated data with tagName: Tag123#Value例如,使用 tagName 访问插值数据:Tag123#Value

oauth.get("https://<server>:8443/historian-rest-api/v1/datapoints/interpolated/Tag123%23Value/<starttime>/<endtime>/0/60000")

returns返回

error code 400 - request was malformed.

However I am able to the get the current value for Tag123#Value但是我能够获取 Tag123#Value 的当前值

oauth.get("https://<server>:8443/historian-rest-api/v1/datapoints/currentvalue?tagNames=Tag123%23Value")

note: I am already URI encoding the tag which enables me to retrieve current values - however I suspect the problem is something to do with URI encoding ...注意:我已经对标签进行了 URI 编码,这使我能够检索当前值 - 但是我怀疑问题与 URI 编码有关......

From my experience setting up a Python script to request data via the procincy historian rest api you should be able to translate all backslashes (\) to astrisks (*):根据我设置 Python 脚本以通过 procincy historian rest api 请求数据的经验,您应该能够将所有反斜杠 (\) 转换为星号 (*):

https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test\tag_with\\weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000 Gives: 404 error in curl https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test\tag_with\\weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000给出:卷曲中的 404 错误

https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test%5Ctag_with%5C%5Cweirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000 Gives: tag not found https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test%5Ctag_with%5C%5Cweirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000给出:未找到标签

https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test*tag_with**weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000 Gives: queried data I was looking for https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test*tag_with**weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000 Gives:我正在寻找的查询数据

Note that: from the debug prints I was able to try, I noticed that in curl, backslashes get translated to front slashes so it tried looking at this directory with the first link as input: https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test/tag_with//weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000 Which i think is the cause for the 404 error请注意:从我能够尝试的调试打印中,我注意到在 curl 中,反斜杠被转换为前斜杠,因此它尝试使用第一个链接作为输入查看此目录: https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test/tag_with//weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000我认为是404错误的原因

Edit: note that this was done in Proficy Historian version 9.0!!编辑:请注意,这是在 Proficy Historian 9.0 版中完成的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM