From 118b6aecdc19755a4b431d0ec8c2841dc1ac2717 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Mon, 21 Sep 2020 10:58:03 +0200 Subject: [PATCH] Changing firewall find HTTP method to POST. Prior definition was GET even though a search query payload needs to be transmitted in the request, which is invalid for certain HTTP clients. --- cmd/metal-api/internal/service/firewall-service.go | 5 +++-- spec/metal-api.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/metal-api/internal/service/firewall-service.go b/cmd/metal-api/internal/service/firewall-service.go index 3c141f742..88762e800 100644 --- a/cmd/metal-api/internal/service/firewall-service.go +++ b/cmd/metal-api/internal/service/firewall-service.go @@ -2,9 +2,10 @@ package service import ( "fmt" - "github.com/metal-stack/metal-api/cmd/metal-api/internal/grpc" "net/http" + "github.com/metal-stack/metal-api/cmd/metal-api/internal/grpc" + "github.com/metal-stack/metal-lib/httperrors" "github.com/metal-stack/metal-lib/zapup" "go.uber.org/zap" @@ -76,7 +77,7 @@ func (r firewallResource) webService() *restful.WebService { Returns(http.StatusOK, "OK", v1.FirewallResponse{}). DefaultReturns("Error", httperrors.HTTPErrorResponse{})) - ws.Route(ws.GET("/find"). + ws.Route(ws.POST("/find"). To(viewer(r.findFirewalls)). Operation("findFirewalls"). Doc("find firewalls by multiple criteria"). diff --git a/spec/metal-api.json b/spec/metal-api.json index 2a6290261..f703bbca1 100644 --- a/spec/metal-api.json +++ b/spec/metal-api.json @@ -3053,7 +3053,7 @@ } }, "/v1/firewall/find": { - "get": { + "post": { "consumes": [ "application/json" ],