I want to fill my KVStore with information from a script. The script adds data via a REST Endpoint to the KVStore.
The key in the store is a hostname of a machine. The problem is, if I want to add a new host to the KVStore, but there is already an entry for this host, I will get an error. On the other hand, I can't use the "Update-method" because if it is a new host, I will get the an error as well.
I know that I could handle this problem in my script, but I wanted to know if there is a "clever" update function:
If there is a record in the KVStore then update the item, and if there isn't, create a new one.