Code Monkey home page Code Monkey logo

Comments (10)

hylkevds avatar hylkevds commented on June 23, 2024

No, entity id's are always generated by the server, specifically, by the database. Any @iot.id you specify in the json is ignored.

from frost-server.

johannes-riesterer avatar johannes-riesterer commented on June 23, 2024

Thank you for your fast reply. So the id is generated by postgre database? Do you think it is possible in principal? Is there a way to get the id of an entity one created? I couldn't find it in the response of the corresponding post request.

Thank you for your help

Johannes

from frost-server.

hylkevds avatar hylkevds commented on June 23, 2024

Yes, the id is generated by the database. In theory it's possible to allow user-generated ids, but it's a bad idea, since you lose the guarantee that generated ids are unique.

The Id is in the location header that you get in the response:

Req 33 - create-update-delete/create-entity
Upon successful completion, the response SHALL contain a HTTP location header that contains the selfLink of the created entity.

from frost-server.

johannes-riesterer avatar johannes-riesterer commented on June 23, 2024

from frost-server.

hylkevds avatar hylkevds commented on June 23, 2024

If you're trying to replicate a complete server then it might be a lot easier to make a database dump and import that, or use database replication.

When it comes to matching entities across servers it's better to use the metadata fields. You can add an external identifier to the properties of a Thing, and use that to find the correct Thing for your operations. We also have a branch that adds a properties field to all entities, not just Thing and Observation.

We can always talk about special feature requests.

from frost-server.

johannes-riesterer avatar johannes-riesterer commented on June 23, 2024

we want to sync the datastream with a Kafka system and we need unique identifiers in order to be able to restore everything from the Kafka system and to introduce redundant systems.

from frost-server.

hylkevds avatar hylkevds commented on June 23, 2024

When synchronising with external systems, the properties fields are the way to go. There you can store any information about the external system that you need.
Redundancy is best done at database level, using datebase replication.

from frost-server.

johannes-riesterer avatar johannes-riesterer commented on June 23, 2024

ok, thank you very much for your help. Where can i find that build with properties field for all entities?

from frost-server.

hylkevds avatar hylkevds commented on June 23, 2024

In the branch moreProperties, at the following url:
https://github.com/FraunhoferIOSB/SensorThingsServer/tree/moreProperties

from frost-server.

johannes-riesterer avatar johannes-riesterer commented on June 23, 2024

thank you. In the first instance we can work with this approach. After a long discussion today, we still think that we need to set id's manually later on in the project. Are you interested in a collaboration?

from frost-server.

Related Issues (20)

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.