From 02b9204aa18b96d8c9c0c36dc9767c3d1d947fed Mon Sep 17 00:00:00 2001 From: Bence Romsics Date: Wed, 14 Aug 2019 09:27:48 +0200 Subject: [PATCH] Retroactively update improve-extraroute-api spec As we discovered during implementation it wasn't a good idea of mine to make the request and response body a list on the top level. Neither the documentation tools nor python-neutronclient were prepared for non-dict request/response bodies. Another reason I suspect to always have dict-wrapped bodies is that it makes possible future changes to the request/response format a bit easier. Yet another reason is that the request/response body format in this change is now the exact same as it was used in the PUT /v2.0/routers/router-id request/response. Therefore clients wishing to use the new API only have to change the URL, but not the body of their requests. Since the api-def was already merged, this change just retroactively updates the spec to avoid possible future confusion between the spec and the api-ref. Change-Id: I3c7e9ab4ab6518eb1d30e3711a2d9571dfc2fa15 Partial-Bug: #1826396 --- specs/train/improve-extraroute-api.rst | 53 ++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/specs/train/improve-extraroute-api.rst b/specs/train/improve-extraroute-api.rst index 9face7955..b6d1e1970 100644 --- a/specs/train/improve-extraroute-api.rst +++ b/specs/train/improve-extraroute-api.rst @@ -58,19 +58,56 @@ Introduce a new API extension: extraroutes-atomic PUT /v2.0/routers/{router_id}/add_extraroutes - [ { "destination": "179.24.1.0/24", - "nexthop": "172.24.3.99" }, - ... - ] + { "router": + { "routes": + [ { "destination": "179.24.1.0/24", + "nexthop": "172.24.3.99" }, + ... + ] + } + } + +:: + + 200 OK + + { "router": + { "id": "1ecae6b8-be64-11e9-98ba-733d5460217b", + "name": "router1", + "routes": + [ { "destination": "179.24.1.0/24", + "nexthop": "172.24.3.99" }, + ... + ], + ... + } + } :: PUT /v2.0/routers/{router_id}/remove_extraroutes - [ { "destination": "179.24.1.0/24", - "nexthop": "172.24.3.99" }, - ... - ] + { "router": + { "routes": + [ { "destination": "179.24.1.0/24", + "nexthop": "172.24.3.99" }, + ... + ] + } + } + +:: + + 200 OK + + { "router": + { "id": "1ecae6b8-be64-11e9-98ba-733d5460217b", + "name": "router1", + "routes": + [ remaining routes ], + ... + } + } Partial failures are not allowed. If the addition or removal of any routing table entry fails then the whole update is reverted.