Alert Modification (alertAlert) Transmission
Alter the alert notification conditions for the risk theme you are monitoring.
Endpoints
wss://<api-server>/api/v1/alertapi/socket.io/
Sample Request
The following generates polygons for the area around Kobe Station with a tool such as http://geojson.io, and specifies it as a feature.
This means that data at the threshold value of 2 or more from the rm_panda theme around Kobe Station is transmitted in 60-second intervals from 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
}
Parameter
While WebSocket is used for exchanging Alert notification API messages, I/O information is exchanged using the JSON-RPC format.
params is specified with an array, and specifies the GeoJSON of the range you wish to acquire at the beginning.
Key | Value |
---|---|
method | alterAlert |
params[0] | GeoJSON |
id | Optional |
GeoJSON section features format
For the format for the GeoJSON section, a FeatureCollection is specified so that there is one Feature for each theme which monitors the same way as when setAlert occurs, covering type, name and features.
Key | Value | Required |
---|---|---|
type | FeatureCollection | Required |
name | Optional text string | Optional |
features | Feature Array | Required |
Each Feature format specifies theme, threshold values and intervals in the properties section, and geometry objects in the geometry section.
Key | Value | Required |
---|---|---|
type | Feature text string | Required |
geometry | Same as setAlert | Can be omitted |
properties | Associative array that includes theme, threshold and interval, thinning_step and thinning_filter_step | Required |
While each value in properties is specified as below, omitted parameters are not changed, and stay the same as specified with setAlert (alert settings).
Key | Value | Required |
---|---|---|
comment | Same as setAlert | Can be omitted |
theme | Monitored theme text string When a theme that has not been specified with setAlert is specified, an error is produced. | Required |
threshold | Same as setAlert | Can be omitted |
interval | Same as setAlert | Can be omitted |
thinning_step | Same as setAlert | Can be omitted |
thinning_filter_step | Same as setAlert | Can be omitted |