Indempotent metadata update
Hello.
I am in the process of deploying and integrating hawkBit with our project. I would like to push some of the device information stored on our internal backend service devices communicate with. I assume metadata is the only place I could hold some data that can't be provided by the device itself with configData DDI request.
Is there a way to set (create or update) a metadata key indempotently? Currently, sending a POST request to /rest/v1/targets/XXX/metadata with a bunch of items would return error 409 if some key already exists. So far "fixed" it by splitting it into multiple requests, but that is not a very good solution.
Totally agree that splitting the metadata into multiple requests is not doing any good and just a workaround on client side.
I assume metadata is the only place I could hold some data that can't be provided by the device itself
Exactly. They complement target attributes for more advanced/complex filtering on hawkBit side
Is there a way to set (create or update) a metadata key indempotently?
Unfortunately not as of today. There is an check in place if key already exists [cf. here]. However we could either do a silent update if key exists (behaviour change) or introduce new parameter in order to specify what should happen in case of a conflict. Like we already do for controller attributes [cf. update mode]. As a consequence for sake of consistency software module metadata should exactly behave identically