I am converting our apis to routes and services that are deployed via a configuration script but I am having trouble adding routes idempotently. This script is used for first time creation but also for updating deployments with new config when required.
Services (and apis & consumers for that matter) use a name that defines them and so can be used to determine if it exists and create (POST) it if it does not exist or update (DELETE & POST or PATCH) it. Alternatively the PUT can be used to create or update it in one command.
However I am not sure how this works on routes as there is no name and the only way to get details on a route is via the internally generated id for it. If I keep doing a POST of the same details it just keeps adding a new route for the specified service. All the other commands for routes operate on the id only so how do I determine if the route i am creating already exists without having to save its generated id in some external location the first time it is created. The PUT command for example that add or updates requires the id in the admin URL but if its being created for the first time you dont know it.
Am i missing something here ? Will routes have names in the future to support this ?