Gearpump RESTful API リファレンス

認証

全ての REST API 呼び出しについて、デフォルトで認証を必要とします。認証をしたくない場合は、それらを無効にすることができます。

認証の無効化の仕方

認証を無効化するために、gear.conf内で gearpump-ui.gearpump.ui-security.authentication-enabled = false を設定することができます。詳細については、UI 認証 をチェックしてください。

認証が有効な場合に認証する方法

ユーザ-パスワードに基づいた認証

認証が有効であれば、REST APIを呼ぶ前にログインする必要があります。

curl  -X POST  --data username=admin --data password=admin --cookie-jar outputAuthenticationCookie.txt http://127.0.0.1:8090/login

これはログインするためにデフォルトの"admin:admin"を使い、認証クッキーをoutputAuthenticationCookie.txtファイルに保持するでしょう。

その後の全てのRest API呼び出しで、認証クッキーを追加する必要があります。例えば、

curl --cookie outputAuthenticationCookie.txt http://127.0.0.1/api/v1.0/master

さらに詳しい情報は、UI 認証をチェックしてください。

OAuth2 に基づいた認証について

OAuth2 に基づいた認証については、適切にアクセストークンを持つ必要があります。

異なる OAuth2 サービスプロバイダは異なる方法でアクセストークンを返します。

Googleに関してはOAuth Docを参照することができます。

CloudFoundry UAAに関しては、アクセストークンを取得するためにuaacコマンドを使うことができます。

$ uaac target http://login.gearpump.gotapaas.eu/
$ uaac token get <user_email_address>

### Find access token
$ uaac context

[0]*[http://login.gearpump.gotapaas.eu]

  [0]*[<user_email_address>]
      user_id: 34e33a79-42c6-479b-a8c1-8c471ff027fb
      client_id: cf
      token_type: bearer
      access_token: eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI
      expires_in: 599
      scope: password.write openid cloud_controller.write cloud_controller.read
      jti: 74ea49e4-1001-4757-9f8d-a66e52a27557

uaacについての詳しい情報は、UAAC ガイドをチェックしてください

さて、アクセストークンを持っていて、このアクセストークンを使ってGearpump UIサーバにログインしてみましょう:

## Please replace cloudfoundryuaa with actual OAuth2 service name you have configured in gear.conf
curl  -X POST  --data accesstoken=eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI --cookie-jar outputAuthenticationCookie.txt http://127.0.0.1:8090/login/oauth2/cloudfoundryuaa/accesstoken

これはログインにユーザ user_email_address を使い、認証クッキーをファイル outputAuthenticationCookie.txt に保持するでしょう。

その後の全てのRest API呼び出しで、認証クッキーを追加する必要があります。例えば、

curl --cookie outputAuthenticationCookie.txt http://127.0.0.1/api/v1.0/master

注意: OAuth2ユーザに関してデフォルトのパーミッションレベルを初期値にすることができます。詳しい情報は、UI 認証をチェックしてください。

クエリ バージョン

GET バージョン

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/version

応答の例:

0.7.1-SNAPSHOT

Master Service

GET api/v1.0/master

マスターの情報の取得

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/master

応答の例:

{
  "masterDescription": {
    "leader":{"host":"master@127.0.0.1","port":3000},
    "cluster":[{"host":"127.0.0.1","port":3000}]
    "aliveFor": "642941",
    "logFile": "/Users/foobar/gearpump/logs",
    "jarStore": "jarstore/",
    "masterStatus": "synced",
    "homeDirectory": "/Users/foobar/gearpump"
  }
}

GET api/v1.0/master/applist

全てのアプリケーションのクエリ情報

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/master/applist

応答の例:

{
  "appMasters": [
    {
      "status": "active",
      "appId": 1,
      "appName": "wordCount",
      "appMasterPath": "akka.tcp://app1-executor-1@127.0.0.1:52212/user/daemon/appdaemon1/$c",
      "workerPath": "akka.tcp://master@127.0.0.1:3000/user/Worker0",
      "submissionTime": "1450758114766",
      "startTime": "1450758117294",
      "user": "lisa"
    }
  ]
}

GET api/v1.0/master/workerlist

全てのワーカーのクエリ情報

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/master/workerlist

応答の例:

[
  {
    "workerId": "1",
    "state": "active",
    "actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker0",
    "aliveFor": "431565",
    "logFile": "logs/",
    "executors": [
      {
        "appId": 1,
        "executorId": -1,
        "slots": 1
      },
      {
        "appId": 1,
        "executorId": 0,
        "slots": 1
      }
    ],
    "totalSlots": 1000,
    "availableSlots": 998,
    "homeDirectory": "/usr/lisa/gearpump/",
    "jvmName": "11788@lisa"
  },
  {
    "workerId": "0",
    "state": "active",
    "actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker1",
    "aliveFor": "431546",
    "logFile": "logs/",
    "executors": [
      {
        "appId": 1,
        "executorId": 1,
        "slots": 1
      }
    ],
    "totalSlots": 1000,
    "availableSlots": 999,
    "homeDirectory": "/usr/lisa/gearpump/",
    "jvmName": "11788@lisa"
  }
]

GET api/v1.0/master/config

Get the configuration of all masters

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/master/config

応答の例:

{
  "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"
    }
  }
}

GET api/v1.0/master/metrics/<query_path>?readLatest=<true|false>

マスターノード マトリックスの取得

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/master/metrics/master?readLatest=true

応答の例:

{
    "path"
:
    "master", "metrics"
:
    [{
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:memory.heap.used", "value": "59764272"}
    }, {
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:thread.daemon.count", "value": "18"}
    }, {
        "time": "1450758725070",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "master:memory.total.committed",
            "value": "210239488"
        }
    }, {
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:memory.heap.max", "value": "880017408"}
    }, {
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:memory.total.max", "value": "997457920"}
    }, {
        "time": "1450758725070",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "master:memory.heap.committed",
            "value": "179830784"
        }
    }, {
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:memory.total.used", "value": "89117352"}
    }, {
        "time": "1450758725070",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "master:thread.count", "value": "28"}
    }]
}

POST api/v1.0/master/submitapp

ストリーミング ジョブのjarをGearpumpクラスタにサブミットコマンドライン gear app -jar xx.jar -conf yy.conf -executors 1 <command line arguments> のような機能をします

要求されるMIMEタイプ: “multipart/form-data”

要求されるポスト形式のフィールド:

  1. フィールド名 "jar"、ジョブのjarファイル

任意のポストフォームのフィールド:

  1. "configfile"、UTF8形式の設定ファイル。
  2. "configstring"、UTF8形式の設定ファイルのテキストの内容。
  3. "executorcount"、このアプリケーション ジョブのためのクラスタ全体で開始するJVMプロセスの数
  4. "args"、このジョブのjarのコマンドライン引数。

htmlの例:

<form id="submitapp" action="http://127.0.0.1:8090/api/v1.0/master/submitapp"
method="POST" enctype="multipart/form-data">
 
ジョブのjar (*.jar) [Required]:  <br/>
<input type="file" name="jar"/> <br/> <br/>
 
設定ファイル (*.conf) [Optional]:  <br/>
<input type="file" name="configfile"/> <br/>  <br/>
 
設定文字列、文字列形式の設定ファイル。[Optional]: <br/>
<input type="text" name="configstring" value="a.b.c.d=1"/> <br/><br/>
 
Executorの数 (integer, how many process to start for this streaming job) [Optional]: <br/>
<input type="text" name="executorcount" value="1"/> <br/><br/>
 
Application 引数 (String) [Optional]: <br/>
<input type="text" name="args" value=""/> <br/><br/>
 
<input type="submit" value="Submit"/>
 
</table>
 
</form>

POST api/v1.0/master/submitstormapp

stormのjarをGearpumpクラスタにサブミット。コマンドライン storm app -jar xx.jar -conf yy.yaml <command line arguments> のような機能をします

要求されるMIMEタイプ: “multipart/form-data”

要求されるポスト形式のフィールド:

  1. フィールド名 "jar"、ジョブのjarファイル

任意のポストフォームのフィールド:

  1. "configfile"、UTF8形式の.yaml設定ファイル。
  2. "args"、このジョブのjarのコマンドライン引数。

htmlの例:

<form id="submitstormapp" action="http://127.0.0.1:8090/api/v1.0/master/submitstormapp"
method="POST" enctype="multipart/form-data">
 
ジョブのjar (*.jar) [Required]:  <br/>
<input type="file" name="jar"/> <br/> <br/>
 
設定ファイル (*.yaml) [Optional]:  <br/>
<input type="file" name="configfile"/> <br/>  <br/>

Application 引数 (String) [Optional]: <br/>
<input type="text" name="args" value=""/> <br/><br/>
 
<input type="submit" value="Submit"/>
 
</table>
 
</form>

Worker service

GET api/v1.0/worker/<workerId>

クエリ ワーカーの情報

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/worker/0

応答の例:

{
  "workerId": "0",
  "state": "active",
  "actorPath": "akka.tcp://master@127.0.0.1:3000/user/Worker1",
  "aliveFor": "831069",
  "logFile": "logs/",
  "executors": [
    {
      "appId": 1,
      "executorId": 1,
      "slots": 1
    }
  ],
  "totalSlots": 1000,
  "availableSlots": 999,
  "homeDirectory": "/usr/lisa/gearpump/",
  "jvmName": "11788@lisa"
}

GET api/v1.0/worker/<workerId>/config

クエリ ワーカーの設定

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/worker/0/config

応答の例:

{
  "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"
    }
  }
}

GET api/v1.0/worker/<workerId>/metrics/<query_path>?readLatest=<true|false>

ワーカーノードのマトリックを取得。

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/worker/0/metrics/worker?readLatest=true

応答の例:

{
    "path"
:
    "worker", "metrics"
:
    [{
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.used",
            "value": "152931440"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:thread.daemon.count", "value": "18"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.heap.used",
            "value": "123139640"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.max",
            "value": "997457920"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.heap.committed",
            "value": "179830784"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:thread.count", "value": "28"}
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:memory.heap.max", "value": "880017408"}
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:memory.heap.max", "value": "880017408"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.committed",
            "value": "210239488"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.used",
            "value": "152931440"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:thread.count", "value": "28"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.max",
            "value": "997457920"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.heap.committed",
            "value": "179830784"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.committed",
            "value": "210239488"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:thread.daemon.count", "value": "18"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.heap.used",
            "value": "123139640"
        }
    }]
}

スーパーバイザー サービス

スーパーバイザー サービスによってユーザはワーカーマシーンを追加あるいは削除することができます。

POST api/v1.0/supervisor/status

スーパーバイザーサービスが有効かどうかをクエリする。スーパーバイザーサービスが無効な場合、addworker/removeworkerのようなAPIを使うことができません。

例:

curl -X POST [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/supervisor/status

応答の例:

{"enabled":true}

GET api/v1.0/supervisor

Get the supervisor path

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/supervisor

応答の例:

{path: "supervisor actor path"}

POST api/v1.0/supervisor/addworker/<worker-count>

クラスタ内でworkerCountに新しいワーカーを追加します。新しいコンテナを開始するためにYARNのような低レベルのリソーススケジューラを使い、Gearpumpワーカープロセスを起動するでしょう。

例:

curl -X POST [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/supervisor/addworker/2

応答の例:

{success: true}

POST api/v1.0/supervisor/removeworker/<worker-id>

ワーカーIdを指定することで1つのワーカーインスタンスを削除します。

*注意: 注意して使ってください!

注意: このワーカーJVMの下の全てのexecutor JVMも破壊されるでしょう。このワーカーの下で開始されたexecutorの全てのアプリケーションについて、フェイルオーバーを引き起こすでしょう。

例:

curl -X POST [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/supervisor/removeworker/3

応答の例:

{success: true}

アプリケーションサービス

GET api/v1.0/appmaster/<appId>?detail=<true|false>

Query information of an specific application of Id appId

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/1?detail=true

応答の例:

{
  "appId": 1,
  "appName": "wordCount",
  "processors": [
    [
      0,
      {
        "id": 0,
        "taskClass": "io.gearpump.streaming.examples.wordcount.Split",
        "parallelism": 1,
        "description": "",
        "taskConf": {
          "_config": {}
        },
        "life": {
          "birth": "0",
          "death": "9223372036854775807"
        },
        "executors": [
          1
        ],
        "taskCount": [
          [
            1,
            {
              "count": 1
            }
          ]
        ]
      }
    ],
    [
      1,
      {
        "id": 1,
        "taskClass": "io.gearpump.streaming.examples.wordcount.Sum",
        "parallelism": 1,
        "description": "",
        "taskConf": {
          "_config": {}
        },
        "life": {
          "birth": "0",
          "death": "9223372036854775807"
        },
        "executors": [
          0
        ],
        "taskCount": [
          [
            0,
            {
              "count": 1
            }
          ]
        ]
      }
    ]
  ],
  "processorLevels": [
    [
      0,
      0
    ],
    [
      1,
      1
    ]
  ],
  "dag": {
    "vertexList": [
      0,
      1
    ],
    "edgeList": [
      [
        0,
        "io.gearpump.partitioner.HashPartitioner",
        1
      ]
    ]
  },
  "actorPath": "akka.tcp://app1-executor-1@127.0.0.1:52212/user/daemon/appdaemon1/$c/appmaster",
  "clock": "1450759382430",
  "executors": [
    {
      "executorId": 0,
      "executor": "akka.tcp://app1system0@127.0.0.1:52240/remote/akka.tcp/app1-executor-1@127.0.0.1:52212/user/daemon/appdaemon1/$c/appmaster/executors/0#-1554950276",
      "workerId": "1",
      "status": "active"
    },
    {
      "executorId": 1,
      "executor": "akka.tcp://app1system1@127.0.0.1:52241/remote/akka.tcp/app1-executor-1@127.0.0.1:52212/user/daemon/appdaemon1/$c/appmaster/executors/1#928082134",
      "workerId": "0",
      "status": "active"
    },
    {
      "executorId": -1,
      "executor": "akka://app1-executor-1/user/daemon/appdaemon1/$c/appmaster",
      "workerId": "1",
      "status": "active"
    }
  ],
  "startTime": "1450758117306",
  "uptime": "1268472",
  "user": "lisa",
  "homeDirectory": "/usr/lisa/gearpump/",
  "logFile": "logs/",
  "historyMetricsConfig": {
    "retainHistoryDataHours": 72,
    "retainHistoryDataIntervalMs": 3600000,
    "retainRecentDataSeconds": 300,
    "retainRecentDataIntervalMs": 15000
  }
}

DELETE api/v1.0/appmaster/<appId>

appIdのアプリケーションをシャットダウン

GET api/v1.0/appmaster/<appId>/stallingtasks

IdがappIdの特定のアプリケーションのunhealthyなタスクのリストをクエリする

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/2/stallingtasks

応答の例:

{
  "tasks": [
    {
      "processorId": 0,
      "index": 0
    }
  ]
}

GET api/v1.0/appmaster/<appId>/config

特定のアプリケーションappId の設定をクエリする

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/1/config

応答の例:

{
    "gearpump" : {
        "appmaster" : {
            "extraClasspath" : "",
            "vmargs" : "-server -Xms512M -Xmx1024M -Xss1M -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:+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,
            "flush-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
        }
    }
}

GET api/v1.0/appmaster/<appId>/metrics/<query_path>?readLatest=<true|false>&aggregator=<aggregator_class>

Query metrics information of a specific application appId Filter metrics with path metrics path

aggregator points to a aggregator class, which will aggregate on the current metrics, and return a smaller set.

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/1/metrics/app1?readLatest=true&aggregator=io.gearpump.streaming.metrics.ProcessorAggregator

応答の例:

{
    "path"
:
    "worker", "metrics"
:
    [{
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.used",
            "value": "152931440"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:thread.daemon.count", "value": "18"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.heap.used",
            "value": "123139640"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.max",
            "value": "997457920"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.heap.committed",
            "value": "179830784"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:thread.count", "value": "28"}
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:memory.heap.max", "value": "880017408"}
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:memory.heap.max", "value": "880017408"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.committed",
            "value": "210239488"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker0:memory.total.used",
            "value": "152931440"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker1:thread.count", "value": "28"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.max",
            "value": "997457920"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.heap.committed",
            "value": "179830784"
        }
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.total.committed",
            "value": "210239488"
        }
    }, {
        "time": "1450759137860",
        "value": {"$type": "io.gearpump.metrics.Metrics.Gauge", "name": "worker0:thread.daemon.count", "value": "18"}
    }, {
        "time": "1450759137860",
        "value": {
            "$type": "io.gearpump.metrics.Metrics.Gauge",
            "name": "worker1:memory.heap.used",
            "value": "123139640"
        }
    }]
}

GET api/v1.0/appmaster/<appId>/errors

タスクのエラーメッセージを取得する

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/1/errors

応答の例:

{"time":"0","error":null}

POST api/v1.0/appmaster/<appId>/restart

アプリケーションを再起動する

Executor サービス

GET api/v1.0/appmaster/<appId>/executor/<executorid>/config

executorの設定を取得する

例:

curl http://127.0.0.1:8090/api/v1.0/appmaster/1/executor/1/config

応答の例:

{
  "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"
    }
  }
}

GET api/v1.0/appmaster/<appId>/executor/<executorid>

executor の情報を取得する。

例:

curl [--cookie outputAuthenticationCookie.txt] http://127.0.0.1:8090/api/v1.0/appmaster/1/executor/1

応答の例:

{
  "id": 1,
  "workerId": "0",
  "actorPath": "akka.tcp://app1system1@127.0.0.1:52241/remote/akka.tcp/app1-executor-1@127.0.0.1:52212/user/daemon/appdaemon1/$c/appmaster/executors/1",
  "logFile": "logs/",
  "status": "active",
  "taskCount": 1,
  "tasks": [
    [
      0,
      [
        {
          "processorId": 0,
          "index": 0
        }
      ]
    ]
  ],
  "jvmName": "21304@lisa"
}
TOP
inserted by FC2 system