This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new 4dded8a Marked /quota endpoint as deprecated.
4dded8a is described below
commit 4dded8aee7e8c385a4671233d7ee9092782cb780
Author: Benjamin Mahler <[email protected]>
AuthorDate: Fri Aug 16 19:05:33 2019 -0400
Marked /quota endpoint as deprecated.
This endpoint is already hidden from the quota documentation,
this updates the endpoint to note the deprecation.
Review: https://reviews.apache.org/r/71302
---
src/master/http.cpp | 6 +++++-
src/master/master.cpp | 14 ++++++++------
src/master/master.hpp | 8 ++++----
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 684a0f7..6400771 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -2113,8 +2113,11 @@ string Master::Http::QUOTA_HELP()
{
return HELP(
TLDR(
- "Gets or updates quota for roles."),
+ "(Deprecated) Gets or updates quota for roles."),
DESCRIPTION(
+ "NOTE: This endpoint is deprecated in favor of using the v1 master",
+ "calls: UPDATE_QUOTA and GET_QUOTA.",
+ "",
"Returns 200 OK when the quota was queried or updated successfully.",
"",
"Returns 307 TEMPORARY_REDIRECT redirect to the leading master when",
@@ -2143,6 +2146,7 @@ string Master::Http::QUOTA_HELP()
}
+// Deprecated in favor of v1 UPDATE_QUOTA and GET_QUOTA.
Future<Response> Master::Http::quota(
const Request& request,
const Option<Principal>& principal) const
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 599f62d..13ef6c2 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1066,21 +1066,23 @@ void Master::initialize()
logRequest(request);
return http.unreserve(request, principal);
});
- route("/quota",
+ route("/weights",
READWRITE_HTTP_AUTHENTICATION_REALM,
- Http::QUOTA_HELP(),
+ Http::WEIGHTS_HELP(),
[this](const process::http::Request& request,
const Option<Principal>& principal) {
logRequest(request);
- return http.quota(request, principal);
+ return http.weights(request, principal);
});
- route("/weights",
+
+ // Deprecated routes:
+ route("/quota",
READWRITE_HTTP_AUTHENTICATION_REALM,
- Http::WEIGHTS_HELP(),
+ Http::QUOTA_HELP(),
[this](const process::http::Request& request,
const Option<Principal>& principal) {
logRequest(request);
- return http.weights(request, principal);
+ return http.quota(request, principal);
});
// Provide HTTP assets from a "webui" directory. This is either
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 783e4a3..09a70df 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1618,14 +1618,14 @@ private:
const Option<process::http::authentication::Principal>&
principal) const;
- // /master/quota
- process::Future<process::http::Response> quota(
+ // /master/weights
+ process::Future<process::http::Response> weights(
const process::http::Request& request,
const Option<process::http::authentication::Principal>&
principal) const;
- // /master/weights
- process::Future<process::http::Response> weights(
+ // /master/quota (DEPRECATED).
+ process::Future<process::http::Response> quota(
const process::http::Request& request,
const Option<process::http::authentication::Principal>&
principal) const;