Search code examples
gitlabjobsgitlab-apiresource-cleanup

How to remove old archive jobs in chef?


I am trying to clean up my gitlab server running v12.x something. I wrote a python script to query the api for the gitlab server and i send a request I get a 201 response code. I used the official docs (https://docs.gitlab.com/ee/api/jobs.html) But the jobs remains in the web ui... I tried deleting the artifacts from the server, and I get a 204 back as a response code.

just by using a simple post command

curl --request POST --header "PRIVATE-TOKEN: <token>" "https://gitlab.corp.com/api/v4/projects/1/jobs/1/erase"

How can one verify that the jobs and are deleted...?

In the admin settings I setup archiving jobs for 1 month and to delete the artifact as well. But, in the admin portal I have 10,000 plus jobs....

The result of the script running, after 4 hrs, the api will not accept the token, and the user account, can't to any git commands for 24 hrs, then returns to normal.... By that I mean, you can't view any code in the web ui, and git commands will not work either....

Has anyone experienced this issue?


Solution

  • The long and the short of it is the api will not do it. I had to update the postgress DB directly to clean them out.