Add a new endpoint POST /routes (#2915)

* Add a new endpoint POST /routes

A list of RouteDefinition can be sent to /routes using POST method to persist multiple routes by a single request.

Validation is done before persisting any RouteDefinition
This commit is contained in:
Ignacio Lozano
2023-04-26 19:32:25 +02:00
committed by GitHub
parent 964cb81932
commit 23ca3721a6
3 changed files with 117 additions and 4 deletions

View File

@@ -2952,11 +2952,17 @@ The following table describes the structure of the response:
|===
=== Creating and Deleting a Particular Route
=== Creating and Deleting a Particular Route Definition
To create a route, make a `POST` request to `/gateway/routes/{id_route_to_create}` with a JSON body that specifies the fields of the route (see <<gateway-retrieving-information-about-a-particular-route>>).
To create a route definition, make a `POST` request to `/gateway/routes/{id_route_to_create}` with a JSON body that specifies the fields of the route (see <<gateway-retrieving-information-about-a-particular-route>>).
To delete a route, make a `DELETE` request to `/gateway/routes/{id_route_to_delete}`.
To delete a route definition, make a `DELETE` request to `/gateway/routes/{id_route_to_delete}`.
=== Creating multiple Route Definitions
To create multiple route definitions in a single request, make a `POST` request to `/gateway/routes` with a JSON body that specifies the fields of the route, including the route id (see <<gateway-retrieving-information-about-a-particular-route>>).
The route definitions will be discarded if any route raises an error during the creation of the routes.
=== Recap: The List of All endpoints