Giter Club home page Giter Club logo

quantumleap-source-operator's People

Contributors

aarranz avatar cblanco avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

aarranz

quantumleap-source-operator's Issues

Mixed up attributes in response

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)

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?

Malformed subscriptions

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.