I am using APIGee CLI to create entries in the KVM and so far, so good... but there is one scenario that seems to be too simple and somehow the workaround I've found is too complex...
In the pipeline, I want the proxy to be deployed and for all KVM entries to be created, and in case it's already there, to update the value with the new one (or omit if it's the same value).
I am using the following command to create them:
@gcorbetta wrote:
Am I missing something?
No, you are not.
I think you want to insert a value if it is not present, or update the value if it is present and different. Borrowing from database parlance, we can call the idea "Upsert". There is no primitive in the REST API for Apigee keyvaluemaps that performs upsert. So you need to do the maybe-insert-and-maybe-update thing "manually".
Here's a repo with a nodejs utility that does KVM Upsert. Keep in mind: Upsert is not an atomic operation. There is a DELETE then a POST, in the case of an existing entry.
@srinandans What is the possibility that apigeecli will support upsert at some point?