You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/12/07 12:40:32 UTC
flink git commit: [FLINK-8133][REST][docs] Generate REST API
documentation
Repository: flink
Updated Branches:
refs/heads/master a3fd548e9 -> 610fde722
[FLINK-8133][REST][docs] Generate REST API documentation
This closes #5052.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/610fde72
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/610fde72
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/610fde72
Branch: refs/heads/master
Commit: 610fde722fc91ff760cff3865564a51a4b945f19
Parents: a3fd548
Author: zentol <ch...@apache.org>
Authored: Mon Nov 20 17:28:24 2017 +0100
Committer: zentol <ch...@apache.org>
Committed: Thu Dec 7 13:40:22 2017 +0100
----------------------------------------------------------------------
docs/_includes/generated/rest_dispatcher.html | 2048 ++++++++++++++++++
docs/monitoring/rest_api.md | 8 +
flink-docs/README.md | 36 +
flink-docs/pom.xml | 121 ++
.../flink/docs/rest/RestAPIDocGenerator.java | 313 +++
.../flink/runtime/rest/RestServerEndpoint.java | 22 +-
pom.xml | 11 +-
7 files changed, 2545 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/docs/_includes/generated/rest_dispatcher.html
----------------------------------------------------------------------
diff --git a/docs/_includes/generated/rest_dispatcher.html b/docs/_includes/generated/rest_dispatcher.html
new file mode 100644
index 0000000..25bdff1
--- /dev/null
+++ b/docs/_includes/generated/rest_dispatcher.html
@@ -0,0 +1,2048 @@
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/blobserver/port</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1881098330">Request</button>
+ <div id="-1881098330" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-574888474">Response</button>
+ <div id="-574888474" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:BlobServerPortResponseBody",
+ "properties" : {
+ "port" : {
+ "type" : "integer"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/config</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1357269034">Request</button>
+ <div id="-1357269034" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-642531372">Response</button>
+ <div id="-642531372" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:DashboardConfiguration",
+ "properties" : {
+ "refreshInterval" : {
+ "type" : "integer"
+ },
+ "timeZoneName" : {
+ "type" : "string"
+ },
+ "timeZoneOffset" : {
+ "type" : "integer"
+ },
+ "flinkVersion" : {
+ "type" : "string"
+ },
+ "flinkRevision" : {
+ "type" : "string"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobmanager/config</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1353094089">Request</button>
+ <div id="-1353094089" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1672532771">Response</button>
+ <div id="-1672532771" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:ClusterConfigurationInfoEntry",
+ "properties" : {
+ "key" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobmanager/metrics</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>get</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1667487464">Request</button>
+ <div id="-1667487464" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1356759103">Response</button>
+ <div id="-1356759103" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:MetricCollectionResponseBody",
+ "properties" : {
+ "metrics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:Metric",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1281196202">Request</button>
+ <div id="1281196202" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1630160880">Response</button>
+ <div id="1630160880" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:messages:webmonitor:JobIdsWithStatusOverview",
+ "properties" : {
+ "jobsWithStatus" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:messages:webmonitor:JobIdsWithStatusOverview:JobIdWithStatus",
+ "properties" : {
+ "jobId" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:api:common:JobID",
+ "properties" : {
+ "upperPart" : {
+ "type" : "integer"
+ },
+ "lowerPart" : {
+ "type" : "integer"
+ },
+ "bytes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "integer"
+ }
+ }
+ }
+ },
+ "jobStatus" : {
+ "type" : "string",
+ "enum" : [ "CREATED", "RUNNING", "FAILING", "FAILED", "CANCELLING", "CANCELED", "FINISHED", "RESTARTING", "SUSPENDED", "RECONCILING" ]
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>POST</code></td>
+ <td class="text-left">Response code: <code>202 Accepted</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1710504926">Request</button>
+ <div id="1710504926" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobSubmitRequestBody",
+ "properties" : {
+ "serializedJobGraph" : {
+ "type" : "array",
+ "items" : {
+ "type" : "integer"
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-476159276">Response</button>
+ <div id="-476159276" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:JobSubmitResponseBody",
+ "properties" : {
+ "jobUrl" : {
+ "type" : "string"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/overview</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-297252120">Request</button>
+ <div id="-297252120" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-374492226">Response</button>
+ <div id="-374492226" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:messages:webmonitor:MultipleJobsDetails",
+ "properties" : {
+ "jobs" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:messages:webmonitor:JobDetails",
+ "properties" : {
+ "jobId" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:api:common:JobID",
+ "properties" : {
+ "upperPart" : {
+ "type" : "integer"
+ },
+ "lowerPart" : {
+ "type" : "integer"
+ },
+ "bytes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "integer"
+ }
+ }
+ }
+ },
+ "jobName" : {
+ "type" : "string"
+ },
+ "startTime" : {
+ "type" : "integer"
+ },
+ "endTime" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "CREATED", "RUNNING", "FAILING", "FAILED", "CANCELLING", "CANCELED", "FINISHED", "RESTARTING", "SUSPENDED", "RECONCILING" ]
+ },
+ "lastUpdateTime" : {
+ "type" : "integer"
+ },
+ "tasksPerState" : {
+ "type" : "array",
+ "items" : {
+ "type" : "integer"
+ }
+ },
+ "numTasks" : {
+ "type" : "integer"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>PATCH</code></td>
+ <td class="text-left">Response code: <code>202 Accepted</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>mode</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1776493329">Request</button>
+ <div id="1776493329" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1961476153">Response</button>
+ <div id="1961476153" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-782366323">Request</button>
+ <div id="-782366323" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-2007597011">Response</button>
+ <div id="-2007597011" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/accumulators</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-775433959">Request</button>
+ <div id="-775433959" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-455270359">Response</button>
+ <div id="-455270359" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/checkpoints</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-128702999">Request</button>
+ <div id="-128702999" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#438202683">Response</button>
+ <div id="438202683" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointingStatistics",
+ "properties" : {
+ "counts" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointingStatistics:Counts",
+ "properties" : {
+ "numberRestoredCheckpoints" : {
+ "type" : "integer"
+ },
+ "totalNumberCheckpoints" : {
+ "type" : "integer"
+ },
+ "numberInProgressCheckpoints" : {
+ "type" : "integer"
+ },
+ "numberCompletedCheckpoints" : {
+ "type" : "integer"
+ },
+ "numberFailedCheckpoints" : {
+ "type" : "integer"
+ }
+ }
+ },
+ "summary" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointingStatistics:Summary",
+ "properties" : {
+ "stateSize" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics",
+ "properties" : {
+ "minimum" : {
+ "type" : "integer"
+ },
+ "maximum" : {
+ "type" : "integer"
+ },
+ "average" : {
+ "type" : "integer"
+ }
+ }
+ },
+ "duration" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ },
+ "alignmentBuffered" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ }
+ }
+ },
+ "latestCheckpoints" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointingStatistics:LatestCheckpoints",
+ "properties" : {
+ "completedCheckpointStatistics" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointStatistics:CompletedCheckpointStatistics",
+ "properties" : {
+ "id" : {
+ "type" : "integer"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "savepoint" : {
+ "type" : "boolean"
+ },
+ "triggerTimestamp" : {
+ "type" : "integer"
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ },
+ "checkpointStatisticsPerTask" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatistics",
+ "properties" : {
+ "checkpointId" : {
+ "type" : "integer"
+ },
+ "checkpointStatus" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ }
+ }
+ }
+ },
+ "externalPath" : {
+ "type" : "string"
+ },
+ "discarded" : {
+ "type" : "boolean"
+ }
+ }
+ },
+ "savepointStatistics" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointStatistics:CompletedCheckpointStatistics"
+ },
+ "failedCheckpointStatistics" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointStatistics:FailedCheckpointStatistics",
+ "properties" : {
+ "id" : {
+ "type" : "integer"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "savepoint" : {
+ "type" : "boolean"
+ },
+ "triggerTimestamp" : {
+ "type" : "integer"
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ },
+ "checkpointStatisticsPerTask" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatistics"
+ }
+ },
+ "failureTimestamp" : {
+ "type" : "integer"
+ },
+ "failureMessage" : {
+ "type" : "string"
+ }
+ }
+ },
+ "restoredCheckpointStatistics" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointingStatistics:RestoredCheckpointStatistics",
+ "properties" : {
+ "id" : {
+ "type" : "integer"
+ },
+ "restoreTimestamp" : {
+ "type" : "integer"
+ },
+ "savepoint" : {
+ "type" : "boolean"
+ },
+ "externalPath" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ },
+ "history" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointStatistics",
+ "properties" : {
+ "id" : {
+ "type" : "integer"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "savepoint" : {
+ "type" : "boolean"
+ },
+ "triggerTimestamp" : {
+ "type" : "integer"
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ },
+ "checkpointStatisticsPerTask" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatistics"
+ }
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/checkpoints/config</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-583364334">Request</button>
+ <div id="-583364334" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1680506711">Response</button>
+ <div id="-1680506711" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/checkpoints/details/:checkpointid/subtasks/:vertexid</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>checkpointid</code> - description</li>
+<li><code>vertexid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#2012912423">Request</button>
+ <div id="2012912423" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1953455481">Response</button>
+ <div id="1953455481" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatisticsWithSubtaskDetails",
+ "properties" : {
+ "checkpointId" : {
+ "type" : "integer"
+ },
+ "checkpointStatus" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ },
+ "summary" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatisticsWithSubtaskDetails:Summary",
+ "properties" : {
+ "stateSize" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics",
+ "properties" : {
+ "minimum" : {
+ "type" : "integer"
+ },
+ "maximum" : {
+ "type" : "integer"
+ },
+ "average" : {
+ "type" : "integer"
+ }
+ }
+ },
+ "duration" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ },
+ "checkpointDuration" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatisticsWithSubtaskDetails:CheckpointDuration",
+ "properties" : {
+ "synchronousDuration" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ },
+ "asynchronousDuration" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ }
+ }
+ },
+ "checkpointAlignment" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatisticsWithSubtaskDetails:CheckpointAlignment",
+ "properties" : {
+ "bufferedData" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ },
+ "duration" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:MinMaxAvgStatistics"
+ }
+ }
+ }
+ }
+ },
+ "subtaskCheckpointStatistics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:SubtaskCheckpointStatistics",
+ "properties" : {
+ "index" : {
+ "type" : "integer"
+ },
+ "checkpointStatus" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/checkpoints/:checkpointid</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>checkpointid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#838171895">Request</button>
+ <div id="838171895" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1184746847">Response</button>
+ <div id="-1184746847" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:CheckpointStatistics",
+ "properties" : {
+ "id" : {
+ "type" : "integer"
+ },
+ "status" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "savepoint" : {
+ "type" : "boolean"
+ },
+ "triggerTimestamp" : {
+ "type" : "integer"
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ },
+ "checkpointStatisticsPerTask" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:checkpoints:TaskCheckpointStatistics",
+ "properties" : {
+ "checkpointId" : {
+ "type" : "integer"
+ },
+ "checkpointStatus" : {
+ "type" : "string",
+ "enum" : [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
+ },
+ "latestAckTimestamp" : {
+ "type" : "integer"
+ },
+ "stateSize" : {
+ "type" : "integer"
+ },
+ "duration" : {
+ "type" : "integer"
+ },
+ "alignmentBuffered" : {
+ "type" : "integer"
+ },
+ "numSubtasks" : {
+ "type" : "integer"
+ },
+ "numAckSubtasks" : {
+ "type" : "integer"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/config</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1357116178">Request</button>
+ <div id="-1357116178" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#73579603">Response</button>
+ <div id="73579603" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobConfigInfo",
+ "properties" : {
+ "jobId" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:api:common:JobID",
+ "properties" : {
+ "upperPart" : {
+ "type" : "integer"
+ },
+ "lowerPart" : {
+ "type" : "integer"
+ },
+ "bytes" : {
+ "type" : "array",
+ "items" : {
+ "type" : "integer"
+ }
+ }
+ }
+ },
+ "jobName" : {
+ "type" : "string"
+ },
+ "executionConfigInfo" : {
+ "type" : "any"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/exceptions</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#794716208">Request</button>
+ <div id="794716208" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-176158761">Response</button>
+ <div id="-176158761" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/metrics</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>get</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1792172223">Request</button>
+ <div id="-1792172223" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1481443862">Response</button>
+ <div id="-1481443862" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:MetricCollectionResponseBody",
+ "properties" : {
+ "metrics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:Metric",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/plan</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-895161707">Request</button>
+ <div id="-895161707" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#597567777">Response</button>
+ <div id="597567777" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:JobPlanInfo",
+ "properties" : {
+ "jsonPlan" : {
+ "type" : "string"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/vertices/:vertexid/accumulators</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>vertexid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-2003025577">Request</button>
+ <div id="-2003025577" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#736007659">Response</button>
+ <div id="736007659" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/vertices/:vertexid/metrics</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>vertexid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>get</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#197623875">Request</button>
+ <div id="197623875" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#508352236">Response</button>
+ <div id="508352236" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:MetricCollectionResponseBody",
+ "properties" : {
+ "metrics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:Metric",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/vertices/:vertexid/subtasks/:subtaskindex/metrics</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>vertexid</code> - description</li>
+<li><code>subtaskindex</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>get</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-570514556">Request</button>
+ <div id="-570514556" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-259786195">Response</button>
+ <div id="-259786195" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:MetricCollectionResponseBody",
+ "properties" : {
+ "metrics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:Metric",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/jobs/:jobid/vertices/:vertexid/subtasktimes</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>jobid</code> - description</li>
+<li><code>vertexid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1181229237">Request</button>
+ <div id="-1181229237" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#2091701353">Response</button>
+ <div id="2091701353" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "any"
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/overview</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1581342131">Request</button>
+ <div id="-1581342131" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1331669657">Response</button>
+ <div id="-1331669657" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:handler:legacy:messages:ClusterOverviewWithVersion",
+ "properties" : {
+ "numJobsRunningOrPending" : {
+ "type" : "integer"
+ },
+ "numJobsFinished" : {
+ "type" : "integer"
+ },
+ "numJobsCancelled" : {
+ "type" : "integer"
+ },
+ "numJobsFailed" : {
+ "type" : "integer"
+ },
+ "numTaskManagersConnected" : {
+ "type" : "integer"
+ },
+ "numSlotsTotal" : {
+ "type" : "integer"
+ },
+ "numSlotsAvailable" : {
+ "type" : "integer"
+ },
+ "version" : {
+ "type" : "string"
+ },
+ "commitId" : {
+ "type" : "string"
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/taskmanagers</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1212462017">Request</button>
+ <div id="-1212462017" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#1694259450">Response</button>
+ <div id="1694259450" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:taskmanager:TaskManagersInfo",
+ "properties" : {
+ "taskManagerInfos" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:taskmanager:TaskManagerInfo",
+ "properties" : {
+ "resourceId" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:clusterframework:types:ResourceID",
+ "properties" : {
+ "resourceIdString" : {
+ "type" : "string"
+ },
+ "resourceID" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:clusterframework:types:ResourceID"
+ }
+ }
+ },
+ "address" : {
+ "type" : "string"
+ },
+ "dataPort" : {
+ "type" : "integer"
+ },
+ "lastHeartbeat" : {
+ "type" : "integer"
+ },
+ "numberSlots" : {
+ "type" : "integer"
+ },
+ "numberAvailableSlots" : {
+ "type" : "integer"
+ },
+ "hardwareDescription" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:instance:HardwareDescription",
+ "properties" : {
+ "numberOfCPUCores" : {
+ "type" : "integer"
+ },
+ "sizeOfPhysicalMemory" : {
+ "type" : "integer"
+ },
+ "sizeOfJvmHeap" : {
+ "type" : "integer"
+ },
+ "sizeOfManagedMemory" : {
+ "type" : "integer"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/taskmanagers/:taskmanagerid</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>taskmanagerid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1209460381">Request</button>
+ <div id="-1209460381" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1726867379">Response</button>
+ <div id="-1726867379" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:taskmanager:TaskManagerDetailsInfo",
+ "properties" : {
+ "resourceId" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:clusterframework:types:ResourceID",
+ "properties" : {
+ "resourceIdString" : {
+ "type" : "string"
+ },
+ "resourceID" : {
+ "type" : "object",
+ "$ref" : "urn:jsonschema:org:apache:flink:runtime:clusterframework:types:ResourceID"
+ }
+ }
+ },
+ "address" : {
+ "type" : "string"
+ },
+ "dataPort" : {
+ "type" : "integer"
+ },
+ "lastHeartbeat" : {
+ "type" : "integer"
+ },
+ "numberSlots" : {
+ "type" : "integer"
+ },
+ "numberAvailableSlots" : {
+ "type" : "integer"
+ },
+ "hardwareDescription" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:instance:HardwareDescription",
+ "properties" : {
+ "numberOfCPUCores" : {
+ "type" : "integer"
+ },
+ "sizeOfPhysicalMemory" : {
+ "type" : "integer"
+ },
+ "sizeOfJvmHeap" : {
+ "type" : "integer"
+ },
+ "sizeOfManagedMemory" : {
+ "type" : "integer"
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <td class="text-left" colspan="2"><strong>/taskmanagers/:taskmanagerid/metrics</strong></td>
+ </tr>
+ <tr>
+ <td class="text-left" style="width: 20%">Verb: <code>GET</code></td>
+ <td class="text-left">Response code: <code>200 OK</code></td>
+ </tr>
+ <tr>
+ <td colspan="2">description</td>
+ </tr>
+ <tr>
+ <td colspan="2">Path parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>taskmanagerid</code> - description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">Query parameters</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <ul>
+<li><code>get</code> (optional): description</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-1267828457">Request</button>
+ <div id="-1267828457" class="collapse">
+ <pre>
+ <code>
+{} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <button data-toggle="collapse" data-target="#-957100096">Response</button>
+ <div id="-957100096" class="collapse">
+ <pre>
+ <code>
+{
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:MetricCollectionResponseBody",
+ "properties" : {
+ "metrics" : {
+ "type" : "array",
+ "items" : {
+ "type" : "object",
+ "id" : "urn:jsonschema:org:apache:flink:runtime:rest:messages:job:metrics:Metric",
+ "properties" : {
+ "id" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ }
+ }
+ }
+} </code>
+ </pre>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/docs/monitoring/rest_api.md
----------------------------------------------------------------------
diff --git a/docs/monitoring/rest_api.md b/docs/monitoring/rest_api.md
index 5ac6652..410ba9c 100644
--- a/docs/monitoring/rest_api.md
+++ b/docs/monitoring/rest_api.md
@@ -674,4 +674,12 @@ Response:
{"jobid": "869a9868d49c679e7355700e0857af85"}
~~~
+## FLIP-6
+
+The following is the REST API documentation for FLIP-6.
+
+### Dispatcher
+
+{% include generated/rest_dispatcher.html %}
+
{% top %}
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/flink-docs/README.md
----------------------------------------------------------------------
diff --git a/flink-docs/README.md b/flink-docs/README.md
new file mode 100644
index 0000000..974417f
--- /dev/null
+++ b/flink-docs/README.md
@@ -0,0 +1,36 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Documentation generators
+
+This module contains generators that create HTML files directly from Flink's source code.
+
+## REST API documentation
+
+The `RestAPIDocGenerator` can be used to generate a full reference of the REST API of a `RestServerEndpoint`. A separate file is generated for each endpoint.
+
+To integrate a new endpoint into the generator
+1. Add a new `DocumentingRestEndpoint` class to `RestAPIDocGenerator` that extends the new endpoint class
+2. Add another call to `createHtmlFile` in `RestAPIDocGenerator#main`
+3. Regenerate the documentation by running `mvn package -Dgenerate-rest-docs -nsu`
+4. Integrate the generated file into the REST API documentation by adding `{% include generated/<file-name>.html %}` to the corresponding markdown file.
+
+The documentation must be regenerated whenever
+* a handler is added to/removed from a `RestServerEndpoint`
+* any used `MessageHeaders` class or any referenced `RequestBody`, `ResponseBody`, `MessageParameters` or `MessageParameter` class is modified.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/flink-docs/pom.xml
----------------------------------------------------------------------
diff --git a/flink-docs/pom.xml b/flink-docs/pom.xml
new file mode 100644
index 0000000..4051aa9
--- /dev/null
+++ b/flink-docs/pom.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-parent</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>flink-docs</artifactId>
+ <name>flink-docs</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-java</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-runtime_${scala.binary.version}</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-shaded-netty</artifactId>
+ </dependency>
+
+ <dependency>
+ <!-- We use standard jackson since jackson-module-jsonSchema isn't part of flink-shaded-jackson -->
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <!-- We use standard jackson since jackson-module-jsonSchema isn't part of flink-shaded-jackson -->
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jsonSchema</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>generate-rest-docs</id>
+ <activation>
+ <property>
+ <name>generate-rest-docs</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <target>
+ <mkdir dir="${rootDir}/${generated.docs.dir}"/>
+ <java classname="org.apache.flink.docs.rest.RestAPIDocGenerator" fork="true">
+ <classpath refid="maven.compile.classpath"/>
+ <arg value="${rootDir}/${generated.docs.dir}/"/>
+ </java>
+ </target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/flink-docs/src/main/java/org/apache/flink/docs/rest/RestAPIDocGenerator.java
----------------------------------------------------------------------
diff --git a/flink-docs/src/main/java/org/apache/flink/docs/rest/RestAPIDocGenerator.java b/flink-docs/src/main/java/org/apache/flink/docs/rest/RestAPIDocGenerator.java
new file mode 100644
index 0000000..964b63b
--- /dev/null
+++ b/flink-docs/src/main/java/org/apache/flink/docs/rest/RestAPIDocGenerator.java
@@ -0,0 +1,313 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.docs.rest;
+
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.runtime.concurrent.Executors;
+import org.apache.flink.runtime.dispatcher.DispatcherGateway;
+import org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint;
+import org.apache.flink.runtime.resourcemanager.ResourceManagerGateway;
+import org.apache.flink.runtime.rest.RestServerEndpoint;
+import org.apache.flink.runtime.rest.RestServerEndpointConfiguration;
+import org.apache.flink.runtime.rest.handler.RestHandlerConfiguration;
+import org.apache.flink.runtime.rest.handler.RestHandlerSpecification;
+import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
+import org.apache.flink.runtime.rest.messages.EmptyResponseBody;
+import org.apache.flink.runtime.rest.messages.MessageHeaders;
+import org.apache.flink.runtime.rest.messages.MessagePathParameter;
+import org.apache.flink.runtime.rest.messages.MessageQueryParameter;
+import org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever;
+import org.apache.flink.runtime.webmonitor.retriever.MetricQueryServiceRetriever;
+import org.apache.flink.util.ConfigurationException;
+
+import org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
+import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.stream.Collectors;
+
+/**
+ * Generator for the Rest API documentation.
+ *
+ * <p>One HTML file is generated for each {@link RestServerEndpoint} implementation
+ * that can be embedded into .md files using {@code {% include ${generated.docs.dir}/file.html %}}.
+ * Each file contains a series of HTML tables, one for each REST call.
+ *
+ * <p>The generated table for each REST call looks like this:
+ * ----------------------------------------------------------
+ * | URL |
+ * ----------------------------------------------------------
+ * | Verb: verb (GET|POST|...) | Response code: responseCode|
+ * ----------------------------------------------------------
+ * | Path parameters (if any are defined) |
+ * ----------------------------------------------------------
+ * | - parameterName: description |
+ * | ... |
+ * ----------------------------------------------------------
+ * | Query parameters (if any are defined) |
+ * ----------------------------------------------------------
+ * | - parameterName (requisiteness): description |
+ * | ... |
+ * ----------------------------------------------------------
+ * | Request json schema (a collapsible "Request" button) |
+ * ----------------------------------------------------------
+ * | Response json schema (a collapsible "Response" button) |
+ * ----------------------------------------------------------
+ */
+public class RestAPIDocGenerator {
+
+ private static final Logger LOG = LoggerFactory.getLogger(RestAPIDocGenerator.class);
+
+ private static final ObjectMapper mapper;
+ private static final JsonSchemaGenerator schemaGen;
+
+ static {
+ mapper = new ObjectMapper();
+ schemaGen = new JsonSchemaGenerator(mapper);
+ }
+
+ /**
+ * Generates the REST API documentation.
+ *
+ * @param args args[0] contains the directory into which the generated files are placed
+ * @throws IOException if any file operation failed
+ */
+ public static void main(String[] args) throws IOException {
+ String outputDirectory = args[0];
+
+ createHtmlFile(new DocumentingDispatcherRestEndpoint(), Paths.get(outputDirectory, "rest_dispatcher.html"));
+ }
+
+ private static void createHtmlFile(DocumentingRestEndpoint restEndpoint, Path outputFile) throws IOException {
+ StringBuilder html = new StringBuilder();
+
+ List<MessageHeaders> specs = restEndpoint.getSpecs();
+ specs.forEach(spec -> html.append(createHtmlEntry(spec)));
+
+ if (Files.exists(outputFile)) {
+ Files.delete(outputFile);
+ }
+ Files.write(outputFile, html.toString().getBytes(StandardCharsets.UTF_8));
+ }
+
+ private static String createHtmlEntry(MessageHeaders<?, ?, ?> spec) {
+ String requestEntry = createMessageHtmlEntry(
+ spec.getRequestClass(),
+ EmptyRequestBody.class);
+ String responseEntry = createMessageHtmlEntry(
+ spec.getResponseClass(),
+ EmptyResponseBody.class);
+
+ String pathParameterList = createPathParameterHtmlList(spec.getUnresolvedMessageParameters().getPathParameters());
+ String queryParameterList = createQueryParameterHtmlList(spec.getUnresolvedMessageParameters().getQueryParameters());
+
+ StringBuilder sb = new StringBuilder();
+ {
+ sb.append("<table class=\"table table-bordered\">\n");
+ sb.append(" <tbody>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td class=\"text-left\" colspan=\"2\"><strong>" + spec.getTargetRestEndpointURL() + "</strong></td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td class=\"text-left\" style=\"width: 20%\">Verb: <code>" + spec.getHttpMethod() + "</code></td>\n");
+ sb.append(" <td class=\"text-left\">Response code: <code>" + spec.getResponseStatusCode() + "</code></td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">" + "description" + "</td>\n");
+ sb.append(" </tr>\n");
+ }
+ if (!pathParameterList.isEmpty()) {
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">Path parameters</td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">\n");
+ sb.append(" <ul>\n");
+ sb.append(pathParameterList);
+ sb.append(" </ul>\n");
+ sb.append(" </td>\n");
+ sb.append(" </tr>\n");
+ }
+ if (!queryParameterList.isEmpty()) {
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">Query parameters</td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">\n");
+ sb.append(" <ul>\n");
+ sb.append(queryParameterList);
+ sb.append(" </ul>\n");
+ sb.append(" </td>\n");
+ sb.append(" </tr>\n");
+ }
+ int reqHash = spec.getTargetRestEndpointURL().hashCode() + spec.getHttpMethod().hashCode() + spec.getRequestClass().getCanonicalName().hashCode();
+ int resHash = spec.getTargetRestEndpointURL().hashCode() + spec.getHttpMethod().hashCode() + spec.getResponseClass().getCanonicalName().hashCode();
+ {
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">\n");
+ sb.append(" <button data-toggle=\"collapse\" data-target=\"#" + reqHash + "\">Request</button>\n");
+ sb.append(" <div id=\"" + reqHash + "\" class=\"collapse\">\n");
+ sb.append(" <pre>\n");
+ sb.append(" <code>\n");
+ sb.append(requestEntry);
+ sb.append(" </code>\n");
+ sb.append(" </pre>\n");
+ sb.append(" </div>\n");
+ sb.append(" </td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" <tr>\n");
+ sb.append(" <td colspan=\"2\">\n");
+ sb.append(" <button data-toggle=\"collapse\" data-target=\"#" + resHash + "\">Response</button>\n");
+ sb.append(" <div id=\"" + resHash + "\" class=\"collapse\">\n");
+ sb.append(" <pre>\n");
+ sb.append(" <code>\n");
+ sb.append(responseEntry);
+ sb.append(" </code>\n");
+ sb.append(" </pre>\n");
+ sb.append(" </div>\n");
+ sb.append(" </td>\n");
+ sb.append(" </tr>\n");
+ sb.append(" </tbody>\n");
+ sb.append("</table>\n");
+ }
+
+ return sb.toString();
+ }
+
+ private static String createPathParameterHtmlList(Collection<MessagePathParameter<?>> pathParameters) {
+ StringBuilder pathParameterList = new StringBuilder();
+ pathParameters.forEach(messagePathParameter ->
+ pathParameterList.append(
+ String.format("<li><code>%s</code> - %s</li>\n",
+ messagePathParameter.getKey(),
+ "description")
+ ));
+ return pathParameterList.toString();
+ }
+
+ private static String createQueryParameterHtmlList(Collection<MessageQueryParameter<?>> queryParameters) {
+ StringBuilder queryParameterList = new StringBuilder();
+ queryParameters.stream()
+ .sorted((param1, param2) -> Boolean.compare(param1.isMandatory(), param2.isMandatory()))
+ .forEach(parameter ->
+ queryParameterList.append(
+ String.format("<li><code>%s</code> (%s): %s</li>\n",
+ parameter.getKey(),
+ parameter.isMandatory() ? "mandatory" : "optional",
+ "description")
+ ));
+ return queryParameterList.toString();
+ }
+
+ private static String createMessageHtmlEntry(Class<?> messageClass, Class<?> emptyMessageClass) {
+ JsonSchema schema;
+ try {
+ schema = schemaGen.generateSchema(messageClass);
+ } catch (JsonProcessingException e) {
+ LOG.error("Failed to generate message schema for class {}.", messageClass, e);
+ throw new RuntimeException("Failed to generate message schema for class " + messageClass.getCanonicalName() + ".", e);
+ }
+
+ String json;
+ if (messageClass == emptyMessageClass) {
+ json = "{}";
+ } else {
+ try {
+ json = mapper.writerWithDefaultPrettyPrinter()
+ .writeValueAsString(schema);
+ } catch (JsonProcessingException e) {
+ LOG.error("Failed to write message schema for class {}.", messageClass.getCanonicalName(), e);
+ throw new RuntimeException("Failed to write message schema for class " + messageClass.getCanonicalName() + ".", e);
+ }
+ }
+
+ return json;
+ }
+
+ /**
+ * Utility class to extract the {@link MessageHeaders} that the {@link DispatcherRestEndpoint} supports.
+ */
+ private static class DocumentingDispatcherRestEndpoint extends DispatcherRestEndpoint implements DocumentingRestEndpoint {
+
+ private static final Configuration config;
+ private static final RestServerEndpointConfiguration restConfig;
+ private static final RestHandlerConfiguration handlerConfig;
+ private static final Executor executor;
+ private static final GatewayRetriever<DispatcherGateway> dispatcherGatewayRetriever;
+ private static final GatewayRetriever<ResourceManagerGateway> resourceManagerGatewayRetriever;
+ private static final MetricQueryServiceRetriever metricQueryServiceRetriever;
+
+ static {
+ config = new Configuration();
+ try {
+ restConfig = RestServerEndpointConfiguration.fromConfiguration(config);
+ } catch (ConfigurationException e) {
+ throw new RuntimeException("Implementation error. RestServerEndpointConfiguration#fromConfiguration failed for default configuration.");
+ }
+ handlerConfig = RestHandlerConfiguration.fromConfiguration(config);
+ executor = Executors.directExecutor();
+
+ dispatcherGatewayRetriever = () -> null;
+ resourceManagerGatewayRetriever = () -> null;
+ metricQueryServiceRetriever = path -> null;
+ }
+
+ private DocumentingDispatcherRestEndpoint() {
+ super(restConfig, dispatcherGatewayRetriever, config, handlerConfig, resourceManagerGatewayRetriever, executor, metricQueryServiceRetriever);
+ }
+
+ @Override
+ public List<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> restAddressFuture) {
+ return super.initializeHandlers(restAddressFuture);
+ }
+ }
+
+ /**
+ * Interface to expose the supported {@link MessageHeaders} of a {@link RestServerEndpoint}.
+ */
+ private interface DocumentingRestEndpoint {
+ List<Tuple2<RestHandlerSpecification, ChannelInboundHandler>> initializeHandlers(CompletableFuture<String> restAddressFuture);
+
+ default List<MessageHeaders> getSpecs() {
+ Comparator<String> comparator = new RestServerEndpoint.RestHandlerUrlComparator.CaseInsensitiveOrderComparator();
+ return initializeHandlers(CompletableFuture.completedFuture(null)).stream()
+ .map(tuple -> tuple.f0)
+ .filter(spec -> spec instanceof MessageHeaders)
+ .map(spec -> (MessageHeaders) spec)
+ .sorted((spec1, spec2) -> comparator.compare(spec1.getTargetRestEndpointURL(), spec2.getTargetRestEndpointURL()))
+ .collect(Collectors.toList());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java
index ea18e15..38f7e25 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java
@@ -299,10 +299,10 @@ public abstract class RestServerEndpoint {
* /jobs/:jobid/config
* /:*
*
- * <p>IMPORTANT: This comparator is highly specific to how Netty path parameter are encoded. Namely
- * via a preceding ':' character.
+ * <p>IMPORTANT: This comparator is highly specific to how Netty path parameters are encoded. Namely
+ * with a preceding ':' character.
*/
- static final class RestHandlerUrlComparator implements Comparator<Tuple2<RestHandlerSpecification, ChannelInboundHandler>>, Serializable {
+ public static final class RestHandlerUrlComparator implements Comparator<Tuple2<RestHandlerSpecification, ChannelInboundHandler>>, Serializable {
private static final long serialVersionUID = 2388466767835547926L;
@@ -317,7 +317,21 @@ public abstract class RestServerEndpoint {
return CASE_INSENSITIVE_ORDER.compare(o1.f0.getTargetRestEndpointURL(), o2.f0.getTargetRestEndpointURL());
}
- static final class CaseInsensitiveOrderComparator implements Comparator<String>, Serializable {
+ /**
+ * Comparator for Rest URLs.
+ *
+ * <p>The comparator orders the Rest URLs such that URLs with path parameters are ordered behind
+ * those without parameters. E.g.:
+ * /jobs
+ * /jobs/overview
+ * /jobs/:jobid
+ * /jobs/:jobid/config
+ * /:*
+ *
+ * <p>IMPORTANT: This comparator is highly specific to how Netty path parameters are encoded. Namely
+ * with a preceding ':' character.
+ */
+ public static final class CaseInsensitiveOrderComparator implements Comparator<String>, Serializable {
private static final long serialVersionUID = 8550835445193437027L;
@Override
http://git-wip-us.apache.org/repos/asf/flink/blob/610fde72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 036dfd4..d18a3a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,6 +83,7 @@ under the License.
<module>flink-yarn</module>
<module>flink-yarn-tests</module>
<module>flink-fs-tests</module>
+ <module>flink-docs</module>
</modules>
<properties>
@@ -1277,16 +1278,6 @@ under the License.
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>${generated.docs.dir}</directory>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
</plugins>
<!-- Plugin configurations for plugins activated in sub-projects -->