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 2016/03/18 22:32:32 UTC

[1/3] mesos git commit: Regenerated master endpoint documentation.

Repository: mesos
Updated Branches:
  refs/heads/master 630b12ad8 -> 53c0588ee


Regenerated master endpoint documentation.

Reran the generate-endpoint-help.py scipt after adding the
AUTHENTICATION information to HELP.

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


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

Branch: refs/heads/master
Commit: 53c0588eeea12ef9a20b596668434306764aaca1
Parents: cbbb46c
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 18 03:29:39 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Fri Mar 18 14:31:20 2016 -0700

----------------------------------------------------------------------
 docs/endpoints/master/api/v1/scheduler.md     | 6 +++++-
 docs/endpoints/master/create-volumes.md       | 7 ++++++-
 docs/endpoints/master/destroy-volumes.md      | 7 ++++++-
 docs/endpoints/master/flags.md                | 6 +++++-
 docs/endpoints/master/frameworks.md           | 6 +++++-
 docs/endpoints/master/health.md               | 6 +++++-
 docs/endpoints/master/machine/down.md         | 7 ++++++-
 docs/endpoints/master/machine/up.md           | 7 ++++++-
 docs/endpoints/master/maintenance/schedule.md | 7 ++++++-
 docs/endpoints/master/maintenance/status.md   | 7 ++++++-
 docs/endpoints/master/observe.md              | 7 ++++++-
 docs/endpoints/master/quota.md                | 7 ++++++-
 docs/endpoints/master/redirect.md             | 6 +++++-
 docs/endpoints/master/reserve.md              | 7 ++++++-
 docs/endpoints/master/roles.json.md           | 7 ++++++-
 docs/endpoints/master/roles.md                | 7 ++++++-
 docs/endpoints/master/slaves.md               | 7 ++++++-
 docs/endpoints/master/state-summary.md        | 7 ++++++-
 docs/endpoints/master/state.json.md           | 7 ++++++-
 docs/endpoints/master/state.md                | 7 ++++++-
 docs/endpoints/master/tasks.json.md           | 7 ++++++-
 docs/endpoints/master/tasks.md                | 7 ++++++-
 docs/endpoints/master/teardown.md             | 7 ++++++-
 docs/endpoints/master/unreserve.md            | 7 ++++++-
 docs/endpoints/master/weights.md              | 7 ++++++-
 25 files changed, 145 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/api/v1/scheduler.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/api/v1/scheduler.md b/docs/endpoints/master/api/v1/scheduler.md
index 7a75fd7..5389799 100644
--- a/docs/endpoints/master/api/v1/scheduler.md
+++ b/docs/endpoints/master/api/v1/scheduler.md
@@ -12,4 +12,8 @@ layout: documentation
 Endpoint for schedulers to make Calls against the master.
 
 ### DESCRIPTION ###
-Returns 202 Accepted iff the request is accepted.
\ No newline at end of file
+Returns 202 Accepted iff the request is accepted.
+
+
+### AUTHENTICATION ###
+This endpoint does not require authentication.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/create-volumes.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/create-volumes.md b/docs/endpoints/master/create-volumes.md
index 2ab116a..52ae3a8 100644
--- a/docs/endpoints/master/create-volumes.md
+++ b/docs/endpoints/master/create-volumes.md
@@ -17,4 +17,9 @@ imply that the volume was created successfully: volume
 creation is done asynchronously and may fail.
 
 Please provide "slaveId" and "volumes" values designating
-the volumes to be created.
\ No newline at end of file
+the volumes to be created.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/destroy-volumes.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/destroy-volumes.md b/docs/endpoints/master/destroy-volumes.md
index 88679fe..a0bb1e8 100644
--- a/docs/endpoints/master/destroy-volumes.md
+++ b/docs/endpoints/master/destroy-volumes.md
@@ -17,4 +17,9 @@ imply that the volume was destroyed successfully: volume
 destruction is done asynchronously and may fail.
 
 Please provide "slaveId" and "volumes" values designating
-the volumes to be destroyed.
\ No newline at end of file
+the volumes to be destroyed.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/flags.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/flags.md b/docs/endpoints/master/flags.md
index 739d6bf..e9038fe 100644
--- a/docs/endpoints/master/flags.md
+++ b/docs/endpoints/master/flags.md
@@ -9,4 +9,8 @@ layout: documentation
 >        /master/flags
 
 ### TL;DR; ###
-Exposes the master's flag configuration.
\ No newline at end of file
+Exposes the master's flag configuration.
+
+### DESCRIPTION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/frameworks.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/frameworks.md b/docs/endpoints/master/frameworks.md
index 95c1f0e..15ecabf 100644
--- a/docs/endpoints/master/frameworks.md
+++ b/docs/endpoints/master/frameworks.md
@@ -9,4 +9,8 @@ layout: documentation
 >        /master/frameworks
 
 ### TL;DR; ###
-Exposes the frameworks info.
\ No newline at end of file
+Exposes the frameworks info.
+
+### DESCRIPTION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/health.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/health.md b/docs/endpoints/master/health.md
index 7f93520..dc1c1cd 100644
--- a/docs/endpoints/master/health.md
+++ b/docs/endpoints/master/health.md
@@ -13,4 +13,8 @@ Health check of the Master.
 
 ### DESCRIPTION ###
 Returns 200 OK iff the Master is healthy.
-Delayed responses are also indicative of poor health.
\ No newline at end of file
+Delayed responses are also indicative of poor health.
+
+
+### AUTHENTICATION ###
+This endpoint does not require authentication.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/machine/down.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/machine/down.md b/docs/endpoints/master/machine/down.md
index 6eec9ec..f7e8141 100644
--- a/docs/endpoints/master/machine/down.md
+++ b/docs/endpoints/master/machine/down.md
@@ -14,4 +14,9 @@ Brings a set of machines down.
 ### DESCRIPTION ###
 POST: Validates the request body as JSON and transitions
   the list of machines into DOWN mode.  Currently, only
-  machines in DRAINING mode are allowed to be brought down.
\ No newline at end of file
+  machines in DRAINING mode are allowed to be brought down.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/machine/up.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/machine/up.md b/docs/endpoints/master/machine/up.md
index 7cbbf04..d96be72 100644
--- a/docs/endpoints/master/machine/up.md
+++ b/docs/endpoints/master/machine/up.md
@@ -14,4 +14,9 @@ Brings a set of machines back up.
 ### DESCRIPTION ###
 POST: Validates the request body as JSON and transitions
   the list of machines into UP mode.  This also removes
-  the list of machines from the maintenance schedule.
\ No newline at end of file
+  the list of machines from the maintenance schedule.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/maintenance/schedule.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/maintenance/schedule.md b/docs/endpoints/master/maintenance/schedule.md
index 5f5267d..577e43c 100644
--- a/docs/endpoints/master/maintenance/schedule.md
+++ b/docs/endpoints/master/maintenance/schedule.md
@@ -15,4 +15,9 @@ Returns or updates the cluster's maintenance schedule.
 GET: Returns the current maintenance schedule as JSON.
 
 POST: Validates the request body as JSON
-  and updates the maintenance schedule.
\ No newline at end of file
+  and updates the maintenance schedule.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/maintenance/status.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/maintenance/status.md b/docs/endpoints/master/maintenance/status.md
index 4d0c755..249dae2 100644
--- a/docs/endpoints/master/maintenance/status.md
+++ b/docs/endpoints/master/maintenance/status.md
@@ -16,4 +16,9 @@ Returns an object with one list of machines per machine mode.
 For draining machines, this list includes the frameworks' responses
 to inverse offers.  NOTE: Inverse offer responses are cleared if
 the master fails over.  However, new inverse offers will be sent
-once the master recovers.
\ No newline at end of file
+once the master recovers.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/observe.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/observe.md b/docs/endpoints/master/observe.md
index fae1ee0..9ebd527 100644
--- a/docs/endpoints/master/observe.md
+++ b/docs/endpoints/master/observe.md
@@ -17,4 +17,9 @@ health.
 The following fields should be supplied in a POST:
 1. monitor - name of the monitor that is being reported
 2. hosts - comma separated list of hosts
-3. level - OK for healthy, anything else for unhealthy
\ No newline at end of file
+3. level - OK for healthy, anything else for unhealthy
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/quota.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/quota.md b/docs/endpoints/master/quota.md
index 812874d..b1e3462 100644
--- a/docs/endpoints/master/quota.md
+++ b/docs/endpoints/master/quota.md
@@ -13,4 +13,9 @@ Sets quota for a role.
 
 ### DESCRIPTION ###
 POST: Validates the request body as JSON
- and sets quota for a role.
\ No newline at end of file
+ and sets quota for a role.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/redirect.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/redirect.md b/docs/endpoints/master/redirect.md
index ac9d0fa..833d993 100644
--- a/docs/endpoints/master/redirect.md
+++ b/docs/endpoints/master/redirect.md
@@ -21,4 +21,8 @@ Master will redirect to itself.
 running multiple Masters.
 2. This is broken currently "on the cloud" (e.g. EC2) as
 this will attempt to redirect to the private IP address, unless
-advertise_ip points to an externally accessible IP
\ No newline at end of file
+advertise_ip points to an externally accessible IP
+
+
+### AUTHENTICATION ###
+This endpoint does not require authentication.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/reserve.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/reserve.md b/docs/endpoints/master/reserve.md
index 1a4f679..1d481b5 100644
--- a/docs/endpoints/master/reserve.md
+++ b/docs/endpoints/master/reserve.md
@@ -17,4 +17,9 @@ imply that the requested resources have been reserved successfully:
 resource reservation is done asynchronously and may fail.
 
 Please provide "slaveId" and "resources" values designating
-the resources to be reserved.
\ No newline at end of file
+the resources to be reserved.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/roles.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/roles.json.md b/docs/endpoints/master/roles.json.md
index 8637153..01e2653 100644
--- a/docs/endpoints/master/roles.json.md
+++ b/docs/endpoints/master/roles.json.md
@@ -16,4 +16,9 @@ This endpoint provides information about roles as a JSON object.
 It returns information about every role that is on the role
 whitelist (if enabled), has one or more registered frameworks,
 or has a non-default weight or quota. For each role, it returns
-the weight, total allocated resources, and registered frameworks.
\ No newline at end of file
+the weight, total allocated resources, and registered frameworks.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/roles.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/roles.md b/docs/endpoints/master/roles.md
index 171e016..9c01d37 100644
--- a/docs/endpoints/master/roles.md
+++ b/docs/endpoints/master/roles.md
@@ -16,4 +16,9 @@ This endpoint provides information about roles as a JSON object.
 It returns information about every role that is on the role
 whitelist (if enabled), has one or more registered frameworks,
 or has a non-default weight or quota. For each role, it returns
-the weight, total allocated resources, and registered frameworks.
\ No newline at end of file
+the weight, total allocated resources, and registered frameworks.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/slaves.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/slaves.md b/docs/endpoints/master/slaves.md
index ec169c1..9e9fff7 100644
--- a/docs/endpoints/master/slaves.md
+++ b/docs/endpoints/master/slaves.md
@@ -13,4 +13,9 @@ Information about registered slaves.
 
 ### DESCRIPTION ###
 This endpoint shows information about the slaves registered in
-this master formatted as a JSON object.
\ No newline at end of file
+this master formatted as a JSON object.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/state-summary.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state-summary.md b/docs/endpoints/master/state-summary.md
index fb10ac7..a0da400 100644
--- a/docs/endpoints/master/state-summary.md
+++ b/docs/endpoints/master/state-summary.md
@@ -13,4 +13,9 @@ Summary of state of all tasks and registered frameworks in cluster.
 
 ### DESCRIPTION ###
 This endpoint gives a summary of the state of all tasks and
-registered frameworks in the cluster as a JSON object.
\ No newline at end of file
+registered frameworks in the cluster as a JSON object.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/state.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state.json.md b/docs/endpoints/master/state.json.md
index 0415cfd..7998b80 100644
--- a/docs/endpoints/master/state.json.md
+++ b/docs/endpoints/master/state.json.md
@@ -83,4 +83,9 @@ Example (**Note**: this is not exhaustive):
     "orphan_tasks" : [],
     "unregistered_frameworks" : []
 }
-```
\ No newline at end of file
+```
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/state.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state.md b/docs/endpoints/master/state.md
index ae1ec71..59518d6 100644
--- a/docs/endpoints/master/state.md
+++ b/docs/endpoints/master/state.md
@@ -83,4 +83,9 @@ Example (**Note**: this is not exhaustive):
     "orphan_tasks" : [],
     "unregistered_frameworks" : []
 }
-```
\ No newline at end of file
+```
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/tasks.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/tasks.json.md b/docs/endpoints/master/tasks.json.md
index 46a1253..29bb973 100644
--- a/docs/endpoints/master/tasks.json.md
+++ b/docs/endpoints/master/tasks.json.md
@@ -18,4 +18,9 @@ Query parameters:
 
 >        limit=VALUE          Maximum number of tasks returned (default is 100).
 >        offset=VALUE         Starts task list at offset.
->        order=(asc|desc)     Ascending or descending sort order (default is descending).
\ No newline at end of file
+>        order=(asc|desc)     Ascending or descending sort order (default is descending).
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/tasks.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/tasks.md b/docs/endpoints/master/tasks.md
index 2ada97b..ab9bb09 100644
--- a/docs/endpoints/master/tasks.md
+++ b/docs/endpoints/master/tasks.md
@@ -18,4 +18,9 @@ Query parameters:
 
 >        limit=VALUE          Maximum number of tasks returned (default is 100).
 >        offset=VALUE         Starts task list at offset.
->        order=(asc|desc)     Ascending or descending sort order (default is descending).
\ No newline at end of file
+>        order=(asc|desc)     Ascending or descending sort order (default is descending).
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/teardown.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/teardown.md b/docs/endpoints/master/teardown.md
index f68d083..9b62b26 100644
--- a/docs/endpoints/master/teardown.md
+++ b/docs/endpoints/master/teardown.md
@@ -14,4 +14,9 @@ Tears down a running framework by shutting down all tasks/executors and removing
 ### DESCRIPTION ###
 Please provide a "frameworkId" value designating the running
 framework to tear down.
-Returns 200 OK if the framework was correctly teared down.
\ No newline at end of file
+Returns 200 OK if the framework was correctly teared down.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/unreserve.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/unreserve.md b/docs/endpoints/master/unreserve.md
index e059d8d..b9282df 100644
--- a/docs/endpoints/master/unreserve.md
+++ b/docs/endpoints/master/unreserve.md
@@ -17,4 +17,9 @@ imply that the requested resources have been unreserved successfully:
 resource unreservation is done asynchronously and may fail.
 
 Please provide "slaveId" and "resources" values designating
-the resources to be unreserved.
\ No newline at end of file
+the resources to be unreserved.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/53c0588e/docs/endpoints/master/weights.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/weights.md b/docs/endpoints/master/weights.md
index 632be24..7c45173 100644
--- a/docs/endpoints/master/weights.md
+++ b/docs/endpoints/master/weights.md
@@ -13,4 +13,9 @@ Updates weights for the specified roles.
 
 ### DESCRIPTION ###
 PUT: Validates the request body as JSON
-and updates the weights for the specified roles.
\ No newline at end of file
+and updates the weights for the specified roles.
+
+
+### AUTHENTICATION ###
+This endpoint requires authentication iff HTTP authentication is
+enabled.
\ No newline at end of file


[2/3] mesos git commit: Added authentication information to master endpoints.

Posted by me...@apache.org.
Added authentication information to master endpoints.

Master endpoints now display information whether authentication
(if enabled) is required in HELP.

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


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

Branch: refs/heads/master
Commit: cbbb46c14adc85c003848b9be4f6e13f6e207e47
Parents: 84fcc1d
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 18 03:27:31 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Fri Mar 18 14:31:20 2016 -0700

----------------------------------------------------------------------
 src/master/http.cpp | 71 ++++++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cbbb46c1/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index b47ab7c..bfea8fa 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -74,6 +74,7 @@
 
 using google::protobuf::RepeatedPtrField;
 
+using process::AUTHENTICATION;
 using process::Clock;
 using process::DESCRIPTION;
 using process::Future;
@@ -326,9 +327,10 @@ string Master::Http::SCHEDULER_HELP()
 {
   return HELP(
     TLDR(
-        "Endpoint for schedulers to make Calls against the master."),
+        "Endpoint for schedulers to make calls against the master."),
     DESCRIPTION(
-        "Returns 202 Accepted iff the request is accepted."));
+        "Returns 202 Accepted iff the request is accepted."),
+    AUTHENTICATION(false));
 }
 
 
@@ -541,7 +543,8 @@ string Master::Http::CREATE_VOLUMES_HELP()
         "creation is done asynchronously and may fail.",
         "",
         "Please provide \"slaveId\" and \"volumes\" values designating",
-        "the volumes to be created."));
+        "the volumes to be created."),
+    AUTHENTICATION(true));
 }
 
 
@@ -648,7 +651,8 @@ string Master::Http::DESTROY_VOLUMES_HELP()
         "destruction is done asynchronously and may fail.",
         "",
         "Please provide \"slaveId\" and \"volumes\" values designating",
-        "the volumes to be destroyed."));
+        "the volumes to be destroyed."),
+    AUTHENTICATION(true));
 }
 
 
@@ -730,7 +734,9 @@ Future<Response> Master::Http::destroyVolumes(
 
 string Master::Http::FRAMEWORKS_HELP()
 {
-  return HELP(TLDR("Exposes the frameworks info."));
+  return HELP(
+    TLDR("Exposes the frameworks info."),
+    AUTHENTICATION(true));
 }
 
 
@@ -774,7 +780,9 @@ Future<Response> Master::Http::frameworks(
 
 string Master::Http::FLAGS_HELP()
 {
-  return HELP(TLDR("Exposes the master's flag configuration."));
+  return HELP(
+    TLDR("Exposes the master's flag configuration."),
+    AUTHENTICATION(true));
 }
 
 
@@ -806,7 +814,8 @@ string Master::Http::HEALTH_HELP()
         "Health check of the Master."),
     DESCRIPTION(
         "Returns 200 OK iff the Master is healthy.",
-        "Delayed responses are also indicative of poor health."));
+        "Delayed responses are also indicative of poor health."),
+    AUTHENTICATION(false));
 }
 
 
@@ -831,7 +840,8 @@ string Master::Http::OBSERVE_HELP()
         "The following fields should be supplied in a POST:",
         "1. " + MONITOR_KEY + " - name of the monitor that is being reported",
         "2. " + HOSTS_KEY + " - comma separated list of hosts",
-        "3. " + LEVEL_KEY + " - OK for healthy, anything else for unhealthy"));
+        "3. " + LEVEL_KEY + " - OK for healthy, anything else for unhealthy"),
+    AUTHENTICATION(true));
 }
 
 Try<string> getFormValue(
@@ -928,7 +938,8 @@ string Master::Http::REDIRECT_HELP()
         "running multiple Masters.",
         "2. This is broken currently \"on the cloud\" (e.g. EC2) as",
         "this will attempt to redirect to the private IP address, unless",
-        "advertise_ip points to an externally accessible IP"));
+        "advertise_ip points to an externally accessible IP"),
+    AUTHENTICATION(false));
 }
 
 
@@ -971,7 +982,8 @@ string Master::Http::RESERVE_HELP()
         "resource reservation is done asynchronously and may fail.",
         "",
         "Please provide \"slaveId\" and \"resources\" values designating",
-        "the resources to be reserved."));
+        "the resources to be reserved."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1062,7 +1074,8 @@ string Master::Http::SLAVES_HELP()
         "Information about registered slaves."),
     DESCRIPTION(
         "This endpoint shows information about the slaves registered in",
-        "this master formatted as a JSON object."));
+        "this master formatted as a JSON object."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1135,7 +1148,8 @@ string Master::Http::QUOTA_HELP()
         "Sets quota for a role."),
     DESCRIPTION(
         "POST: Validates the request body as JSON",
-        " and sets quota for a role."));
+        " and sets quota for a role."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1172,7 +1186,8 @@ string Master::Http::WEIGHTS_HELP()
         "Updates weights for the specified roles."),
     DESCRIPTION(
         "PUT: Validates the request body as JSON",
-        "and updates the weights for the specified roles."));
+        "and updates the weights for the specified roles."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1272,7 +1287,8 @@ string Master::Http::STATE_HELP()
         "    \"orphan_tasks\" : [],",
         "    \"unregistered_frameworks\" : []",
         "}",
-        "```"));
+        "```"),
+    AUTHENTICATION(true));
 }
 
 
@@ -1547,7 +1563,8 @@ string Master::Http::STATESUMMARY_HELP()
         "Summary of state of all tasks and registered frameworks in cluster."),
     DESCRIPTION(
         "This endpoint gives a summary of the state of all tasks and",
-        "registered frameworks in the cluster as a JSON object."));
+        "registered frameworks in the cluster as a JSON object."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1669,7 +1686,8 @@ string Master::Http::ROLES_HELP()
         "It returns information about every role that is on the role",
         "whitelist (if enabled), has one or more registered frameworks,",
         "or has a non-default weight or quota. For each role, it returns",
-        "the weight, total allocated resources, and registered frameworks."));
+        "the weight, total allocated resources, and registered frameworks."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1777,7 +1795,8 @@ string Master::Http::TEARDOWN_HELP()
     DESCRIPTION(
         "Please provide a \"frameworkId\" value designating the running",
         "framework to tear down.",
-        "Returns 200 OK if the framework was correctly teared down."));
+        "Returns 200 OK if the framework was correctly teared down."),
+    AUTHENTICATION(true));
 }
 
 
@@ -1870,7 +1889,8 @@ string Master::Http::TASKS_HELP()
       ">        offset=VALUE         Starts task list at offset.",
       ">        order=(asc|desc)     Ascending or descending sort order "
       "(default is descending)."
-      ""));
+      ""),
+    AUTHENTICATION(true));
 }
 
 
@@ -1987,7 +2007,8 @@ string Master::Http::MAINTENANCE_SCHEDULE_HELP()
         "GET: Returns the current maintenance schedule as JSON.",
         "",
         "POST: Validates the request body as JSON",
-        "  and updates the maintenance schedule."));
+        "  and updates the maintenance schedule."),
+    AUTHENTICATION(true));
 }
 
 
@@ -2124,7 +2145,8 @@ string Master::Http::MACHINE_DOWN_HELP()
     DESCRIPTION(
         "POST: Validates the request body as JSON and transitions",
         "  the list of machines into DOWN mode.  Currently, only",
-        "  machines in DRAINING mode are allowed to be brought down."));
+        "  machines in DRAINING mode are allowed to be brought down."),
+    AUTHENTICATION(true));
 }
 
 
@@ -2229,7 +2251,8 @@ string Master::Http::MACHINE_UP_HELP()
     DESCRIPTION(
         "POST: Validates the request body as JSON and transitions",
         "  the list of machines into UP mode.  This also removes",
-        "  the list of machines from the maintenance schedule."));
+        "  the list of machines from the maintenance schedule."),
+    AUTHENTICATION(true));
 }
 
 
@@ -2335,7 +2358,8 @@ string Master::Http::MAINTENANCE_STATUS_HELP()
         "For draining machines, this list includes the frameworks' responses",
         "to inverse offers.  NOTE: Inverse offer responses are cleared if",
         "the master fails over.  However, new inverse offers will be sent",
-        "once the master recovers."));
+        "once the master recovers."),
+    AUTHENTICATION(true));
 }
 
 
@@ -2414,7 +2438,8 @@ string Master::Http::UNRESERVE_HELP()
         "resource unreservation is done asynchronously and may fail.",
         "",
         "Please provide \"slaveId\" and \"resources\" values designating",
-        "the resources to be unreserved."));
+        "the resources to be unreserved."),
+    AUTHENTICATION(true));
 }
 
 


[3/3] mesos git commit: Enabled Authentication information in endpoint HELP.

Posted by me...@apache.org.
Enabled Authentication information in endpoint HELP.

Enabled endpoint HELP string to display information about
authentication requirements.

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


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

Branch: refs/heads/master
Commit: 84fcc1de23e00bd2afe5daaa0a0c915277720c65
Parents: 630b12a
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Fri Mar 18 03:27:01 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Fri Mar 18 14:31:20 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/help.hpp | 18 ++++++++++++++++--
 3rdparty/libprocess/src/help.cpp             |  8 ++++++++
 3rdparty/libprocess/src/logging.cpp          |  1 +
 3 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/include/process/help.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/help.hpp b/3rdparty/libprocess/include/process/help.hpp
index 783304e..3f85980 100644
--- a/3rdparty/libprocess/include/process/help.hpp
+++ b/3rdparty/libprocess/include/process/help.hpp
@@ -40,13 +40,17 @@ namespace process {
 //     ### DESCRIPTION ###
 //     description
 //
+//     ### AUTHENTICATION ###
+//     authentication requirements
+//
 //     references
 //
-// See the 'USAGE', 'TLDR', 'DESCRIPTION', and 'REFERENCES' helpers
-// below to more easily construct your help pages.
+// See the 'USAGE', 'TLDR', 'DESCRIPTION', 'AUTHENTICATION', and
+// 'REFERENCES' helpers below to more easily construct your help pages.
 std::string HELP(
     const std::string& tldr,
     const Option<std::string>& description = None(),
+    const Option<std::string>& authentication = None(),
     const Option<std::string>& references = None());
 
 // Helper for single-line usage that puts it in a blockquote as code
@@ -70,6 +74,16 @@ inline std::string DESCRIPTION(T&&... args)
   return strings::join("\n", std::forward<T>(args)..., "\n");
 }
 
+// Helper for description of Authentication requirements.
+inline std::string AUTHENTICATION(bool required)
+{
+  if (required) {
+    return "This endpoint requires authentication iff HTTP authentication is\n"
+           "enabled.\n";
+  }
+  return "This endpoint does not require authentication.\n";
+}
+
 
 template <typename... T>
 inline std::string REFERENCES(T&&... args)

http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/src/help.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/help.cpp b/3rdparty/libprocess/src/help.cpp
index 5f36880..e046933 100644
--- a/3rdparty/libprocess/src/help.cpp
+++ b/3rdparty/libprocess/src/help.cpp
@@ -40,6 +40,7 @@ namespace process {
 string HELP(
     const string& tldr,
     const Option<string>& description,
+    const Option<string>& authentication,
     const Option<string>& references)
 {
   // Construct the help string.
@@ -58,6 +59,13 @@ string HELP(
       description.get();
   }
 
+  if (authentication.isSome()) {
+    help +=
+      "\n"
+      "### AUTHENTICATION ###\n" +
+      authentication.get();
+  }
+
   if (!strings::endsWith(help, "\n")) {
     help += "\n";
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/84fcc1de/3rdparty/libprocess/src/logging.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/logging.cpp b/3rdparty/libprocess/src/logging.cpp
index 015a43d..bdbf716 100644
--- a/3rdparty/libprocess/src/logging.cpp
+++ b/3rdparty/libprocess/src/logging.cpp
@@ -92,6 +92,7 @@ const std::string Logging::TOGGLE_HELP()
         ">        level=VALUE          Verbosity level (e.g., 1, 2, 3)",
         ">        duration=VALUE       Duration to keep verbosity level",
         ">                             toggled (e.g., 10secs, 15mins, etc.)"),
+    None(),
     REFERENCES(
         "[glog]: https://code.google.com/p/google-glog"));
 }