semaphore
semaphore copied to clipboard
Delete tasks history for a task template
Is it possible to add in the graphical interface the possibility of removing (purge) Tasks ID History for each Task Templates ?
Have a good day :)
It takes too many mysql database rows. A history delete function is greate.
Does someone have a sql query which removes task history records by date?
Not ideal but they can be deleted one at a time via the API. Could wrap in a for loop in a script. Need to auth to the API first with ID and password to generate a cookie. Then use the cookie to generate an API token.
Auth to generate a cookie
curl -v -c ./semaphore-cookie -XPOST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"auth": "your_username", "password": "your_password"}' \
http://192.168.1.104:3100/api/auth/login
Generate an API token
curl -v -b ./semaphore-cookie 'GET' \
'http://192.168.1.104:3100/api/user/tokens' \
-H 'accept: application/json'
Remove task 97
curl -X 'DELETE' \
'http://192.168.1.104:3100/api/project/1/tasks/97' \
-H 'accept: application/json' -H 'Authorization: Bearer your_api_token
For loop (deletes tasks from 92 to 85)
for ((i=92;i>=85;i--)); do curl -X 'DELETE' \
http://192.168.1.104:3100/api/project/1/tasks/$i \
-H 'accept: application/json' \
-H 'Authorization: Bearer your_api_token'; done
Is there no simple query? My dat a base is becvery large now. Would be great if something will be added in the ui.
Related to: https://github.com/ansible-semaphore/semaphore/issues/978