ficodes / quantumleap-source-operator Goto Github PK
View Code? Open in Web Editor NEWRetrieve QuantumLeap history and updates in real time using Context Broker.
License: Apache License 2.0
Retrieve QuantumLeap history and updates in real time using Context Broker.
License: Apache License 2.0
When several attributes are requested in the settings, the code makes in the to be returned data an attributes for every requested attribute (ok) but the attributes in the data receive values from the wrong attributes (nok).
Error is on line 226 of main.js: the code makes the assumption that the attributes have the same position in the request and in the response. This assumption is not correct.
data.forEach((attribute, i) => {
attribute.values = attribute.values.concat(response.response.attributes[i].values);
});
So we need to look up in the response for the right attribute. This is the fix:
data.forEach((attribute, i) => {
let response_attribute = response.response.attributes.find(a => a.attrName===attribute.attrName);
attribute.values = attribute.values.concat(response_attribute.values);
});
Error getting Historical Data (422): {"description":"The parameter value '1637496000000' for parameter **fromDate** or **toDate** is not valid.","error":"<class 'exceptions.exceptions.InvalidParameterValue'>"}
I have tried dates like: 2021-11-21T12:00:00Z , 2021-11-21T16:00:44.600+00:00 , 2021-11-16T16:00:44.600. But the error persists.
What could be wrong?
Hi!
When trying to use this operator in wirecloud, I found that the subscriptions returns a 400 Bad request code.
What I have done so far is connect the NGSI browser to this operator, or use the fields that are optional to tell the operator what is the ID. Either way, it results in the following error
Error creating subscription in the context broker server: forbidden characters in /entities/ vector item /id/
Taking a look to the ORION debug logs, I can see that the request is arriving with the following format:
time=2021-10-20T12:51:39.520Z | lvl=INFO | corr=77c14662-31a4-11ec-bf0a-0242ac140011 | trans=1634725723-285-00000000200 | from=35.83.53.189 | srv=howtoservice | subsrv=/howto | comp=Orion | op=logTracing.cpp[141]:logInfoRequestWithPayload | msg=Request received: POST /v2/subscriptions, request payload (524 bytes): {"description":"QuantumLeap source subscription","subject":{"entities":[{"id":"{\"id\":\"temperature-postman3\",\"type\":\"Temperature\",\"TimeInstant\":\"2021-10-19T15:44:48.313Z\",\"location\":\"40.418789, -3.69571\",\"temperature\":212}"}],"condition":{"attrs":["temperature"]}},"notification":{"attrsFormat":"normalized","attrs":["temperature","dateModified","dateObserved"],"http":{"url":"https://ngsiproxy.bigbang.secmotic.com:443/callbacks/7795b420-31a4-11ec-83cd-85f2728d8f05"}},"expires":"2021-10-20T15:51:39.009Z"}, response code: 400
If I go back to POSTMAN, I can see that the previous request is actually malformed, since in the "id" field, the subscription is trying to use the string : {\"id\":\"temperature-postman3\",\"type\":\"Temperature\",\"TimeInstant\":\"2021-10-19T15:44:48.313Z\",\"location\":\"40.418789, -3.69571\",\"temperature\":212}"}
Since it should be just the ID (I tried to use the id, and the subscription is accepted), is it possible that the subscription is malformed? How should I proceed?
Best regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.