blob: f8b177fbed877bf384c703a1f2af25e402e8708c [file] [log] [blame]
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/>
<title>Gearpump RESTful API reference - GearPump 0.6.2 Documentation</title>
<link rel="stylesheet" href="css/bootstrap-3.3.5.min.css">
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/pygments-default.css">
<script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->
<div class="navbar navbar-inverse navbar-fixed-top" id="topbar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">GearPump
<span class="label label-primary" style="font-size: .6em">0.6.2</span>
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Overview</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Introduction<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="submit-your-1st-application.html">Submit Your 1st Application</a></li>
<li><a href="commandline.html">Client Command Line</a></li>
<li class="divider"></li>
<li><a href="basic-concepts.html">Basic Concepts</a></li>
<li><a href="features.html">Technical Highlights</a></li>
<li><a href="message-delivery.html">Reliable Message Delivery</a></li>
<li><a href="performance-report.html">Performance</a></li>
<li><a href="gearpump-internals.html">Gearpump Internals</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Deploying<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Deployment</li>
<li><a href="deployment-docker.html">Docker</a><li>
<li><a href="deployment-local.html">Local</a><li>
<li><a href="deployment-standalone.html">Standalone</a></li>
<li><a href="deployment-yarn.html">YARN</a></li>
<li class="divider"></li>
<li><a href="deployment-ha.html">High Availability</a></li>
<li><a href="deployment-msg-delivery.html">Reliable Message Delivery</a></li>
<li><a href="deployment-configuration.html">Configuration</a></li>
<li class="divider"></li>
<li><a href="deployment-security.html">Security</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Programming Guide<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="dev-write-1st-app.html">Write Your 1st App</a></li>
<li><a href="dev-custom-serializer.html">Customized Message Passing</a></li>
<li class="divider"></li>
<li><a href="api/scala/index.html">Scala API</a></li>
<li><a href="api/java/index.html">Java API</a></li>
<li><a href="dev-rest-api.html">RESTful API</a></li>
<li class="divider"></li>
<li><a href="dev-connectors.html">Gearpump Connectors</a></li>
<li class="divider"></li>
<li><a href="dev-storm.html">Storm Compatibility</a></li>
<!--
<li><a href="dev-samoa.html">Samoa Compatibility</a></li>
<li class="divider"></li>
<li><a href="dev-iot.html">Gearpump with IoT</a></li>
-->
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="how-to-contribute.html">How to Contribute</a></li>
<li><a href="coding-style.html">Coding Style</a></li>
<li class="divider"></li>
<li><a href="faq.html">FAQ</a><li>
<li><a href="about.html">About</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container" id="content">
<h1 class="title">Gearpump RESTful API reference</h1>
<h3 id="get-apiv10appmasterltappidgtdetaillttruefalsegt">GET api/v1.0/appmaster/&lt;appId&gt;?detail=&lt;true|false&gt;</h3>
<p>Query information of an specific application of Id appId</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/appmaster/2</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"status": "active",
"appId": 2,
"appName": "wordCount",
"appMasterPath": "akka.tcp://app2-executor-1@127.0.0.1:62525/user/daemon/appdaemon2/$c",
"workerPath": "akka.tcp://master@127.0.0.1:3000/user/Worker1",
"submissionTime": "1425925651057",
"startTime": "1425925653433",
"user": "foobar"
}
</code></pre></div>
<h3 id="delete-apiv10appmasterltappidgt">DELETE api/v1.0/appmaster/&lt;appId&gt;</h3>
<p>shutdown application appId</p>
<h3 id="get-apiv10appmasterltappidgtstallingtasks">GET api/v1.0/appmaster/&lt;appId&gt;/stallingtasks</h3>
<p>Query list of unhealthy tasks of an specific application of Id appId</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/appmaster/2/stallingtasks</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"tasks": [
{
"processorId": 0,
"index": 0
}
]
}
</code></pre></div>
<h3 id="get-apiv10appmasters">GET api/v1.0/appmasters</h3>
<p>Query information of all applications</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/appmasters</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"appMasters": [
{
"status": "active",
"appId": 1,
"appName": "dag",
"appMasterPath": "akka.tcp://app1-executor-1@127.0.0.1:62498/user/daemon/appdaemon1/$c",
"workerPath": "akka.tcp://master@127.0.0.1:3000/user/Worker1",
"submissionTime": "1425925483482",
"startTime": "1425925486016",
"user": "foobar"
}
]
}
</code></pre></div>
<h3 id="get-apiv10configappltappidgt">GET api/v1.0/config/app/&lt;appId&gt;</h3>
<p>Query the configuration of specific application appId</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/config/app/1</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"gearpump" : {
"appmaster" : {
"extraClasspath" : "",
"vmargs" : "-server -Xms512M -Xmx1024M -Xss1M -XX:MaxPermSize=128m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseParNewGC -XX:NewRatio=3"
},
"cluster" : {
"masters" : [
"127.0.0.1:3000"
]
},
"executor" : {
"extraClasspath" : "",
"vmargs" : "-server -Xms512M -Xmx1024M -Xss1M -XX:MaxPermSize=128m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseParNewGC -XX:NewRatio=3"
},
"jarstore" : {
"rootpath" : "jarstore/"
},
"log" : {
"application" : {
"dir" : "logs"
},
"daemon" : {
"dir" : "logs"
}
},
"metrics" : {
"enabled" : true,
"graphite" : {
"host" : "127.0.0.1",
"port" : 2003
},
"logfile" : {},
"report-interval-ms" : 15000,
"reporter" : "akka",
"retainHistoryData" : {
"hours" : 72,
"intervalMs" : 3600000
},
"retainRecentData" : {
"intervalMs" : 15000,
"seconds" : 300
},
"sample-rate" : 10
},
"netty" : {
"base-sleep-ms" : 100,
"buffer-size" : 5242880,
"fulsh-check-interval" : 10,
"max-retries" : 30,
"max-sleep-ms" : 1000,
"message-batch-size" : 262144
},
"netty-dispatcher" : "akka.actor.default-dispatcher",
"scheduling" : {
"scheduler-class" : "io.gearpump.cluster.scheduler.PriorityScheduler"
},
"serializers" : {
"[B" : "",
"[C" : "",
"[D" : "",
"[F" : "",
"[I" : "",
"[J" : "",
"[Ljava.lang.String;" : "",
"[S" : "",
"[Z" : "",
"io.gearpump.Message" : "io.gearpump.streaming.MessageSerializer",
"io.gearpump.streaming.task.Ack" : "io.gearpump.streaming.AckSerializer",
"io.gearpump.streaming.task.AckRequest" : "io.gearpump.streaming.AckRequestSerializer",
"io.gearpump.streaming.task.LatencyProbe" : "io.gearpump.streaming.LatencyProbeSerializer",
"io.gearpump.streaming.task.TaskId" : "io.gearpump.streaming.TaskIdSerializer",
"scala.Tuple1" : "",
"scala.Tuple2" : "",
"scala.Tuple3" : "",
"scala.Tuple4" : "",
"scala.Tuple5" : "",
"scala.Tuple6" : "",
"scala.collection.immutable.$colon$colon" : "",
"scala.collection.immutable.List" : ""
},
"services" : {
# gear.conf: 112
"host" : "127.0.0.1",
# gear.conf: 113
"http" : 8090,
# gear.conf: 114
"ws" : 8091
},
"task-dispatcher" : "akka.actor.pined-dispatcher",
"worker" : {
# reference.conf: 100
# # How many slots each worker contains
"slots" : 100
}
}
}
</code></pre></div>
<h3 id="get-apiv10configworkerltworkeridgt">GET api/v1.0/config/worker/&lt;workerId&gt;</h3>
<p>Get the configuration of specific worker workerId</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/config/worker/123456</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"akka": {
"loglevel": "INFO"
"log-dead-letters": "off"
"log-dead-letters-during-shutdown": "off"
"actor": {
"provider": "akka.remote.RemoteActorRefProvider"
}
"cluster": {
"roles": ["worker"]
}
"remote" {
"log-remote-lifecycle-events": "off"
}
}
}
</code></pre></div>
<h3 id="get-apiv10configmaster">GET api/v1.0/config/master</h3>
<p>Get the configuration of all masters</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/config/master</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"extensions": [
"akka.contrib.datareplication.DataReplication$"
]
"akka": {
"loglevel": "INFO"
"log-dead-letters": "off"
"log-dead-letters-during-shutdown": "off"
"actor": {
## Master forms a akka cluster
"provider": "akka.cluster.ClusterActorRefProvider"
}
"cluster": {
"roles": ["master"]
"auto-down-unreachable-after": "15s"
}
"remote": {
"log-remote-lifecycle-events": "off"
}
}
}
</code></pre></div>
<h3 id="get-apiv10master">GET api/v1.0/master</h3>
<p>Get information of masters</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/master</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"masterDescription": {
"leader": [
"master@127.0.0.1",
3000
],
"cluster": [
[
"127.0.0.1",
3000
]
],
"aliveFor": "642941",
"logFile": "/Users/foobar/gearpump/logs",
"jarStore": "jarstore/",
"masterStatus": "synced",
"homeDirectory": "/Users/foobar/gearpump"
}
}
</code></pre></div>
<h3 id="get-apiv10metricsappltappidgtltmetrics-pathgt">GET api/v1.0/metrics/app/&lt;appId&gt;/&lt;metrics path&gt;</h3>
<p>Query metrics information of a specific application appId
Filter metrics with path metrics path</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/metrics/app/3/app3.processor2</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"appId": 3,
"path": "app3.processor2",
"metrics": []
}
</code></pre></div>
<h3 id="get-apiv10workersltworkeridgt">GET api/v1.0/workers/&lt;workerId&gt;</h3>
<p>Get information of specific worker</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/workers/1096497833</code></pre></div>
<p>Sample Response</p>
<div class="highlight"><pre><code>{
"workerId": 1096497833,
"state": "active",
"actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker0",
"aliveFor": "77042",
"logFile": "/Users/foobar/gearpump/logs",
"executors": [],
"totalSlots": 100,
"availableSlots": 100,
"homeDirectory": "/Users/foobar/gearpump"
}
</code></pre></div>
<p>The worker list can be returned by query api/v1.0/workers Rest service.</p>
<h3 id="get-apiv10workers">GET api/v1.0/workers</h3>
<p>Get information of all workers.</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/workers</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>[
{
"workerId": 307839464,
"state": "active",
"actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker0",
"aliveFor": "18445",
"logFile": "/Users/foobar/gearpump/logs",
"executors": [],
"totalSlots": 100,
"availableSlots": 100,
"homeDirectory": "/Users/foobar/gearpump"
},
{
"workerId": 485240986,
"state": "active",
"actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker1",
"aliveFor": "18445",
"logFile": "/Users/foobar/gearpump/logs",
"executors": [],
"totalSlots": 100,
"availableSlots": 100,
"homeDirectory": "/Users/foobar/gearpump"
}
]
</code></pre></div>
<h3 id="get-apiv10version">GET api/v1.0/version</h3>
<p>Query the version of gearpump</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/version</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>0.6.2
</code></pre></div>
<h3 id="get-apiv10websocketurl">GET api/v1.0/websocket/url</h3>
<p>Query the url of web socket</p>
<p>Example:</p>
<div class="highlight"><pre><code class="language-bash">curl http://127.0.0.1:8090/api/v1.0/websocket/url</code></pre></div>
<p>Sample Response:</p>
<div class="highlight"><pre><code>{
"url": "ws://127.0.0.1:8091"
}
</code></pre></div>
</div> <!-- /container -->
<script src="js/vendor/jquery-2.1.4.min.js"></script>
<script src="js/vendor/bootstrap-3.3.5.min.js"></script>
<script src="js/vendor/anchor-1.1.1.min.js"></script>
<script src="js/main.js"></script>
<!-- MathJax Section -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script>
// Note that we load MathJax this way to work with local file (file://), HTTP and HTTPS.
// We could use "//cdn.mathjax...", but that won't support "file://".
(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.onload = function(){
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ],
displayMath: [ ["$$","$$"], ["\\[", "\\]"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
};
script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
</script>
</body>
</html>