Microservice for activity management in the BIBBOX framework. First an activity logbook is impelemented.
- the phyton APP folder /app/activities will be mounted to /yourlocalpath/sys-activities/app/activities
- the redis datafolder /var/lib/redis/data will be mounted to /yourlocalpath/sys-activities/redis/data
POST http://activities.demo.bibbox.org/activities/api/v1.0/activities
Generate an activity
{
"name": "Name of the activity, specified by the owner of the task",
"type": "INSTALLAPP | UPDATEAPP | DELETEAPP | BACKUPAPP",
"user_id": 8776,
"user_name": "Name of the user issued the task / job",
"start_time" : "start time in javascript format",
"finished_time": "finished time in javascript format, empty string when still running",
"state" : "RUNNING | FINISHED | PAUSED",
"result" : "SUCCESS | ERROR | UNKNOWN"
}
GET http://activities.demo.bibbox.org/activities/api/v1.0/activities
URL Parameter | Default | Description |
---|---|---|
finished | false | If set to true, the result will also include finished activities |
limit | return a maximum of limit entries | |
offset | skip the first offset entries |
[
{
"id": 1,
"name": "Install app-openspecimen at sample-manegement.demo.bibbox.com",
"type": "INSTALLAPP",
"user_id": 8776,
"user_name": "Robert",
"start_time" : "2016-04-23T18:25:43.511Z",
"finished_time": "",
"state" : "RUNNING",
"result" : ""
},
{
"id": 2,
"name": "Install app-phenotips at phenotips.demo.bibbox.com",
"type": "INSTALLAPP",
"user_id": 8772,
"user_name": "Lukas",
"start_time" : "2016-04-22T18:25:43.511Z",
"finished_time": "2016-04-22T18:29:43.511Z",
"state" : "FINISHED",
"result" : "SUCCESS"
}
]
GET http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]
Get a specific activity.
PUT http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]
Update some fields in an activity.
{
"finished_time": "2016-04-22T18:29:43.511Z",
"state" : "FINISHED",
"result" : "ERROR"
}
DELETE hhttp://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]
Delete a specific activity, only used in development and debugging.
POST http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]/logs
Generate a log entry for the activiy
{
"log-message": "Log Meassage, usaly a multiline string",
"type" : "INFO | WARNING | ERROR "
}
GET http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]/logs
[
{
"log-message": "Start Installation",
"type" : "INFO"
},
{
"log-message": "Unknown Critical Problem",
"type" : "ERROR"
}
]
URL Parameter | Default | Description |
---|---|---|
limit | return a maximum of limit entries | |
offset | skip the first offset entries |