The service provides a client with a learning session
Learning session contains all the state and the results of ongoing and finished learnings
$ docker run -p 7070:80 rzinnatov/remoteml-lss:latest
To ensure the service is up you can try to GET sessions of a not existing user. Empty array []
should be returned.
$ curl http://localhost:7070/api/v1/sessions/not-existing-user-id
[]
- Clone or download this repository
$ mv example.settings.json settings.json
- Populate
settings.json
with real values (see comments inside) $ npm start
Error while any request
Status >=400
{
"error": "error message"
}
Get session
Request
GET /session/<session-id>
Responses
Status 200
{
"id": "string",
"userId": "string",
"state": Integer
}
Status 404
{
"error": "session with id '<session-id>' is not found"
}
Get all sessions of an user
Request
GET /sessions/<user-id>
Responses
Status 200
[
{
"id": "string",
"userId": "string",
"state": Integer
},{
"id": "string",
"userId": "string",
"state": Integer
},
...
]
Create session
Request
POST /session
{
"userId": "string"
}
Responses
Status 200
{
"id": "string",
"userId": "string",
"state": Integer
}
Update session
Request
PUT /session
{
"id": "string",
"userId": "string",
"state": Integer
}
Responses
Status 200
{
"modifiedCount": Integer
}
Delete session
Request
DELETE /session/<session-id>
Responses
Status 200
{
"deletedCount": Integer
}
Delete all sessions of an user
Request
DELETE /sessions/<user-id>
Responses
Status 200
{
"deletedCount": Integer
}
Delete all sessions
Request
DELETE /sessions/
Responses
Status 200
{
"deletedCount": Integer
}