Reputation: 435
If I create two identical entities on Fiware Orion: same name, same id and same attributes, what is the behaviour of the system?. Does it do just an update?
Upvotes: 1
Views: 116
Reputation: 853
if you don't want to care whether the entity is created or just updated you can use the batch operation
POST /v2/op/update
with action type 'REPLACE' see https://github.com/Fiware/dataModels/blob/master/Weather/WeatherObserved/harvest/portugal_weather_observed_harvest.py#L149
You may also use action type 'APPEND'. The only caveat of that approach is that if the entity contains old attributes, they will remain ...
What the API does not support is an UPSERT operation ... i.e. the /v2/op/update would only work if the entity already exists ...
Upvotes: 1
Reputation: 12322
Orion will not let you to create two entities with the same id and type in the same service path. If you try to do that you will get an error like this one:
{
"error": "Unprocessable",
"description": "Already Exists"
}
Upvotes: 1