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

[1/8] mesos git commit: Added documentation for all http endpoints.

Repository: mesos
Updated Branches:
  refs/heads/master 32487ac8e -> 6585238e9


Added documentation for all http endpoints.

These .md files were auto generated using
support/generate-endpoints-help.py.

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


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

Branch: refs/heads/master
Commit: cbc7b60448715c28b06ffcf05ba2de56eb792630
Parents: 30042c4
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 20:26:50 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 docs/endpoints/files/browse.json.md           |  14 +++
 docs/endpoints/files/browse.md                |  14 +++
 docs/endpoints/files/debug.json.md            |  10 ++
 docs/endpoints/files/debug.md                 |  10 ++
 docs/endpoints/files/download.json.md         |  14 +++
 docs/endpoints/files/download.md              |  14 +++
 docs/endpoints/files/read.json.md             |  15 +++
 docs/endpoints/files/read.md                  |  15 +++
 docs/endpoints/index.md                       | 118 +++++++++++++++++++++
 docs/endpoints/logging/toggle.md              |  23 ++++
 docs/endpoints/master/api/v1/scheduler.md     |   9 ++
 docs/endpoints/master/create-volumes.md       |  11 ++
 docs/endpoints/master/destroy-volumes.md      |  11 ++
 docs/endpoints/master/flags.md                |   6 ++
 docs/endpoints/master/frameworks.md           |   6 ++
 docs/endpoints/master/health.md               |  10 ++
 docs/endpoints/master/machine/down.md         |  11 ++
 docs/endpoints/master/machine/up.md           |  11 ++
 docs/endpoints/master/maintenance/schedule.md |  11 ++
 docs/endpoints/master/maintenance/status.md   |  13 +++
 docs/endpoints/master/observe.md              |  14 +++
 docs/endpoints/master/quota.md                |  10 ++
 docs/endpoints/master/redirect.md             |  18 ++++
 docs/endpoints/master/reserve.md              |  11 ++
 docs/endpoints/master/roles.json.md           |   9 ++
 docs/endpoints/master/roles.md                |   9 ++
 docs/endpoints/master/slaves.md               |  10 ++
 docs/endpoints/master/state-summary.md        |  10 ++
 docs/endpoints/master/state.json.md           |  10 ++
 docs/endpoints/master/state.md                |  10 ++
 docs/endpoints/master/tasks.json.md           |  15 +++
 docs/endpoints/master/tasks.md                |  15 +++
 docs/endpoints/master/teardown.md             |  11 ++
 docs/endpoints/master/unreserve.md            |  11 ++
 docs/endpoints/metrics/snapshot.md            |  16 +++
 docs/endpoints/monitor/statistics.json.md     |  36 +++++++
 docs/endpoints/monitor/statistics.md          |  36 +++++++
 docs/endpoints/profiler/start.md              |   9 ++
 docs/endpoints/profiler/stop.md               |   9 ++
 docs/endpoints/registrar/registry.md          |  53 +++++++++
 docs/endpoints/slave/api/v1/executor.md       |  16 +++
 docs/endpoints/slave/flags.md                 |   6 ++
 docs/endpoints/slave/health.md                |  10 ++
 docs/endpoints/slave/state.json.md            |  10 ++
 docs/endpoints/slave/state.md                 |  10 ++
 docs/endpoints/system/stats.json.md           |  14 +++
 docs/endpoints/version.md                     |  21 ++++
 47 files changed, 755 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/browse.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/browse.json.md b/docs/endpoints/files/browse.json.md
new file mode 100644
index 0000000..1e14d3e
--- /dev/null
+++ b/docs/endpoints/files/browse.json.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/browse.json
+
+### TL;DR; ###
+Returns a file listing for a directory.
+
+### DESCRIPTION ###
+Lists files and directories contained in the path as
+a JSON object.
+
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/browse.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/browse.md b/docs/endpoints/files/browse.md
new file mode 100644
index 0000000..f249fe3
--- /dev/null
+++ b/docs/endpoints/files/browse.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/browse
+
+### TL;DR; ###
+Returns a file listing for a directory.
+
+### DESCRIPTION ###
+Lists files and directories contained in the path as
+a JSON object.
+
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/debug.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/debug.json.md b/docs/endpoints/files/debug.json.md
new file mode 100644
index 0000000..d4eff9a
--- /dev/null
+++ b/docs/endpoints/files/debug.json.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/debug.json
+
+### TL;DR; ###
+Returns the internal virtual path mapping.
+
+### DESCRIPTION ###
+This endpoint shows the internal virtual path map as a
+JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/debug.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/debug.md b/docs/endpoints/files/debug.md
new file mode 100644
index 0000000..b303583
--- /dev/null
+++ b/docs/endpoints/files/debug.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/debug
+
+### TL;DR; ###
+Returns the internal virtual path mapping.
+
+### DESCRIPTION ###
+This endpoint shows the internal virtual path map as a
+JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/download.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/download.json.md b/docs/endpoints/files/download.json.md
new file mode 100644
index 0000000..a801c64
--- /dev/null
+++ b/docs/endpoints/files/download.json.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/download.json
+
+### TL;DR; ###
+Returns the raw file contents for a given path.
+
+### DESCRIPTION ###
+This endpoint will return the raw file contents for the
+given path.
+
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/download.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/download.md b/docs/endpoints/files/download.md
new file mode 100644
index 0000000..f669708
--- /dev/null
+++ b/docs/endpoints/files/download.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/download
+
+### TL;DR; ###
+Returns the raw file contents for a given path.
+
+### DESCRIPTION ###
+This endpoint will return the raw file contents for the
+given path.
+
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/read.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/read.json.md b/docs/endpoints/files/read.json.md
new file mode 100644
index 0000000..9382937
--- /dev/null
+++ b/docs/endpoints/files/read.json.md
@@ -0,0 +1,15 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/read.json
+
+### TL;DR; ###
+Reads data from a file.
+
+### DESCRIPTION ###
+This endpoint reads data from a file at a given offset and for
+a given length.
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
+>        offset=VALUE        Value added to base address to obtain a second address
+>        length=VALUE        Length of file to read.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/files/read.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/files/read.md b/docs/endpoints/files/read.md
new file mode 100644
index 0000000..c5ba6bd
--- /dev/null
+++ b/docs/endpoints/files/read.md
@@ -0,0 +1,15 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /files/read
+
+### TL;DR; ###
+Reads data from a file.
+
+### DESCRIPTION ###
+This endpoint reads data from a file at a given offset and for
+a given length.
+Query parameters:
+
+>        path=VALUE          The path of directory to browse.
+>        offset=VALUE        Value added to base address to obtain a second address
+>        length=VALUE        Length of file to read.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/index.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/index.md b/docs/endpoints/index.md
new file mode 100644
index 0000000..f702ff5
--- /dev/null
+++ b/docs/endpoints/index.md
@@ -0,0 +1,118 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+
+# HTTP Endpoints #
+
+Below is a list of HTTP endpoints available for a given Mesos process.
+The documentation for these endpoints is auto-generated from strings
+stored in the Mesos source code.
+
+Depending on your configuration, some subset of these endpoints will
+be available on your Mesos master or agent. Additionally, a '/help'
+endpoint will be available that displays help similar to what you see
+below.
+
+## Master Endpoints ##
+
+Below is a set of endpoints available on a Mesos master. These
+endpoints are reachable at the address http://ip:port/endpoint.
+
+For example, http://master.mesosphere.com:5050/files/browse
+
+### files ###
+* [/files/browse](files/browse.md)
+* [/files/browse.json](files/browse.json.md)
+* [/files/debug](files/debug.md)
+* [/files/debug.json](files/debug.json.md)
+* [/files/download](files/download.md)
+* [/files/download.json](files/download.json.md)
+* [/files/read](files/read.md)
+* [/files/read.json](files/read.json.md)
+
+### logging ###
+* [/logging/toggle](logging/toggle.md)
+
+### master ###
+* [/master/api/v1/scheduler](master/api/v1/scheduler.md)
+* [/master/create-volumes](master/create-volumes.md)
+* [/master/destroy-volumes](master/destroy-volumes.md)
+* [/master/flags](master/flags.md)
+* [/master/frameworks](master/frameworks.md)
+* [/master/health](master/health.md)
+* [/master/machine/down](master/machine/down.md)
+* [/master/machine/up](master/machine/up.md)
+* [/master/maintenance/schedule](master/maintenance/schedule.md)
+* [/master/maintenance/status](master/maintenance/status.md)
+* [/master/observe](master/observe.md)
+* [/master/quota](master/quota.md)
+* [/master/redirect](master/redirect.md)
+* [/master/reserve](master/reserve.md)
+* [/master/roles](master/roles.md)
+* [/master/roles.json](master/roles.json.md)
+* [/master/slaves](master/slaves.md)
+* [/master/state](master/state.md)
+* [/master/state-summary](master/state-summary.md)
+* [/master/state.json](master/state.json.md)
+* [/master/tasks](master/tasks.md)
+* [/master/tasks.json](master/tasks.json.md)
+* [/master/teardown](master/teardown.md)
+* [/master/unreserve](master/unreserve.md)
+
+### metrics ###
+* [/metrics/snapshot](metrics/snapshot.md)
+
+### profiler ###
+* [/profiler/start](profiler/start.md)
+* [/profiler/stop](profiler/stop.md)
+
+### registrar(id) ###
+* [/registrar(id)/registry](registrar/registry.md)
+
+### system ###
+* [/system/stats.json](system/stats.json.md)
+
+### version ###
+* [/version](version.md)
+
+## Agent Endpoints ##
+
+Below is a set of endpoints available on a Mesos agent. These
+endpoints are reachable at the address http://ip:port/endpoint.
+
+For example, http://agent.mesosphere.com:5051/files/browse
+
+### files ###
+* [/files/browse](files/browse.md)
+* [/files/browse.json](files/browse.json.md)
+* [/files/debug](files/debug.md)
+* [/files/debug.json](files/debug.json.md)
+* [/files/download](files/download.md)
+* [/files/download.json](files/download.json.md)
+* [/files/read](files/read.md)
+* [/files/read.json](files/read.json.md)
+
+### logging ###
+* [/logging/toggle](logging/toggle.md)
+
+### metrics ###
+* [/metrics/snapshot](metrics/snapshot.md)
+
+### monitor ###
+* [/monitor/statistics](monitor/statistics.md)
+* [/monitor/statistics.json](monitor/statistics.json.md)
+
+### profiler ###
+* [/profiler/start](profiler/start.md)
+* [/profiler/stop](profiler/stop.md)
+
+### slave(id) ###
+* [/slave(id)/api/v1/executor](slave/api/v1/executor.md)
+* [/slave(id)/flags](slave/flags.md)
+* [/slave(id)/health](slave/health.md)
+* [/slave(id)/state](slave/state.md)
+* [/slave(id)/state.json](slave/state.json.md)
+
+### system ###
+* [/system/stats.json](system/stats.json.md)
+
+### version ###
+* [/version](version.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/logging/toggle.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/logging/toggle.md b/docs/endpoints/logging/toggle.md
new file mode 100644
index 0000000..c051788
--- /dev/null
+++ b/docs/endpoints/logging/toggle.md
@@ -0,0 +1,23 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /logging/toggle
+
+### TL;DR; ###
+Sets the logging verbosity level for a specified duration.
+
+### DESCRIPTION ###
+The libprocess library uses [glog][glog] for logging. The library
+only uses verbose logging which means nothing will be output unless
+the verbosity level is set (by default it's 0, libprocess useslevels 1, 2, and 3).
+
+**NOTE:** If your application uses glog this will also affect
+your verbose logging.
+
+Query parameters:
+
+>        level=VALUE          Verbosity level (e.g., 1, 2, 3)
+>        duration=VALUE       Duration to keep verbosity level
+>                             toggled (e.g., 10secs, 15mins, etc.)
+
+
+[glog]: https://code.google.com/p/google-glog
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/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
new file mode 100644
index 0000000..72186e4
--- /dev/null
+++ b/docs/endpoints/master/api/v1/scheduler.md
@@ -0,0 +1,9 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/api/v1/scheduler
+
+### TL;DR; ###
+Endpoint for schedulers to make Calls against the master.
+
+### DESCRIPTION ###
+Returns 202 Accepted iff the request is accepted.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/create-volumes.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/create-volumes.md b/docs/endpoints/master/create-volumes.md
new file mode 100644
index 0000000..779662d
--- /dev/null
+++ b/docs/endpoints/master/create-volumes.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/create-volumes
+
+### TL;DR; ###
+Create persistent volumes on reserved resources.
+
+### DESCRIPTION ###
+Returns 200 OK if volume creation was successful.
+Please provide "slaveId" and "volumes" values designating
+the volumes to be created.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/destroy-volumes.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/destroy-volumes.md b/docs/endpoints/master/destroy-volumes.md
new file mode 100644
index 0000000..104dd75
--- /dev/null
+++ b/docs/endpoints/master/destroy-volumes.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/destroy-volumes
+
+### TL;DR; ###
+Destroy persistent volumes.
+
+### DESCRIPTION ###
+Returns 200 OK if volume deletion was successful.
+Please provide "slaveId" and "volumes" values designating
+the volumes to be destroyed.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/flags.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/flags.md b/docs/endpoints/master/flags.md
new file mode 100644
index 0000000..0f066b8
--- /dev/null
+++ b/docs/endpoints/master/flags.md
@@ -0,0 +1,6 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/flags
+
+### TL;DR; ###
+Exposes the master's flag configuration.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/frameworks.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/frameworks.md b/docs/endpoints/master/frameworks.md
new file mode 100644
index 0000000..bce7c29
--- /dev/null
+++ b/docs/endpoints/master/frameworks.md
@@ -0,0 +1,6 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/frameworks
+
+### TL;DR; ###
+Exposes the frameworks info.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/health.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/health.md b/docs/endpoints/master/health.md
new file mode 100644
index 0000000..c4f436f
--- /dev/null
+++ b/docs/endpoints/master/health.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/health
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/machine/down.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/machine/down.md b/docs/endpoints/master/machine/down.md
new file mode 100644
index 0000000..3c9e9d8
--- /dev/null
+++ b/docs/endpoints/master/machine/down.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/machine/down
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/machine/up.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/machine/up.md b/docs/endpoints/master/machine/up.md
new file mode 100644
index 0000000..005655c
--- /dev/null
+++ b/docs/endpoints/master/machine/up.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/machine/up
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/maintenance/schedule.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/maintenance/schedule.md b/docs/endpoints/master/maintenance/schedule.md
new file mode 100644
index 0000000..882019f
--- /dev/null
+++ b/docs/endpoints/master/maintenance/schedule.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/maintenance/schedule
+
+### TL;DR; ###
+Returns or updates the cluster's maintenance schedule.
+
+### DESCRIPTION ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/maintenance/status.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/maintenance/status.md b/docs/endpoints/master/maintenance/status.md
new file mode 100644
index 0000000..edb2a18
--- /dev/null
+++ b/docs/endpoints/master/maintenance/status.md
@@ -0,0 +1,13 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/maintenance/status
+
+### TL;DR; ###
+Retrieves the maintenance status of the cluster.
+
+### DESCRIPTION ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/observe.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/observe.md b/docs/endpoints/master/observe.md
new file mode 100644
index 0000000..c474c49
--- /dev/null
+++ b/docs/endpoints/master/observe.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/observe
+
+### TL;DR; ###
+Observe a monitor health state for host(s).
+
+### DESCRIPTION ###
+This endpoint receives information indicating host(s)
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/quota.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/quota.md b/docs/endpoints/master/quota.md
new file mode 100644
index 0000000..0084a4c
--- /dev/null
+++ b/docs/endpoints/master/quota.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/quota
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/redirect.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/redirect.md b/docs/endpoints/master/redirect.md
new file mode 100644
index 0000000..3e91d32
--- /dev/null
+++ b/docs/endpoints/master/redirect.md
@@ -0,0 +1,18 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/redirect
+
+### TL;DR; ###
+Redirects to the leading Master.
+
+### DESCRIPTION ###
+This returns a 307 Temporary Redirect to the leading Master.
+If no Master is leading (according to this Master), then the
+Master will redirect to itself.
+
+**NOTES:**
+1. This is the recommended way to bookmark the WebUI when
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/reserve.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/reserve.md b/docs/endpoints/master/reserve.md
new file mode 100644
index 0000000..ed16f73
--- /dev/null
+++ b/docs/endpoints/master/reserve.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/reserve
+
+### TL;DR; ###
+Reserve resources dynamically on a specific slave.
+
+### DESCRIPTION ###
+Returns 200 OK if resource reservation was successful.
+Please provide "slaveId" and "resources" values designating
+the resources to be reserved.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/roles.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/roles.json.md b/docs/endpoints/master/roles.json.md
new file mode 100644
index 0000000..fd6503b
--- /dev/null
+++ b/docs/endpoints/master/roles.json.md
@@ -0,0 +1,9 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/roles.json
+
+### TL;DR; ###
+Information about roles.
+
+### DESCRIPTION ###
+This endpoint provides information about roles as a JSON object.It returns information about every role that is on the rolewhitelist (if enabled), has one or more registered frameworks,or has a non-default weight or quota. For each role, it returnsthe weight, total allocated resources, and registered frameworks.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/roles.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/roles.md b/docs/endpoints/master/roles.md
new file mode 100644
index 0000000..ae37562
--- /dev/null
+++ b/docs/endpoints/master/roles.md
@@ -0,0 +1,9 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/roles
+
+### TL;DR; ###
+Information about roles.
+
+### DESCRIPTION ###
+This endpoint provides information about roles as a JSON object.It returns information about every role that is on the rolewhitelist (if enabled), has one or more registered frameworks,or has a non-default weight or quota. For each role, it returnsthe weight, total allocated resources, and registered frameworks.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/slaves.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/slaves.md b/docs/endpoints/master/slaves.md
new file mode 100644
index 0000000..7ca6f72
--- /dev/null
+++ b/docs/endpoints/master/slaves.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/slaves
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/state-summary.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state-summary.md b/docs/endpoints/master/state-summary.md
new file mode 100644
index 0000000..03aa655
--- /dev/null
+++ b/docs/endpoints/master/state-summary.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/state-summary
+
+### TL;DR; ###
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/state.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state.json.md b/docs/endpoints/master/state.json.md
new file mode 100644
index 0000000..164a0ba
--- /dev/null
+++ b/docs/endpoints/master/state.json.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/state.json
+
+### TL;DR; ###
+Information about state of master.
+
+### DESCRIPTION ###
+This endpoint shows information about the frameworks, tasks,
+executors and slaves running in the cluster as a JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/state.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/state.md b/docs/endpoints/master/state.md
new file mode 100644
index 0000000..e9225da
--- /dev/null
+++ b/docs/endpoints/master/state.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/state
+
+### TL;DR; ###
+Information about state of master.
+
+### DESCRIPTION ###
+This endpoint shows information about the frameworks, tasks,
+executors and slaves running in the cluster as a JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/tasks.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/tasks.json.md b/docs/endpoints/master/tasks.json.md
new file mode 100644
index 0000000..3db0426
--- /dev/null
+++ b/docs/endpoints/master/tasks.json.md
@@ -0,0 +1,15 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/tasks.json
+
+### TL;DR; ###
+Lists tasks from all active frameworks.
+
+### DESCRIPTION ###
+Lists known tasks.
+
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/tasks.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/tasks.md b/docs/endpoints/master/tasks.md
new file mode 100644
index 0000000..8654bf7
--- /dev/null
+++ b/docs/endpoints/master/tasks.md
@@ -0,0 +1,15 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/tasks
+
+### TL;DR; ###
+Lists tasks from all active frameworks.
+
+### DESCRIPTION ###
+Lists known tasks.
+
+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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/teardown.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/teardown.md b/docs/endpoints/master/teardown.md
new file mode 100644
index 0000000..151d55f
--- /dev/null
+++ b/docs/endpoints/master/teardown.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/teardown
+
+### TL;DR; ###
+Tears down a running framework by shutting down all tasks/executors and removing the framework.
+
+### 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

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/master/unreserve.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/master/unreserve.md b/docs/endpoints/master/unreserve.md
new file mode 100644
index 0000000..9a4925e
--- /dev/null
+++ b/docs/endpoints/master/unreserve.md
@@ -0,0 +1,11 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /master/unreserve
+
+### TL;DR; ###
+Unreserve resources dynamically on a specific slave.
+
+### DESCRIPTION ###
+Returns 200 OK if resource unreservation was successful.
+Please provide "slaveId" and "resources" values designating
+the resources to be unreserved.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/metrics/snapshot.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/metrics/snapshot.md b/docs/endpoints/metrics/snapshot.md
new file mode 100644
index 0000000..62f5f0f
--- /dev/null
+++ b/docs/endpoints/metrics/snapshot.md
@@ -0,0 +1,16 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /metrics/snapshot
+
+### TL;DR; ###
+Provides a snapshot of the current metrics.
+
+### DESCRIPTION ###
+This endpoint provides information regarding the current metrics
+tracked by the system.
+
+The optional query parameter 'timeout' determines the maximum
+amount of time the endpoint will take to respond. If the timeout
+is exceeded, some metrics may not be included in the response.
+
+The key is the metric name, and the value is a double-type.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/monitor/statistics.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/monitor/statistics.json.md b/docs/endpoints/monitor/statistics.json.md
new file mode 100644
index 0000000..06d5e73
--- /dev/null
+++ b/docs/endpoints/monitor/statistics.json.md
@@ -0,0 +1,36 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /monitor/statistics.json
+
+### TL;DR; ###
+Retrieve resource monitoring information.
+
+### DESCRIPTION ###
+Returns the current resource consumption data for containers
+running under this slave.
+
+Example:
+
+```
+[{
+    "executor_id":"executor",
+    "executor_name":"name",
+    "framework_id":"framework",
+    "source":"source",
+    "statistics":
+    {
+        "cpus_limit":8.25,
+        "cpus_nr_periods":769021,
+        "cpus_nr_throttled":1046,
+        "cpus_system_time_secs":34501.45,
+        "cpus_throttled_time_secs":352.597023453,
+        "cpus_user_time_secs":96348.84,
+        "mem_anon_bytes":4845449216,
+        "mem_file_bytes":260165632,
+        "mem_limit_bytes":7650410496,
+        "mem_mapped_file_bytes":7159808,
+        "mem_rss_bytes":5105614848,
+        "timestamp":1388534400.0
+    }
+}]
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/monitor/statistics.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/monitor/statistics.md b/docs/endpoints/monitor/statistics.md
new file mode 100644
index 0000000..c5cade3
--- /dev/null
+++ b/docs/endpoints/monitor/statistics.md
@@ -0,0 +1,36 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /monitor/statistics
+
+### TL;DR; ###
+Retrieve resource monitoring information.
+
+### DESCRIPTION ###
+Returns the current resource consumption data for containers
+running under this slave.
+
+Example:
+
+```
+[{
+    "executor_id":"executor",
+    "executor_name":"name",
+    "framework_id":"framework",
+    "source":"source",
+    "statistics":
+    {
+        "cpus_limit":8.25,
+        "cpus_nr_periods":769021,
+        "cpus_nr_throttled":1046,
+        "cpus_system_time_secs":34501.45,
+        "cpus_throttled_time_secs":352.597023453,
+        "cpus_user_time_secs":96348.84,
+        "mem_anon_bytes":4845449216,
+        "mem_file_bytes":260165632,
+        "mem_limit_bytes":7650410496,
+        "mem_mapped_file_bytes":7159808,
+        "mem_rss_bytes":5105614848,
+        "timestamp":1388534400.0
+    }
+}]
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/profiler/start.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/profiler/start.md b/docs/endpoints/profiler/start.md
new file mode 100644
index 0000000..3d97be8
--- /dev/null
+++ b/docs/endpoints/profiler/start.md
@@ -0,0 +1,9 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /profiler/start
+
+### TL;DR; ###
+Start profiling.
+
+### DESCRIPTION ###
+Start to use google perftools do profiling.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/profiler/stop.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/profiler/stop.md b/docs/endpoints/profiler/stop.md
new file mode 100644
index 0000000..bc490af
--- /dev/null
+++ b/docs/endpoints/profiler/stop.md
@@ -0,0 +1,9 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /profiler/stop
+
+### TL;DR; ###
+Stops profiling.
+
+### DESCRIPTION ###
+Stop to use google perftools do profiling.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/registrar/registry.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/registrar/registry.md b/docs/endpoints/registrar/registry.md
new file mode 100644
index 0000000..3a262b1
--- /dev/null
+++ b/docs/endpoints/registrar/registry.md
@@ -0,0 +1,53 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /registrar(1)/registry
+
+### TL;DR; ###
+Returns the current contents of the Registry in JSON.
+
+### DESCRIPTION ###
+Example:
+
+```
+{
+  "master":
+  {
+    "info":
+    {
+      "hostname": "localhost",
+      "id": "20140325-235542-1740121354-5050-33357",
+      "ip": 2130706433,
+      "pid": "master@127.0.0.1:5050",
+      "port": 5050
+    }
+  },
+
+  "slaves":
+  {
+    "slaves":
+    [
+      {
+        "info":
+        {
+          "checkpoint": true,
+          "hostname": "localhost",
+          "id":
+          {
+            "value": "20140325-234618-1740121354-5050-29065-0"
+          },
+          "port": 5051,
+          "resources":
+          [
+            {
+              "name": "cpus",
+              "role": "*",
+              "scalar": { "value": 24 },
+              "type": "SCALAR"
+            }
+          ],
+        }
+      }
+    ]
+  }
+}
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/slave/api/v1/executor.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/slave/api/v1/executor.md b/docs/endpoints/slave/api/v1/executor.md
new file mode 100644
index 0000000..a9318e4
--- /dev/null
+++ b/docs/endpoints/slave/api/v1/executor.md
@@ -0,0 +1,16 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /slave(1)/api/v1/executor
+
+### TL;DR; ###
+Endpoint for the Executor HTTP API.
+
+### DESCRIPTION ###
+This endpoint is used by the executors to interact with the
+agent via Call/Event messages.
+Returns 200 OK iff the initial SUBSCRIBE Call is successful.
+This would result in a streaming response via chunked
+transfer encoding. The executors can process the response
+incrementally.
+Returns 202 Accepted for all other Call messages iff the
+request is accepted.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/slave/flags.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/slave/flags.md b/docs/endpoints/slave/flags.md
new file mode 100644
index 0000000..7e459b3
--- /dev/null
+++ b/docs/endpoints/slave/flags.md
@@ -0,0 +1,6 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /slave(1)/flags
+
+### TL;DR; ###
+Exposes the agent's flag configuration.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/slave/health.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/slave/health.md b/docs/endpoints/slave/health.md
new file mode 100644
index 0000000..51045e9
--- /dev/null
+++ b/docs/endpoints/slave/health.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /slave(1)/health
+
+### TL;DR; ###
+Health check of the Slave.
+
+### DESCRIPTION ###
+Returns 200 OK iff the Slave is healthy.
+Delayed responses are also indicative of poor health.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/slave/state.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/slave/state.json.md b/docs/endpoints/slave/state.json.md
new file mode 100644
index 0000000..338c8ab
--- /dev/null
+++ b/docs/endpoints/slave/state.json.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /slave(1)/state.json
+
+### TL;DR; ###
+Information about state of the Slave.
+
+### DESCRIPTION ###
+This endpoint shows information about the frameworks, executors
+and the slave's master as a JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/slave/state.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/slave/state.md b/docs/endpoints/slave/state.md
new file mode 100644
index 0000000..8e6da6f
--- /dev/null
+++ b/docs/endpoints/slave/state.md
@@ -0,0 +1,10 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /slave(1)/state
+
+### TL;DR; ###
+Information about state of the Slave.
+
+### DESCRIPTION ###
+This endpoint shows information about the frameworks, executors
+and the slave's master as a JSON object.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/system/stats.json.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/system/stats.json.md b/docs/endpoints/system/stats.json.md
new file mode 100644
index 0000000..e1994c0
--- /dev/null
+++ b/docs/endpoints/system/stats.json.md
@@ -0,0 +1,14 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /system/stats.json
+
+### TL;DR; ###
+Shows local system metrics.
+
+### DESCRIPTION ###
+>        cpus_total          Total number of available CPUs
+>        load_1min           Average system load for last minute in uptime(1) style
+>        load_5min           Average system load for last 5 minutes in uptime(1) style
+>        load_15min          Average system load for last 15 minutes in uptime(1) style
+>        memory_total_bytes  Total system memory in bytes
+>        memory_free_bytes   Free system memory in bytes
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbc7b604/docs/endpoints/version.md
----------------------------------------------------------------------
diff --git a/docs/endpoints/version.md b/docs/endpoints/version.md
new file mode 100644
index 0000000..1166479
--- /dev/null
+++ b/docs/endpoints/version.md
@@ -0,0 +1,21 @@
+<!--- This is an automatically generated file. DO NOT EDIT! --->
+### USAGE ###
+>        /version
+
+### TL;DR; ###
+Provides version information.
+
+### DESCRIPTION ###
+Example:
+
+```
+{
+  "version":"0.26.0",
+  "build_user":"username",
+  "build_time":1443894750,
+  "build_date":"2015-10-04 01:52:30"
+  "git_branch":"branch",  // Optional
+  "git_tag":"0.26.0-rc1",  // Optional
+  "git_sha":"d31f096a4665650ad4b9eda372ac41d2c472a77c",  // Optional
+}
+```
\ No newline at end of file


[3/8] mesos git commit: Fixed endpoint help leak upon process termination.

Posted by bm...@apache.org.
Fixed endpoint help leak upon process termination.

Previously, the global help process would retain the help information
of processes even after they were termianted.

This commit adds code to remove these help strings.

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


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

Branch: refs/heads/master
Commit: 0f53c9a0bda98406b077d22f65c57f2877747754
Parents: 2eba6b1
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 19:22:41 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0f53c9a0/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 1672e08..4a53020 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -2628,6 +2628,9 @@ void ProcessManager::cleanup(ProcessBase* process)
     delete event;
   }
 
+  // Remove help strings for all installed routes for this process.
+  dispatch(help, &Help::remove, process->pid.id);
+
   // Possible gate non-libprocess threads are waiting at.
   Gate* gate = NULL;
 


[8/8] mesos git commit: Added link to HTTP Endpoints doc in home.md.

Posted by bm...@apache.org.
Added link to HTTP Endpoints doc in home.md.

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


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

Branch: refs/heads/master
Commit: 6585238e9ca657a61d73dcb704ea3951e032ef5b
Parents: b4600b9
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 20:30:33 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:18 2016 -0800

----------------------------------------------------------------------
 docs/home.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6585238e/docs/home.md
----------------------------------------------------------------------
diff --git a/docs/home.md b/docs/home.md
index dea6ec2..a2000a3 100644
--- a/docs/home.md
+++ b/docs/home.md
@@ -14,6 +14,7 @@ layout: documentation
 * [Getting Started](getting-started.md) for basic instructions on compiling and installing Mesos.
 * [Upgrades](upgrades.md) for upgrading a Mesos cluster.
 * [Configuration](configuration.md) for command-line arguments.
+* [HTTP Endpoints](endpoints/) for available HTTP endpoints.
 * [Containerizer](containerizer.md) for containerizer overview and use cases.
   * [Containerizer Internals](containerizer-internals.md) for implementation details of containerizers.
   * [Mesos Containerizer](mesos-containerizer.md) default containerizer, supports both Linux and POSIX systems.


[2/8] mesos git commit: Added json() function for jsonification of the global help process.

Posted by bm...@apache.org.
Added json() function for jsonification of the global help process.

This will be used to dump the help strings into a JSON object when
hitting the /help endpoint with a specific request for JSON data.

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


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

Branch: refs/heads/master
Commit: 24fff8758ff4aef93822eeb79f966f764ff306d8
Parents: 0f53c9a
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 19:24:32 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/help.hpp |  4 +++
 3rdparty/libprocess/src/help.cpp             | 39 +++++++++++++++++++++++
 2 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/24fff875/3rdparty/libprocess/include/process/help.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/help.hpp b/3rdparty/libprocess/include/process/help.hpp
index 414d14e..93306ad 100644
--- a/3rdparty/libprocess/include/process/help.hpp
+++ b/3rdparty/libprocess/include/process/help.hpp
@@ -103,6 +103,10 @@ public:
   // Remove all previously installed 'help' strings for '/id/*'.
   bool remove(const std::string& id);
 
+  // Allow the global json function to dump this object to its
+  // canonical JSON representation.
+  friend void json(JSON::ObjectWriter* writer, const Help& help);
+
 protected:
   virtual void initialize();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/24fff875/3rdparty/libprocess/src/help.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/help.cpp b/3rdparty/libprocess/src/help.cpp
index ec1c2d4..85d6bcb 100644
--- a/3rdparty/libprocess/src/help.cpp
+++ b/3rdparty/libprocess/src/help.cpp
@@ -16,6 +16,7 @@
 
 #include <process/help.hpp>
 
+#include <map>
 #include <string>
 #include <vector>
 
@@ -30,6 +31,7 @@
 #include <stout/stringify.hpp>
 #include <stout/strings.hpp>
 
+using std::map;
 using std::string;
 using std::vector;
 
@@ -128,6 +130,43 @@ void Help::initialize()
 }
 
 
+// Write the help strings contained in the help process to JSON.
+// The schema looks as follows:
+// {
+//   "processes":
+//   [
+//     {
+//       "id": id,
+//       "endpoints": [ { "name" : name, "text" : text }, ... ]
+//     },
+//     ...
+//   ]
+// }
+void json(JSON::ObjectWriter* writer, const Help& help)
+{
+  // We must declare this temporary typedef in order to make the
+  // foreachpair macro happy. Otherwise it interprets the ',' in the
+  // map definition to denote a new parameter in the macro invocation.
+  typedef map<string, string> StringStringMap;
+
+  writer->field("processes", [&help](JSON::ArrayWriter* writer) {
+    foreachpair (const string& id, const StringStringMap& names, help.helps) {
+      writer->element([&id, &names](JSON::ObjectWriter* writer) {
+        writer->field("id", id);
+        writer->field("endpoints", [&names](JSON::ArrayWriter* writer) {
+          foreachpair (const string& name, const string& text, names) {
+            writer->element([&name, &text](JSON::ObjectWriter* writer) {
+              writer->field("name", name);
+              writer->field("text", text);
+            });
+          }
+        });
+      });
+    }
+  });
+}
+
+
 Future<http::Response> Help::help(const http::Request& request)
 {
   // Split the path by '/'.


[5/8] mesos git commit: Added ability to return the /help endpoint as a JSON object.

Posted by bm...@apache.org.
Added ability to return the /help endpoint as a JSON object.

Previously, the /help endpoint could only be returned as either pure
markdown or html.

This commit introduces a query parameter: format=json to allow the
help endpoint to return a JSON object containing the help information
for all other endpoints.

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


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

Branch: refs/heads/master
Commit: b2cefc67afc436c38d09de017326e8de986fffe4
Parents: 24fff87
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 19:28:36 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/help.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b2cefc67/3rdparty/libprocess/src/help.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/help.cpp b/3rdparty/libprocess/src/help.cpp
index 85d6bcb..be3f7b7 100644
--- a/3rdparty/libprocess/src/help.cpp
+++ b/3rdparty/libprocess/src/help.cpp
@@ -188,6 +188,19 @@ Future<http::Response> Help::help(const http::Request& request)
   string references;
 
   if (id.isNone()) {             // http://ip:port/help
+    // If the request query string has format=json, return the JSON
+    // representation of the helps strings.
+    //
+    // NOTE: We avoided relying on the 'Accept' header to specify the
+    // format because if users are hitting the endpoint from a browser
+    // it is difficult to change the 'Accept' header.
+    //
+    // TODO(klueska): add the ability for all /help/* endpoints to be
+    // returned as json, not just /help.
+    if (request.url.query.get("format") == Some("json")) {
+      return http::OK(jsonify(*this));
+    }
+
     document += "## HELP\n";
     foreachkey (const string& id, helps) {
       document += "> [/" + id + "][" + id + "]\n";


[6/8] mesos git commit: Added remove() calls to process::Help.

Posted by bm...@apache.org.
Added remove() calls to process::Help.

Previously, there was no way to remove an installed help
string for a given endpoint.

This commit adds the ability to remove these help strings.

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


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

Branch: refs/heads/master
Commit: 2eba6b108eaa3704fa3699535166759a0c0d1963
Parents: 32487ac
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 19:21:54 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/help.hpp |  6 ++++++
 3rdparty/libprocess/src/help.cpp             | 23 ++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2eba6b10/3rdparty/libprocess/include/process/help.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/help.hpp b/3rdparty/libprocess/include/process/help.hpp
index 2e76a6a..414d14e 100644
--- a/3rdparty/libprocess/include/process/help.hpp
+++ b/3rdparty/libprocess/include/process/help.hpp
@@ -97,6 +97,12 @@ public:
            const std::string& name,
            const Option<std::string>& help);
 
+  // Remove a previously installed 'help' string for '/id/name'.
+  bool remove(const std::string& id, const std::string& name);
+
+  // Remove all previously installed 'help' strings for '/id/*'.
+  bool remove(const std::string& id);
+
 protected:
   virtual void initialize();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2eba6b10/3rdparty/libprocess/src/help.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/help.cpp b/3rdparty/libprocess/src/help.cpp
index 2f718b9..ec1c2d4 100644
--- a/3rdparty/libprocess/src/help.cpp
+++ b/3rdparty/libprocess/src/help.cpp
@@ -16,7 +16,6 @@
 
 #include <process/help.hpp>
 
-#include <map>
 #include <string>
 #include <vector>
 
@@ -101,6 +100,28 @@ void Help::add(
 }
 
 
+bool Help::remove(const string& id, const string& name)
+{
+  if (helps.count(id) == 0 || helps[id].count(name) == 0) {
+    return false;
+  }
+
+  helps[id].erase(name);
+
+  if (helps[id].empty()) {
+    helps.erase(id);
+  }
+
+  return true;
+}
+
+
+bool Help::remove(const string& id)
+{
+  return helps.erase(id) == 1;
+}
+
+
 void Help::initialize()
 {
   route("/", None(), &Help::help);


[7/8] mesos git commit: Updated Rakefile to support subdirectories in /docs folder.

Posted by bm...@apache.org.
Updated Rakefile to support subdirectories in /docs folder.

Previously, the Rakefile for generating the mesos documentation
website didn't support subdirectories containing markdown in the /docs
folder. Specifically, no subdirectores were cpoied from the /docs
folder into the site/documentation/latest folder for the website.
Moreover, the regex used to patch relative links for the markdown
files was incomplete. It didn't support subfolders contaning a
top level index.md file (e.g. mydirectory/index.md). Also, due to a
limitation in Middleman, it didn't support .md files named (e.g.
state.json.md). Middleman would generate an *html* file called
state.json from this instead of generating the standard
state.json/index.html like it does for other .md files.

This commit updates the Rakefile to support these features properly.

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


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

Branch: refs/heads/master
Commit: b4600b9d0323b2e2a0bffa2e92af738a9e124db2
Parents: cbc7b60
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 20:27:49 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:18 2016 -0800

----------------------------------------------------------------------
 site/Rakefile | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b4600b9d/site/Rakefile
----------------------------------------------------------------------
diff --git a/site/Rakefile b/site/Rakefile
index 0ce4b79..10817d4 100644
--- a/site/Rakefile
+++ b/site/Rakefile
@@ -25,21 +25,42 @@ task :update_docs do
 
   puts "Updating docs to the latest version"
   FileUtils.mkdir_p("source/documentation/latest/")
-  FileUtils.rm_f(Dir.glob("source/documentation/latest/*.md"))
-  FileUtils.cp_r(Dir.glob("../docs/*.md"), File.expand_path("source/documentation/latest/"))
+  FileUtils.rm_rf(Dir.glob("source/documentation/latest/*"))
+  FileUtils.cp_r(FileList['../docs/**'].exclude("../docs/images"), File.expand_path("source/documentation/latest/"))
+
+  # Due to a limitation in middleman, it doesn't support .md files
+  # named (e.g.  state.json.md). Middlman would generate an *html* file
+  # called state.json from this instead of generating the standard
+  # state.json/index.html like it does for other .md files.
+  puts "Migrating markdown files with paths matching **/*.json.md to **/*.json/index.md"
+  Dir.chdir("#{docs_dir}/latest/") {
+    Dir.glob('**/*.json.md').each { |doc|
+      docdir = doc.chomp(".md")
+      FileUtils.mkdir(docdir)
+      FileUtils.mv(doc, docdir + "/index.md")
+    }
+  }
+
   puts "Parse documentation files to removing md extension in any links"
   Dir.chdir("#{docs_dir}/latest/") {
-    Dir.glob('*.md').each { |doc|
+    Dir.glob('**/*.md').each { |doc|
       puts "working on: #{doc}"
+
+      # TODO(klueska): we really need to get rid of this complicated
+      # regular expression and add in some logic that is more easily
+      # understood.
+      docdir = File.dirname(doc)
       IO.write(doc, File.open(doc) { |f|
         f.read
-          .gsub(/\(([^(\/]+)\.md(\#.+?)?\)/, '(/documentation/latest/\1/\2)')
+          .gsub(/\(([^(]+?)(?:\/index)?\.md(\#.+?)?\)/, "(/documentation/latest/#{docdir}/" + '\1/\2)')
           .gsub(/\(images\/(.*)\)/, '(/assets/img/documentation/\1)')
       })
     }
   }
+
   puts "Moving documentation index to its own 'latest' directory"
   FileUtils.mv("source/documentation/latest/home.md", "source/documentation/latest.html.md")
+
   puts "Documentation updated"
 
   # Copy the images from the docs


[4/8] mesos git commit: Added unit tests for hitting the /help endpoints of a process.

Posted by bm...@apache.org.
Added unit tests for hitting the /help endpoints of a process.

These unit tests make sure that help endpoints are up and
running for a process's installed routes. They also ensure that
deleting a process removes the help information for all of it's routes
(to make sure stale information isn't sticking around if a new process
comes along with the same id later).

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


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

Branch: refs/heads/master
Commit: 30042c4e39aebfaed21978c79a7ed44cf96d982f
Parents: b2cefc6
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Feb 4 19:52:45 2016 -0800
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Thu Feb 4 21:18:17 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/http_tests.cpp | 102 ++++++++++++++++++++++
 1 file changed, 102 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/30042c4e/3rdparty/libprocess/src/tests/http_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/http_tests.cpp b/3rdparty/libprocess/src/tests/http_tests.cpp
index 66d185e..dfd93d9 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -180,6 +180,108 @@ TEST(HTTPTest, Endpoints)
 }
 
 
+TEST(HTTPTest, EndpointsHelp)
+{
+  Http http;
+  PID<HttpProcess> pid = http.process->self();
+
+  // Wait until the HttpProcess initialization has run so
+  // that the route calls have completed.
+  std::function<Nothing()> f = []() { return Nothing(); };
+
+  Future<Nothing> initialized = dispatch(pid, f);
+  AWAIT_READY(initialized);
+
+  // Hit '/help' and wait for a 200 OK response.
+  http::URL url = http::URL(
+      "http",
+      http.process->self().address.ip,
+      http.process->self().address.port,
+      "/help");
+
+  Future<http::Response> response = http::get(url);
+
+  AWAIT_READY(response);
+  EXPECT_EQ(http::Status::OK, response->code);
+  EXPECT_EQ(http::Status::string(http::Status::OK), response->status);
+
+  // Hit '/help?format=json' and wait for a 200 OK response.
+  url = http::URL(
+      "http",
+      http.process->self().address.ip,
+      http.process->self().address.port,
+      "/help",
+      {{"format", "json"}});
+
+  response = http::get(url);
+
+  AWAIT_READY(response);
+  EXPECT_EQ(http::Status::OK, response->code);
+  EXPECT_EQ(http::Status::string(http::Status::OK), response->status);
+
+  // Assert that it is valid JSON
+  EXPECT_SOME(JSON::parse(response->body));
+
+  // Hit '/help/<id>/body' and wait for a 200 OK response.
+  url = http::URL(
+      "http",
+      http.process->self().address.ip,
+      http.process->self().address.port,
+      "/help/" + pid.id + "/body");
+
+  response = http::get(url);
+
+  AWAIT_READY(response);
+  EXPECT_EQ(http::Status::OK, response->code);
+  EXPECT_EQ(http::Status::string(http::Status::OK), response->status);
+}
+
+
+TEST(HTTPTest, EndpointsHelpRemoval)
+{
+  // Start up a new HttpProcess;
+  Owned<Http> http(new Http());
+  PID<HttpProcess> pid = http->process->self();
+
+  // Wait until the HttpProcess initialization has run so
+  // that the route calls have completed.
+  std::function<Nothing()> f = []() { return Nothing(); };
+
+  Future<Nothing> initialized = dispatch(pid, f);
+  AWAIT_READY(initialized);
+
+  // Hit '/help/<id>/body' and wait for a 200 OK response.
+  http::URL url = http::URL(
+      "http",
+      http->process->self().address.ip,
+      http->process->self().address.port,
+      "/help/" + pid.id + "/body");
+
+  Future<http::Response> response = http::get(url);
+
+  AWAIT_READY(response);
+  EXPECT_EQ(http::Status::OK, response->code);
+  EXPECT_EQ(http::Status::string(http::Status::OK), response->status);
+
+  // Delete the HttpProcess. This should remove all help endpoints
+  // for the process, in addition to its own endpoints.
+  http.reset();
+
+  // Hit '/help/<id>/bogus' and wait for a 400 BAD REQUEST response.
+  url = http::URL(
+      "http",
+      process::address().ip,
+      process::address().port,
+      "/help/" + pid.id + "/bogus");
+
+  response = http::get(url);
+
+  AWAIT_READY(response);
+  ASSERT_EQ(http::Status::BAD_REQUEST, response->code);
+  ASSERT_EQ(http::Status::string(http::Status::BAD_REQUEST), response->status);
+}
+
+
 TEST(HTTPTest, PipeEOF)
 {
   http::Pipe pipe;