Skip to content

BIBBOX Activity Log service (sys docker containers)

Notifications You must be signed in to change notification settings

bibbox/sys-activities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYS-ACTIVITIES SERVICE

Microservice for activity management in the BIBBOX framework. First an activity logbook is impelemented.

Docker Images Used

  • phyton server running flask
  • redis, offical redis container
  • busybox, offical data container

INSTALL

run install.sh

Mounted Volumes

  • 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

APIs

POST /activities

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 /activities

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 /activities/[id]

GET http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]

Get a specific activity.

PUT /activities/[id]

PUT http://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]

Update some fields in an activity.

Body payload in JSON FORMAT

  {
    "finished_time":  "2016-04-22T18:29:43.511Z",
    "state" : "FINISHED",
    "result" : "ERROR"
  }

DELETE /activities/[id]

DELETE hhttp://activities.demo.bibbox.org/activities/api/v1.0/activities/[id]

Delete a specific activity, only used in development and debugging.

POST /activities/[id]/logs

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 /activities/[id]/logs

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

About

BIBBOX Activity Log service (sys docker containers)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published