You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/06/02 18:45:19 UTC

mesos git commit: Added help for roles.json, state-summary and state.json.

Repository: mesos
Updated Branches:
  refs/heads/master 8a156c239 -> 427657f03


Added help for roles.json, state-summary and state.json.

Review: https://reviews.apache.org/r/34926


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/427657f0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/427657f0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/427657f0

Branch: refs/heads/master
Commit: 427657f03cb866f2c77deb1cb9755bcc8dcbeabb
Parents: 8a156c2
Author: Aditi Dixit <ad...@gmail.com>
Authored: Tue Jun 2 09:44:34 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Tue Jun 2 09:44:37 2015 -0700

----------------------------------------------------------------------
 src/master/http.cpp   | 36 +++++++++++++++++++++++++++++++++---
 src/master/master.cpp |  6 +++---
 src/master/master.hpp |  3 +++
 3 files changed, 39 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/427657f0/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 01dbdad..f8ac309 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -428,7 +428,7 @@ const string Master::Http::SLAVES_HELP = HELP(
         "/master/slaves"),
     DESCRIPTION(
         "This endpoint shows information about the slaves registered in",
-        "this master formated as a json object."));
+        "this master formatted as a JSON object."));
 
 
 Future<Response> Master::Http::slaves(const Request& request) const
@@ -451,6 +451,16 @@ Future<Response> Master::Http::slaves(const Request& request) const
 }
 
 
+const string Master::Http::STATE_HELP = HELP(
+    TLDR(
+        "Information about state of master."),
+    USAGE(
+        "/master/state"),
+    DESCRIPTION(
+        "This endpoint shows information about the frameworks, tasks,",
+        "executors and slaves running in the cluster as a JSON object."));
+
+
 Future<Response> Master::Http::state(const Request& request) const
 {
   JSON::Object object;
@@ -688,7 +698,7 @@ const TaskStateSummary TaskStateSummary::EMPTY;
 
 
 // This abstraction has no side-effects. It factors out computing the
-// 'TaskState' sumaries for frameworks and slaves. This answers the
+// 'TaskState' summaries for frameworks and slaves. This answers the
 // questions 'How many tasks are in each state for a given framework?'
 // and 'How many tasks are in each state for a given slave?'.
 class TaskStateSummaries
@@ -735,6 +745,16 @@ private:
 };
 
 
+const string Master::Http::STATESUMMARY_HELP = HELP(
+    TLDR(
+        "Summary of state of all tasks and registered frameworks in cluster."),
+    USAGE(
+        "/master/state-summary"),
+    DESCRIPTION(
+        "This endpoint gives a summary of the state of all tasks and",
+        "registered frameworks in the cluster as a JSON object."));
+
+
 Future<Response> Master::Http::stateSummary(const Request& request) const
 {
   JSON::Object object;
@@ -843,6 +863,16 @@ Future<Response> Master::Http::stateSummary(const Request& request) const
 }
 
 
+const string Master::Http::ROLES_HELP = HELP(
+    TLDR(
+        "Information about roles that the master is configured with."),
+    USAGE(
+        "/master/roles"),
+    DESCRIPTION(
+        "This endpoint gives information about the roles that are assigned",
+        "to frameworks and resources as a JSON object."));
+
+
 Future<Response> Master::Http::roles(const Request& request) const
 {
   JSON::Object object;
@@ -1068,7 +1098,7 @@ Future<Response> Master::Http::tasks(const Request& request) const
   }
 
   // Sort tasks by task status timestamp. Default order is descending.
-  // The earlist timestamp is chosen for comparison when multiple are present.
+  // The earliest timestamp is chosen for comparison when multiple are present.
   Option<string> order = request.query.get("order");
   if (order.isSome() && (order.get() == "asc")) {
     sort(tasks.begin(), tasks.end(), TaskComparator::ascending);

http://git-wip-us.apache.org/repos/asf/mesos/blob/427657f0/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 710b814..8c43570 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -747,7 +747,7 @@ void Master::initialize()
           return http.redirect(request);
         });
   route("/roles.json",
-        None(),
+        Http::ROLES_HELP,
         [http](const http::Request& request) {
           Http::log(request);
           return http.roles(request);
@@ -775,13 +775,13 @@ void Master::initialize()
           return http.slaves(request);
         });
   route("/state.json",
-        None(),
+        Http::STATE_HELP,
         [http](const http::Request& request) {
           Http::log(request);
           return http.state(request);
         });
   route("/state-summary",
-        None(),
+        Http::STATESUMMARY_HELP,
         [http](const http::Request& request) {
           Http::log(request);
           return http.stateSummary(request);

http://git-wip-us.apache.org/repos/asf/mesos/blob/427657f0/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index c0cc293..deeb0d8 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1081,9 +1081,12 @@ private:
     const static std::string HEALTH_HELP;
     const static std::string OBSERVE_HELP;
     const static std::string REDIRECT_HELP;
+    const static std::string ROLES_HELP;
     const static std::string SHUTDOWN_HELP;  // Deprecated.
     const static std::string TEARDOWN_HELP;
     const static std::string SLAVES_HELP;
+    const static std::string STATE_HELP;
+    const static std::string STATESUMMARY_HELP;
     const static std::string TASKS_HELP;
 
   private: