Skip to content

アラート変更(alterAlert)送信

監視しているリスクテーマのアラート発報に関する条件を変更します。

エンドポイント

wss://<api-server>/api/v1/alertapi/socket.io/

リクエスト例

下記は http://geojson.io 等のツールで神戸駅周辺のPolygonを生成し、Featureとして指定したものです。

神戸駅周辺の テーマ rm_panda の 閾値 2 以上のデータを60秒間隔で2016-09-04 17-00-00の分から送信せよ という意味になります。

{
  "method": "alterAlert",
  "params": [{
    "type": "FeatureCollection",
    "name": "alterAlert Sample",
    "features": [
      {
      "type": "Feature",
      "properties": {"theme":"rm_panda","threshold":2,"interval":60},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              135.17412900924683,
              34.67725557158714
            ],
            [
              135.1812744140625,
              34.67725557158714
            ],
            [
              135.1812744140625,
              34.68107587385229
            ],
            [
              135.17412900924683,
              34.68107587385229
            ],
            [
              135.17412900924683,
              34.67725557158714
            ]
          ]
        ]
      }
    }
    ]
  }],
  "id": 1
}

パラメータ

アラート通知APIのメッセージのやりとりはWebSocketを利用しますが、入出力内容はJSON-RPCの形式で行います。

params は配列で指定し、先頭に取得したいと考える範囲のGeoJSONを指定します。

キー
method alterAlert
params[0] GeoJSON
id 任意

GeoJSON部・featuresの書式

GeoJSON部の書式は、type,name,featuresまではsetAlert時と同様に監視するテーマ一つにつき一つのFeatureとなるようなFeatureCollectionを指定します。

キー 必須
type FeatureCollection 必須
name 任意の文字列 任意
features Featureの配列 必須

一つ一つのFeatureの書式は、properties部にテーマ・閾値・インターバルを、geometry部にジオメトリオブジェクトを指定します。

キー 必須
type Feature の文字列 必須
geometry setAlertと同じ 省略可
properties theme,threshold,interval,thinning_step,thinning_filter_stepを含む連想配列 必須

properties の各値は下記のように指定しますが、省略したパラメータは setAlert(アラート設定) で指定したまま変更されません。

キー 必須
comment setAlertと同じ 省略可
theme 監視対象のテーマの文字列
setAlertで指定されていないテーマが指定された場合はエラー
必須
threshold setAlertと同じ 省略可
interval setAlertと同じ 省略可
thinning_step setAlertと同じ 省略可
thinning_filter_step setAlertと同じ 省略可