You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2015/09/12 11:22:06 UTC
[1/3] mesos git commit: Removed '.json' extension in files endpoints
url.
Repository: mesos
Updated Branches:
refs/heads/master c1b11acaf -> 8f7e303df
Removed '.json' extension in files endpoints url.
Added HTTP files endpoints without the json extension.
Review: https://reviews.apache.org/r/36127
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8f7e303d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8f7e303d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8f7e303d
Branch: refs/heads/master
Commit: 8f7e303dfeeda7c553e06f0b4baa1779fad2f93f
Parents: f893c85
Author: Isabel Jimenez <co...@isabeljimenez.com>
Authored: Fri Sep 11 22:28:16 2015 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Sat Sep 12 02:21:32 2015 -0700
----------------------------------------------------------------------
docs/configuration.md | 2 +-
src/cli/mesos-cat | 4 +--
src/cli/mesos-tail | 2 +-
src/files/files.cpp | 15 +++++++++
src/master/flags.cpp | 2 +-
src/slave/flags.cpp | 2 +-
src/tests/files_tests.cpp | 46 +++++++++++++-------------
src/tests/gc_tests.cpp | 6 ++--
src/webui/master/static/browse.html | 2 +-
src/webui/master/static/js/controllers.js | 2 +-
10 files changed, 49 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/docs/configuration.md
----------------------------------------------------------------------
diff --git a/docs/configuration.md b/docs/configuration.md
index 315dc53..dd7f4aa 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -58,7 +58,7 @@ If you have special compilation requirements, please refer to `./configure --hel
<pre><code>{
"disabled_endpoints" : {
"paths" : [
- "/files/browse.json",
+ "/files/browse",
"/slave(0)/stats.json",
]
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/cli/mesos-cat
----------------------------------------------------------------------
diff --git a/src/cli/mesos-cat b/src/cli/mesos-cat
index 63a90d1..ddc5a26 100755
--- a/src/cli/mesos-cat
+++ b/src/cli/mesos-cat
@@ -61,7 +61,7 @@ def read(slave, task, file):
try:
result = json.loads(http.get(
slave['pid'],
- '/files/read.json',
+ '/files/read',
{'path': path,
'offset': -1}))
except HTTPError as error:
@@ -80,7 +80,7 @@ def read(slave, task, file):
try:
result = json.loads(http.get(
slave['pid'],
- '/files/read.json',
+ '/files/read',
{'path': path,
'offset': offset,
'length': PAGE_LENGTH}))
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/cli/mesos-tail
----------------------------------------------------------------------
diff --git a/src/cli/mesos-tail b/src/cli/mesos-tail
index 28e16b2..031ee25 100755
--- a/src/cli/mesos-tail
+++ b/src/cli/mesos-tail
@@ -55,7 +55,7 @@ def read_forever(slave, task, file):
while True:
try:
result = json.loads(http.get(slave['pid'],
- '/files/read.json',
+ '/files/read',
{'path': path,
'offset': offset,
'length': PAGE_LENGTH}))
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/files/files.cpp
----------------------------------------------------------------------
diff --git a/src/files/files.cpp b/src/files/files.cpp
index a8807b6..1d4b1e6 100644
--- a/src/files/files.cpp
+++ b/src/files/files.cpp
@@ -134,6 +134,8 @@ FilesProcess::FilesProcess()
void FilesProcess::initialize()
{
+ // TODO(ijimenez): Remove these endpoints at the end of the
+ // deprecation cycle on 0.26.
route("/browse.json",
FilesProcess::BROWSE_HELP,
&FilesProcess::browse);
@@ -146,6 +148,19 @@ void FilesProcess::initialize()
route("/debug.json",
FilesProcess::DEBUG_HELP,
&FilesProcess::debug);
+
+ route("/browse",
+ FilesProcess::BROWSE_HELP,
+ &FilesProcess::browse);
+ route("/read",
+ FilesProcess::READ_HELP,
+ &FilesProcess::read);
+ route("/download",
+ FilesProcess::DOWNLOAD_HELP,
+ &FilesProcess::download);
+ route("/debug",
+ FilesProcess::DEBUG_HELP,
+ &FilesProcess::debug);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/master/flags.cpp
----------------------------------------------------------------------
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index 230c1dc..8087961 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -267,7 +267,7 @@ mesos::internal::master::Flags::Flags()
"{\n"
" \"disabled_endpoints\" : {\n"
" \"paths\" : [\n"
- " \"/files/browse.json\",\n"
+ " \"/files/browse\",\n"
" \"/slave(0)/stats.json\",\n"
" ]\n"
" }\n"
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index b676bac..ff167ec 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -322,7 +322,7 @@ mesos::internal::slave::Flags::Flags()
"{\n"
" \"disabled_endpoints\": {\n"
" \"paths\": [\n"
- " \"/files/browse.json\",\n"
+ " \"/files/browse\",\n"
" \"/slave(0)/stats.json\",\n"
" ]\n"
" }\n"
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/tests/files_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/files_tests.cpp b/src/tests/files_tests.cpp
index 53771cd..4b13f5b 100644
--- a/src/tests/files_tests.cpp
+++ b/src/tests/files_tests.cpp
@@ -88,21 +88,21 @@ TEST_F(FilesTest, ReadTest)
process::UPID upid("files", process::address());
Future<Response> response =
- process::http::get(upid, "read.json");
+ process::http::get(upid, "read");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(
"Expecting 'path=value' in query.\n",
response);
- response = process::http::get(upid, "read.json", "path=none&offset=hello");
+ response = process::http::get(upid, "read", "path=none&offset=hello");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(
"Failed to parse offset: Failed to convert 'hello' to number.\n",
response);
- response = process::http::get(upid, "read.json", "path=none&length=hello");
+ response = process::http::get(upid, "read", "path=none&length=hello");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(
@@ -119,12 +119,12 @@ TEST_F(FilesTest, ReadTest)
expected.values["offset"] = 0;
expected.values["data"] = "body";
- response = process::http::get(upid, "read.json", "path=/myname&offset=0");
+ response = process::http::get(upid, "read", "path=/myname&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
- response = process::http::get(upid, "read.json", "path=myname&offset=0");
+ response = process::http::get(upid, "read", "path=myname&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
@@ -132,7 +132,7 @@ TEST_F(FilesTest, ReadTest)
// Missing file.
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
NotFound().status,
- process::http::get(upid, "read.json", "path=missing"));
+ process::http::get(upid, "read", "path=missing"));
}
@@ -158,38 +158,38 @@ TEST_F(FilesTest, ResolveTest)
expected.values["data"] = "three";
Future<Response> response =
- process::http::get(upid, "read.json", "path=one/2/three&offset=0");
+ process::http::get(upid, "read", "path=one/2/three&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
response =
- process::http::get(upid, "read.json", "path=/one/2/three&offset=0");
+ process::http::get(upid, "read", "path=/one/2/three&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
response =
- process::http::get(upid, "read.json", "path=two/three&offset=0");
+ process::http::get(upid, "read", "path=two/three&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
response =
- process::http::get(upid, "read.json", "path=one/two/three&offset=0");
+ process::http::get(upid, "read", "path=one/two/three&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
// Percent encoded '/' urls.
response =
- process::http::get(upid, "read.json", "path=%2Fone%2F2%2Fthree&offset=0");
+ process::http::get(upid, "read", "path=%2Fone%2F2%2Fthree&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
response =
- process::http::get(upid, "read.json", "path=one%2Ftwo%2Fthree&offset=0");
+ process::http::get(upid, "read", "path=one%2Ftwo%2Fthree&offset=0");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
@@ -197,18 +197,18 @@ TEST_F(FilesTest, ResolveTest)
// Reading dirs not allowed.
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
BadRequest().status,
- process::http::get(upid, "read.json", "path=one/2"));
+ process::http::get(upid, "read", "path=one/2"));
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
BadRequest().status,
- process::http::get(upid, "read.json", "path=one"));
+ process::http::get(upid, "read", "path=one"));
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
BadRequest().status,
- process::http::get(upid, "read.json", "path=one/"));
+ process::http::get(upid, "read", "path=one/"));
// Breaking out of sandbox.
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
BadRequest().status,
- process::http::get(upid, "read.json", "path=two/../two"));
+ process::http::get(upid, "read", "path=two/../two"));
}
@@ -237,23 +237,23 @@ TEST_F(FilesTest, BrowseTest)
expected.values.push_back(jsonFileInfo("one/two", s));
Future<Response> response =
- process::http::get(upid, "browse.json", "path=one/");
+ process::http::get(upid, "browse", "path=one/");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
- response = process::http::get(upid, "browse.json", "path=one%2F");
+ response = process::http::get(upid, "browse", "path=one%2F");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
- response = process::http::get(upid, "browse.json", "path=one");
+ response = process::http::get(upid, "browse", "path=one");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
// Empty listing.
- response = process::http::get(upid, "browse.json", "path=one/2");
+ response = process::http::get(upid, "browse", "path=one/2");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(JSON::Array()), response);
@@ -261,7 +261,7 @@ TEST_F(FilesTest, BrowseTest)
// Missing dir.
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
NotFound().status,
- process::http::get(upid, "browse.json", "path=missing"));
+ process::http::get(upid, "browse", "path=missing"));
}
@@ -285,7 +285,7 @@ TEST_F(FilesTest, DownloadTest)
AWAIT_EXPECT_READY(files.attach("black.gif", "black.gif"));
Future<Response> response =
- process::http::get(upid, "download.json", "path=binary");
+ process::http::get(upid, "download", "path=binary");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_HEADER_EQ(
"application/octet-stream",
@@ -293,7 +293,7 @@ TEST_F(FilesTest, DownloadTest)
response);
AWAIT_EXPECT_RESPONSE_BODY_EQ("no file extension", response);
- response = process::http::get(upid, "download.json", "path=black.gif");
+ response = process::http::get(upid, "download", "path=black.gif");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
AWAIT_EXPECT_RESPONSE_HEADER_EQ("image/gif", "Content-Type", response);
AWAIT_EXPECT_RESPONSE_BODY_EQ(data, response);
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/tests/gc_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/gc_tests.cpp b/src/tests/gc_tests.cpp
index ec27ac7..3570170 100644
--- a/src/tests/gc_tests.cpp
+++ b/src/tests/gc_tests.cpp
@@ -465,7 +465,7 @@ TEST_F(GarbageCollectorIntegrationTest, ExitedFramework)
process::UPID filesUpid("files", process::address());
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
process::http::NotFound().status,
- process::http::get(filesUpid, "browse.json", "path=" + frameworkDir));
+ process::http::get(filesUpid, "browse", "path=" + frameworkDir));
Clock::resume();
@@ -566,7 +566,7 @@ TEST_F(GarbageCollectorIntegrationTest, ExitedExecutor)
process::UPID files("files", process::address());
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
process::http::NotFound().status,
- process::http::get(files, "browse.json", "path=" + executorDir));
+ process::http::get(files, "browse", "path=" + executorDir));
Clock::resume();
@@ -681,7 +681,7 @@ TEST_F(GarbageCollectorIntegrationTest, DiskUsage)
process::UPID files("files", process::address());
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
process::http::NotFound().status,
- process::http::get(files, "browse.json", "path=" + executorDir));
+ process::http::get(files, "browse", "path=" + executorDir));
Clock::resume();
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/webui/master/static/browse.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/browse.html b/src/webui/master/static/browse.html
index 0904c87..6b18056 100644
--- a/src/webui/master/static/browse.html
+++ b/src/webui/master/static/browse.html
@@ -68,7 +68,7 @@
</td>
<td>
<a data-ng-show="file.mode[0] != 'd'"
- href="//{{slave_host}}/files/download.json?path={{encodeURIComponent(file.path)}}">
+ href="//{{slave_host}}/files/download?path={{encodeURIComponent(file.path)}}">
<button class="btn btn-xs btn-default" type="button">
Download
</button>
http://git-wip-us.apache.org/repos/asf/mesos/blob/8f7e303d/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js
index 8193a44..c4340ab 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -14,7 +14,7 @@
// Invokes the pailer for the specified host and path using the
// specified window_title.
function pailer(host, path, window_title) {
- var url = '//' + host + '/files/read.json?path=' + path;
+ var url = '//' + host + '/files/read?path=' + path;
var pailer =
window.open('/static/pailer.html', url, 'width=580px, height=700px');
[3/3] mesos git commit: Removed '.json' extension in slave endpoints
url.
Posted by me...@apache.org.
Removed '.json' extension in slave endpoints url.
Added HTTP endpoints in slave without the json extension.
Review: https://reviews.apache.org/r/36126
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7b8da01d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7b8da01d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7b8da01d
Branch: refs/heads/master
Commit: 7b8da01ddb9f4c70159ca60758df109555204977
Parents: c1b11ac
Author: Isabel Jimenez <co...@isabeljimenez.com>
Authored: Fri Sep 11 22:19:21 2015 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Sat Sep 12 02:21:32 2015 -0700
----------------------------------------------------------------------
docs/network-monitoring.md | 4 ++--
src/cli/mesos-cat | 4 ++--
src/cli/mesos-ps | 2 +-
src/cli/mesos-tail | 4 ++--
src/slave/monitor.cpp | 8 +++++++-
src/slave/slave.cpp | 16 ++++++++++++----
src/slave/slave.hpp | 2 +-
src/tests/fault_tolerance_tests.cpp | 6 +++---
src/tests/monitor_tests.cpp | 12 ++++++------
src/tests/slave_tests.cpp | 8 ++++----
src/webui/master/static/js/controllers.js | 10 +++++-----
src/webui/master/static/js/services.js | 2 +-
12 files changed, 46 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/docs/network-monitoring.md
----------------------------------------------------------------------
diff --git a/docs/network-monitoring.md b/docs/network-monitoring.md
index acd70c5..b266ae5 100644
--- a/docs/network-monitoring.md
+++ b/docs/network-monitoring.md
@@ -290,9 +290,9 @@ for each of these elements includes:
[3] Currently always reported as 0 by the underlying Traffic Control element.
-For example, these are the statistics you will get by hitting the `/monitor/statistics.json` endpoint on a slave with network monitoring turned on:
+For example, these are the statistics you will get by hitting the `/monitor/statistics` endpoint on a slave with network monitoring turned on:
- $ curl -s http://localhost:5051/monitor/statistics.json | python2.6 -mjson.tool
+ $ curl -s http://localhost:5051/monitor/statistics | python2.6 -mjson.tool
[
{
"executor_id": "job.1436298853",
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/cli/mesos-cat
----------------------------------------------------------------------
diff --git a/src/cli/mesos-cat b/src/cli/mesos-cat
index 73dc63e..24a1e64 100755
--- a/src/cli/mesos-cat
+++ b/src/cli/mesos-cat
@@ -26,9 +26,9 @@ def read(slave, task, file):
# uses the same executor ID as task ID in the slave.
if executor_id == '': executor_id = task['id']
- # Get 'state.json' to determine the executor directory.
+ # Get 'state' json to determine the executor directory.
try:
- state = json.loads(http.get(slave['pid'], '/state.json'))
+ state = json.loads(http.get(slave['pid'], '/state'))
except:
fatal('Failed to get state from slave')
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/cli/mesos-ps
----------------------------------------------------------------------
diff --git a/src/cli/mesos-ps b/src/cli/mesos-ps
index ee14d51..7976069 100755
--- a/src/cli/mesos-ps
+++ b/src/cli/mesos-ps
@@ -196,7 +196,7 @@ def main():
slaves = [slave for slave in state['slaves'] if slave['id'] in active]
# Now submit calls to get the statistics for each slave.
- path = '/monitor/statistics.json'
+ path = '/monitor/statistics'
futures = dict((executor.submit(http.get, slave['pid'], path), slave)
for slave in slaves)
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/cli/mesos-tail
----------------------------------------------------------------------
diff --git a/src/cli/mesos-tail b/src/cli/mesos-tail
index 256a804..6acec2c 100755
--- a/src/cli/mesos-tail
+++ b/src/cli/mesos-tail
@@ -26,9 +26,9 @@ def read_forever(slave, task, file):
# uses the same executor ID as task ID in the slave.
if executor_id == "": executor_id = task['id']
- # Get 'state.json' to get the executor directory.
+ # Get 'state' json to get the executor directory.
try:
- state = json.loads(http.get(slave['pid'], '/state.json'))
+ state = json.loads(http.get(slave['pid'], '/state'))
except:
fatal('Failed to get state from slave')
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/slave/monitor.cpp
----------------------------------------------------------------------
diff --git a/src/slave/monitor.cpp b/src/slave/monitor.cpp
index 93ba279..8d8b422 100644
--- a/src/slave/monitor.cpp
+++ b/src/slave/monitor.cpp
@@ -93,9 +93,15 @@ public:
protected:
virtual void initialize()
{
+ // TODO(ijimenez): Remove this endpoint at the end of the
+ // deprecation cycle on 0.26.
route("/statistics.json",
STATISTICS_HELP(),
&ResourceMonitorProcess::statistics);
+
+ route("/statistics",
+ STATISTICS_HELP(),
+ &ResourceMonitorProcess::statistics);
}
private:
@@ -147,7 +153,7 @@ private:
// Callback used to retrieve resource usage information from slave.
const lambda::function<Future<ResourceUsage>()> usage;
- // Used to rate limit the statistics.json endpoint.
+ // Used to rate limit the statistics endpoint.
RateLimiter limiter;
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 5e5522e..44865bd 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -494,17 +494,25 @@ void Slave::initialize()
// Setup HTTP routes.
Http http = Http(this);
- route("/health",
- Http::HEALTH_HELP,
+ // TODO(ijimenez): Remove this endpoint at the end of the
+ // deprecation cycle on 0.26.
+ route("/state.json",
+ Http::STATE_HELP,
[http](const process::http::Request& request) {
- return http.health(request);
+ Http::log(request);
+ return http.state(request);
});
- route("/state.json",
+ route("/state",
Http::STATE_HELP,
[http](const process::http::Request& request) {
Http::log(request);
return http.state(request);
});
+ route("/health",
+ Http::HEALTH_HELP,
+ [http](const process::http::Request& request) {
+ return http.health(request);
+ });
// Expose the log file for the webui. Fall back to 'log_dir' if
// an explicit file was not specified.
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 09172f7..32e1830 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -403,7 +403,7 @@ private:
process::Future<process::http::Response> health(
const process::http::Request& request) const;
- // /slave/state.json
+ // /slave/state
process::Future<process::http::Response> state(
const process::http::Request& request) const;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/tests/fault_tolerance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fault_tolerance_tests.cpp b/src/tests/fault_tolerance_tests.cpp
index 89cb18b..82f8cfd 100644
--- a/src/tests/fault_tolerance_tests.cpp
+++ b/src/tests/fault_tolerance_tests.cpp
@@ -235,7 +235,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
EXPECT_EQ(1u,
masterJSON.values["frameworks"].as<JSON::Array>().values.size());
- Future<Response> slaveState = process::http::get(slave.get(), "state.json");
+ Future<Response> slaveState = process::http::get(slave.get(), "state");
parse = JSON::parse<JSON::Object>(slaveState.get().body);
ASSERT_SOME(parse);
@@ -272,7 +272,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
EXPECT_EQ(1u,
masterJSON.values["frameworks"].as<JSON::Array>().values.size());
- slaveState = process::http::get(slave.get(), "state.json");
+ slaveState = process::http::get(slave.get(), "state");
parse = JSON::parse<JSON::Object>(slaveState.get().body);
ASSERT_SOME(parse);
slaveJSON = parse.get();
@@ -299,7 +299,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
Clock::resume();
// Verify slave sees completed framework.
- slaveState = process::http::get(slave.get(), "state.json");
+ slaveState = process::http::get(slave.get(), "state");
parse = JSON::parse<JSON::Object>(slaveState.get().body);
ASSERT_SOME(parse);
slaveJSON = parse.get();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/tests/monitor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/monitor_tests.cpp b/src/tests/monitor_tests.cpp
index 53fb53e..f404955 100644
--- a/src/tests/monitor_tests.cpp
+++ b/src/tests/monitor_tests.cpp
@@ -97,7 +97,7 @@ TEST(MonitorTest, Statistics)
UPID upid("monitor", process::address());
- Future<http::Response> response = http::get(upid, "statistics.json");
+ Future<http::Response> response = http::get(upid, "statistics");
AWAIT_READY(response);
AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
@@ -147,7 +147,7 @@ TEST(MonitorTest, Statistics)
}
-// This test verifies the correct handling of the statistics.json
+// This test verifies the correct handling of the statistics
// endpoint when there is no executor running.
TEST(MonitorTest, NoExecutor)
{
@@ -157,7 +157,7 @@ TEST(MonitorTest, NoExecutor)
UPID upid("monitor", process::address());
- Future<http::Response> response = http::get(upid, "statistics.json");
+ Future<http::Response> response = http::get(upid, "statistics");
AWAIT_READY(response);
AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
@@ -169,7 +169,7 @@ TEST(MonitorTest, NoExecutor)
}
-// This test verifies the correct handling of the statistics.json
+// This test verifies the correct handling of the statistics
// endpoint when statistics is missing in ResourceUsage.
TEST(MonitorTest, MissingStatistics)
{
@@ -198,7 +198,7 @@ TEST(MonitorTest, MissingStatistics)
UPID upid("monitor", process::address());
- Future<http::Response> response = http::get(upid, "statistics.json");
+ Future<http::Response> response = http::get(upid, "statistics");
AWAIT_READY(response);
AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
@@ -262,7 +262,7 @@ TEST_F(MonitorIntegrationTest, RunningExecutor)
// resource statistics for the running container.
UPID upid("monitor", process::address());
- Future<http::Response> response = http::get(upid, "statistics.json");
+ Future<http::Response> response = http::get(upid, "statistics");
AWAIT_READY(response);
AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 5c1a3d3..447c43c 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -1045,7 +1045,7 @@ TEST_F(SlaveTest, StateEndpoint)
ASSERT_SOME(slave);
Future<process::http::Response> response =
- process::http::get(slave.get(), "state.json");
+ process::http::get(slave.get(), "state");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(process::http::OK().status, response);
@@ -1157,7 +1157,7 @@ TEST_F(SlaveTest, StateEndpoint)
AWAIT_READY(status);
EXPECT_EQ(TASK_RUNNING, status.get().state());
- response = http::get(slave.get(), "state.json");
+ response = http::get(slave.get(), "state");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
@@ -2079,9 +2079,9 @@ TEST_F(SlaveTest, TaskLabels)
AWAIT_READY(update);
- // Verify label key and value in slave state.json.
+ // Verify label key and value in slave state endpoint.
Future<process::http::Response> response =
- process::http::get(slave.get(), "state.json");
+ process::http::get(slave.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js
index fbf8696..6b46ab2 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -427,7 +427,7 @@
$top.start(host, $scope);
}
- $http.jsonp('//' + host + '/' + id + '/state.json?jsonp=JSON_CALLBACK')
+ $http.jsonp('//' + host + '/' + id + '/state?jsonp=JSON_CALLBACK')
.success(function (response) {
$scope.state = response;
@@ -505,7 +505,7 @@
$top.start(host, $scope);
}
- $http.jsonp('//' + host + '/' + id + '/state.json?jsonp=JSON_CALLBACK')
+ $http.jsonp('//' + host + '/' + id + '/state?jsonp=JSON_CALLBACK')
.success(function (response) {
$scope.state = response;
@@ -578,7 +578,7 @@
$top.start(host, $scope);
}
- $http.jsonp('//' + host + '/' + id + '/state.json?jsonp=JSON_CALLBACK')
+ $http.jsonp('//' + host + '/' + id + '/state?jsonp=JSON_CALLBACK')
.success(function (response) {
$scope.state = response;
@@ -683,7 +683,7 @@
// Request slave details to get access to the route executor's "directory"
// to navigate directly to the executor's sandbox.
- $http.jsonp('//' + host + '/' + id + '/state.json?jsonp=JSON_CALLBACK')
+ $http.jsonp('//' + host + '/' + id + '/state?jsonp=JSON_CALLBACK')
.success(function(response) {
function matchFramework(framework) {
@@ -753,7 +753,7 @@
var hostname = $scope.slaves[$routeParams.slave_id].hostname;
var id = pid.substring(0, pid.indexOf('@'));
var host = hostname + ":" + pid.substring(pid.lastIndexOf(':') + 1);
- var url = '//' + host + '/files/browse.json?jsonp=JSON_CALLBACK';
+ var url = '//' + host + '/files/browse?jsonp=JSON_CALLBACK';
$scope.slave_host = host;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7b8da01d/src/webui/master/static/js/services.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/services.js b/src/webui/master/static/js/services.js
index 2cd9d7d..d41bc71 100644
--- a/src/webui/master/static/js/services.js
+++ b/src/webui/master/static/js/services.js
@@ -271,7 +271,7 @@
return;
}
- this.endpoint = '//' + host + '/monitor/statistics.json?jsonp=JSON_CALLBACK';
+ this.endpoint = '//' + host + '/monitor/statistics?jsonp=JSON_CALLBACK';
this.scope = scope;
// Initial poll is immediate.
[2/3] mesos git commit: Removed '.json' extension in master endpoints
url.
Posted by me...@apache.org.
Removed '.json' extension in master endpoints url.
Added HTTP endpoints in master without the json extension.
Review: https://reviews.apache.org/r/36125
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f893c856
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f893c856
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f893c856
Branch: refs/heads/master
Commit: f893c856c60f8169713f19fd99be73ac10dcc259
Parents: 7b8da01
Author: Isabel Jimenez <co...@isabeljimenez.com>
Authored: Fri Sep 11 22:23:56 2015 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Sat Sep 12 02:21:32 2015 -0700
----------------------------------------------------------------------
src/cli/mesos-cat | 2 +-
src/cli/mesos-ps | 2 +-
src/cli/mesos-scp | 2 +-
src/cli/mesos-tail | 2 +-
src/master/constants.hpp | 2 +-
src/master/master.cpp | 24 ++++++++++++++
src/master/master.hpp | 6 ++--
src/tests/fault_tolerance_tests.cpp | 8 ++---
src/tests/master_tests.cpp | 45 +++++++++++++-------------
src/webui/master/static/js/controllers.js | 6 ++--
10 files changed, 62 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/cli/mesos-cat
----------------------------------------------------------------------
diff --git a/src/cli/mesos-cat b/src/cli/mesos-cat
index 24a1e64..63a90d1 100755
--- a/src/cli/mesos-cat
+++ b/src/cli/mesos-cat
@@ -116,7 +116,7 @@ def main():
# Get the master's state.
try:
state = json.loads(http.get(resolve(options.master),
- '/master/state.json'))
+ '/master/state'))
except:
fatal('Failed to get the master state')
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/cli/mesos-ps
----------------------------------------------------------------------
diff --git a/src/cli/mesos-ps b/src/cli/mesos-ps
index 7976069..f7fac4b 100755
--- a/src/cli/mesos-ps
+++ b/src/cli/mesos-ps
@@ -163,7 +163,7 @@ def main():
# Get the master's state.
try:
state = json.loads(http.get(resolve(options.master),
- '/master/state.json'))
+ '/master/state'))
except:
fatal('Failed to get the master state')
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/cli/mesos-scp
----------------------------------------------------------------------
diff --git a/src/cli/mesos-scp b/src/cli/mesos-scp
index 77b8557..f305abd 100755
--- a/src/cli/mesos-scp
+++ b/src/cli/mesos-scp
@@ -50,7 +50,7 @@ def main():
# Get the master's state.
try:
state = json.loads(http.get(resolve(options.master),
- '/master/state.json'))
+ '/master/state'))
except:
fatal('Failed to get the master state')
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/cli/mesos-tail
----------------------------------------------------------------------
diff --git a/src/cli/mesos-tail b/src/cli/mesos-tail
index 6acec2c..28e16b2 100755
--- a/src/cli/mesos-tail
+++ b/src/cli/mesos-tail
@@ -95,7 +95,7 @@ def main():
# Get the master's state.
try:
master_state = json.loads(http.get(resolve(options.master),
- '/master/state.json'))
+ '/master/state'))
except:
fatal('Failed to get the master state')
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/master/constants.hpp
----------------------------------------------------------------------
diff --git a/src/master/constants.hpp b/src/master/constants.hpp
index c3fe140..51d4774 100644
--- a/src/master/constants.hpp
+++ b/src/master/constants.hpp
@@ -100,7 +100,7 @@ extern const uint32_t MAX_COMPLETED_TASKS_PER_FRAMEWORK;
// Time interval to check for updated watchers list.
extern const Duration WHITELIST_WATCH_INTERVAL;
-// Default number of tasks (limit) for /master/tasks.json endpoint.
+// Default number of tasks (limit) for /master/tasks endpoint.
extern const uint32_t TASK_LIMIT;
/**
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 4b60e63..c90311f 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -785,12 +785,20 @@ void Master::initialize()
[http](const process::http::Request& request) {
return http.reserve(request);
});
+ // TODO(ijimenez): Remove this endpoint at the end of the
+ // deprecation cycle on 0.26.
route("/roles.json",
Http::ROLES_HELP,
[http](const process::http::Request& request) {
Http::log(request);
return http.roles(request);
});
+ route("/roles",
+ Http::ROLES_HELP,
+ [http](const process::http::Request& request) {
+ Http::log(request);
+ return http.roles(request);
+ });
route("/teardown",
Http::TEARDOWN_HELP,
[http](const process::http::Request& request) {
@@ -803,24 +811,40 @@ void Master::initialize()
Http::log(request);
return http.slaves(request);
});
+ // TODO(ijimenez): Remove this endpoint at the end of the
+ // deprecation cycle on 0.26.
route("/state.json",
Http::STATE_HELP,
[http](const process::http::Request& request) {
Http::log(request);
return http.state(request);
});
+ route("/state",
+ Http::STATE_HELP,
+ [http](const process::http::Request& request) {
+ Http::log(request);
+ return http.state(request);
+ });
route("/state-summary",
Http::STATESUMMARY_HELP,
[http](const process::http::Request& request) {
Http::log(request);
return http.stateSummary(request);
});
+ // TODO(ijimenez): Remove this endpoint at the end of the
+ // deprecation cycle.
route("/tasks.json",
Http::TASKS_HELP,
[http](const process::http::Request& request) {
Http::log(request);
return http.tasks(request);
});
+ route("/tasks",
+ Http::TASKS_HELP,
+ [http](const process::http::Request& request) {
+ Http::log(request);
+ return http.tasks(request);
+ });
route("/maintenance/schedule",
Http::MAINTENANCE_SCHEDULE_HELP,
[http](const process::http::Request& request) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 1dfc947..12cc1ad 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -826,7 +826,7 @@ private:
process::Future<process::http::Response> reserve(
const process::http::Request& request) const;
- // /master/roles.json
+ // /master/roles
process::Future<process::http::Response> roles(
const process::http::Request& request) const;
@@ -838,7 +838,7 @@ private:
process::Future<process::http::Response> slaves(
const process::http::Request& request) const;
- // /master/state.json
+ // /master/state
process::Future<process::http::Response> state(
const process::http::Request& request) const;
@@ -846,7 +846,7 @@ private:
process::Future<process::http::Response> stateSummary(
const process::http::Request& request) const;
- // /master/tasks.json
+ // /master/tasks
process::Future<process::http::Response> tasks(
const process::http::Request& request) const;
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/tests/fault_tolerance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fault_tolerance_tests.cpp b/src/tests/fault_tolerance_tests.cpp
index 82f8cfd..061e099 100644
--- a/src/tests/fault_tolerance_tests.cpp
+++ b/src/tests/fault_tolerance_tests.cpp
@@ -167,7 +167,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
ASSERT_SOME(slave);
// Verify master/slave have 0 completed/running frameworks.
- Future<Response> masterState = process::http::get(master.get(), "state.json");
+ Future<Response> masterState = process::http::get(master.get(), "state");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, masterState);
AWAIT_EXPECT_RESPONSE_HEADER_EQ(
@@ -224,7 +224,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
// Verify master and slave recognize the running task/framework.
- masterState = process::http::get(master.get(), "state.json");
+ masterState = process::http::get(master.get(), "state");
parse = JSON::parse<JSON::Object>(masterState.get().body);
ASSERT_SOME(parse);
@@ -262,7 +262,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
// At this point, the task is killed, but the framework is still
// running. This is because the executor has to time-out before
// it exits.
- masterState = process::http::get(master.get(), "state.json");
+ masterState = process::http::get(master.get(), "state");
parse = JSON::parse<JSON::Object>(masterState.get().body);
ASSERT_SOME(parse);
masterJSON = parse.get();
@@ -340,7 +340,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
Clock::settle();
Clock::resume();
- masterState = process::http::get(master.get(), "state.json");
+ masterState = process::http::get(master.get(), "state");
parse = JSON::parse<JSON::Object>(masterState.get().body);
ASSERT_SOME(parse);
masterJSON = parse.get();
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 8a6b98b..dd65fcc 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -280,7 +280,7 @@ TEST_F(MasterTest, ShutdownFrameworkWhileTaskRunning)
// Request master state.
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_READY(response);
// These checks are not essential for the test, but may help
@@ -2178,7 +2178,7 @@ TEST_F(MasterZooKeeperTest, MasterInfoAddress)
// This test ensures that when a master fails over, those tasks that
// belong to some currently unregistered frameworks will appear in the
-// "orphan_tasks" field in the state.json. And those unregistered frameworks
+// "orphan_tasks" field in the state endpoint. And those unregistered frameworks
// will appear in the "unregistered_frameworks" field.
TEST_F(MasterTest, OrphanTasks)
{
@@ -2224,7 +2224,7 @@ TEST_F(MasterTest, OrphanTasks)
// Get the master's state.
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
@@ -2290,7 +2290,7 @@ TEST_F(MasterTest, OrphanTasks)
AWAIT_READY(subscribeCall);
// Get the master's state.
- response = process::http::get(master.get(), "state.json");
+ response = process::http::get(master.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
@@ -2325,7 +2325,7 @@ TEST_F(MasterTest, OrphanTasks)
AWAIT_READY(frameworkRegisteredMessage);
// Get the master's state.
- response = process::http::get(master.get(), "state.json");
+ response = process::http::get(master.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
@@ -2792,7 +2792,7 @@ TEST_F(MasterTest, StateEndpoint)
ASSERT_SOME(master);
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(process::http::OK().status, response);
@@ -2973,7 +2973,7 @@ TEST_F(MasterTest, StateSummaryEndpoint)
// This test ensures that the web UI and capabilities of a framework
-// are included in the state.json endpoint, if provided by the
+// are included in the master's state endpoint, if provided by the
// framework.
TEST_F(MasterTest, FrameworkWebUIUrlandCapabilities)
{
@@ -2998,7 +2998,7 @@ TEST_F(MasterTest, FrameworkWebUIUrlandCapabilities)
AWAIT_READY(registered);
Future<process::http::Response> masterState =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_EXPECT_RESPONSE_STATUS_EQ(process::http::OK().status, masterState);
Try<JSON::Object> parse = JSON::parse<JSON::Object>(masterState.get().body);
@@ -3035,7 +3035,7 @@ TEST_F(MasterTest, FrameworkWebUIUrlandCapabilities)
}
-// This test verifies that label values are exposed over the master
+// This test verifies that label values are exposed over the master's
// state endpoint.
TEST_F(MasterTest, TaskLabels)
{
@@ -3103,9 +3103,9 @@ TEST_F(MasterTest, TaskLabels)
AWAIT_READY(update);
- // Verify label key and value in master state.json.
+ // Verify label key and value in the master's state endpoint.
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
@@ -3143,7 +3143,7 @@ TEST_F(MasterTest, TaskLabels)
// This test verifies that TaskStatus label values are exposed over
-// the master state endpoint.
+// the master's state endpoint.
TEST_F(MasterTest, TaskStatusLabels)
{
Try<PID<Master>> master = StartMaster();
@@ -3244,9 +3244,9 @@ TEST_F(MasterTest, TaskStatusLabels)
}
-// This tests the 'active' field in slave entries from state.json. We
-// first verify an active slave, deactivate it and verify that the
-// 'active' field is false.
+// This tests the 'active' field in slave entries from the master's
+// state endpoint. We first verify an active slave, deactivate it
+// and verify that the 'active' field is false.
TEST_F(MasterTest, SlaveActiveEndpoint)
{
// Start a master.
@@ -3263,7 +3263,7 @@ TEST_F(MasterTest, SlaveActiveEndpoint)
// Verify slave is active.
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_READY(response);
Try<JSON::Object> parse = JSON::parse<JSON::Object>(response.get().body);
@@ -3285,7 +3285,7 @@ TEST_F(MasterTest, SlaveActiveEndpoint)
AWAIT_READY(deactivateSlave);
// Verify slave is inactive.
- response = process::http::get(master.get(), "state.json");
+ response = process::http::get(master.get(), "state");
AWAIT_READY(response);
parse = JSON::parse<JSON::Object>(response.get().body);
@@ -3300,7 +3300,7 @@ TEST_F(MasterTest, SlaveActiveEndpoint)
// This test verifies that service info for tasks is exposed over the
-// master state endpoint.
+// master's state endpoint.
TEST_F(MasterTest, TaskDiscoveryInfo)
{
Try<PID<Master>> master = StartMaster();
@@ -3382,9 +3382,9 @@ TEST_F(MasterTest, TaskDiscoveryInfo)
AWAIT_READY(update);
- // Verify label key and value in master state.json.
+ // Verify label key and value in the master's state endpoint.
Future<process::http::Response> response =
- process::http::get(master.get(), "state.json");
+ process::http::get(master.get(), "state");
AWAIT_READY(response);
EXPECT_SOME_EQ(
@@ -3594,8 +3594,9 @@ TEST_F(MasterTest, MasterFailoverLongLivedExecutor)
Shutdown(); // Must shutdown before 'containerizer' gets deallocated.
}
-// This test ensures that if a framework scheduler provides any labels in its
-// FrameworkInfo message, those labels are included in the state.json endpoint.
+// This test ensures that if a framework scheduler provides any
+// labels in its FrameworkInfo message, those labels are included
+// in the master's state endpoint.
TEST_F(MasterTest, FrameworkInfoLabels)
{
Try<PID<Master>> master = StartMaster();
http://git-wip-us.apache.org/repos/asf/mesos/blob/f893c856/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js
index 6b46ab2..8193a44 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -282,7 +282,7 @@
});
var poll = function() {
- $http.get('master/state.json',
+ $http.get('master/state',
{transformResponse: function(data) { return data; }})
.success(function(data) {
if (update($scope, $timeout, data)) {
@@ -637,8 +637,8 @@
// directory to browse is known by the slave but not by the master. Request
// the directory from the slave, and then redirect to it.
//
- // TODO(ssorallen): Add `executor.directory` to the state.json output so this
- // controller of rerouting is no longer necessary.
+ // TODO(ssorallen): Add `executor.directory` to the master's state endpoint
+ // output so this controller of rerouting is no longer necessary.
mesosApp.controller('SlaveExecutorRerouterCtrl',
function($alert, $http, $location, $routeParams, $scope, $window) {