diff --git a/api/MIGRATION_TO_V3.md b/api/MIGRATION_TO_V3.md index cb8032789da..a9774100be9 100644 --- a/api/MIGRATION_TO_V3.md +++ b/api/MIGRATION_TO_V3.md @@ -8,7 +8,7 @@ GET /logz.zip GET /v1/server/logs.zip GET /v1/version GET /v1/server/version ✅ /v1/version is now a redirect to /v1/server/version GET /v1/readyz GET /v1/server/readyz ✅ /v1/readyz is now a redirect to /v1/server/readyz POST /v1/AWSInstanceCheck GET /v1/server/AWSInstance ✅ -POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck +POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck ✅ POST /v1/settings/Change PUT /v1/server/settings ✅ POST /v1/settings/Get GET /v1/server/settings ✅ POST /v1/updates/Check GET /v1/server/updates diff --git a/api/server/v1/json/client/server_service/server_service_client.go b/api/server/v1/json/client/server_service/server_service_client.go index cdcc1c14abe..d571e6a99ab 100644 --- a/api/server/v1/json/client/server_service/server_service_client.go +++ b/api/server/v1/json/client/server_service/server_service_client.go @@ -222,7 +222,7 @@ func (a *Client) LeaderHealthCheck(params *LeaderHealthCheckParams, opts ...Clie op := &runtime.ClientOperation{ ID: "LeaderHealthCheck", Method: "POST", - PathPattern: "/v1/leaderHealthCheck", + PathPattern: "/v1/server/leaderHealthCheck", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, diff --git a/api/server/v1/server.proto b/api/server/v1/server.proto index cf7c700f8c3..ed5d6722bcc 100644 --- a/api/server/v1/server.proto +++ b/api/server/v1/server.proto @@ -220,8 +220,7 @@ service ServerService { // LeaderHealthCheck checks if the instance is the leader in a cluster. rpc LeaderHealthCheck(LeaderHealthCheckRequest) returns (LeaderHealthCheckResponse) { option (google.api.http) = { - post: "/v1/leaderHealthCheck" - body: "*" + get: "/v1/server/leaderHealthCheck" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "Check Leadership" diff --git a/managed/services/grafana/auth_server.go b/managed/services/grafana/auth_server.go index 5bbe8ec2d63..2d969105087 100644 --- a/managed/services/grafana/auth_server.go +++ b/managed/services/grafana/auth_server.go @@ -77,10 +77,10 @@ var rules = map[string]role{ "/v1/user": viewer, // must be available without authentication for health checking - "/v1/readyz": none, // TODO: remove before v3 GA - "/v1/server/readyz": none, - "/v1/leaderHealthCheck": none, - "/ping": none, // PMM 1.x variant + "/v1/readyz": none, // TODO: remove before v3 GA + "/v1/server/readyz": none, + "/v1/server/leaderHealthCheck": none, + "/ping": none, // PMM 1.x variant // must not be available without authentication as it can leak data "/v1/version": viewer, // TODO: remove before v3 GA diff --git a/managed/testdata/haproxy/haproxy.cfg b/managed/testdata/haproxy/haproxy.cfg index 57cf72dfb0a..c7ef7438fd6 100644 --- a/managed/testdata/haproxy/haproxy.cfg +++ b/managed/testdata/haproxy/haproxy.cfg @@ -23,7 +23,7 @@ frontend https_front backend http_back option httpchk - http-check send meth POST uri /v1/leaderHealthCheck ver HTTP/1.1 hdr Host www + http-check send meth POST uri /v1/server/leaderHealthCheck ver HTTP/1.1 hdr Host www http-check expect status 200 server pmm-server-active-http pmm-server-active:80 check server pmm-server-passive-http pmm-server-passive:80 check backup @@ -31,7 +31,7 @@ backend http_back backend https_back option httpchk - http-check send meth POST uri /v1/leaderHealthCheck ver HTTP/1.1 hdr Host www + http-check send meth POST uri /v1/server/leaderHealthCheck ver HTTP/1.1 hdr Host www http-check expect status 200 server pmm-server-active-https pmm-server-active:443 check ssl verify none backup server pmm-server-passive-https pmm-server-passive:443 check ssl verify none backup