The sclient-server communication is based on the following API:
<DATA>
is map that represent the csv file {feature1
: [value11, value12,...]
, feature2
: [value21, value22,...]
, ... }
POST /api/model
with query parameters: model_type
: "regression"
or "hybrid"
, Body: {train_data: <DATA>}
HTTP/1.1 200 OK
Date: Thu, 27 May 2021 14:33:59 GMT
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Content-Length: 74
keep-alive: timeout=5
x-powered-by: Express
{"model_id":2,"upload_time":"2021-05-27T14:33:59.115Z","status":"pending"}
GET /api/model
with query parameters: model_id
: int
HTTP/1.1 200 OK
Date: Thu, 27 May 2021 14:40:51 GMT
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Content-Length: 72
keep-alive: timeout=5
x-powered-by: Express
{"model_id":1,"upload_time":"2021-05-27T14:32:11.031Z","status":"ready"}
DELETE /api/model
with query parameters: model_id
: int
HTTP/1.1 200 OK
Date: Thu, 27 May 2021 14:43:11 GMT
Connection: keep-alive
Content-Length: 0
keep-alive: timeout=5
x-powered-by: Express
[]
POST /api/anomaly
with query parameters: model_id
: int, Body: {train_data: <DATA>}
HTTP/1.1 200 OK
X-Powered-By: Express
Date: Thu, 27 May 2021 14:46:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 0
[]
GET /api/anomaly
with query parameters: model_id
: int, feature
: string
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 63
Date: Thu, 27 May 2021 14:46:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"feature":"slip-skid-ball_indicated-slip-skid","anomalies":[]}