Skip to content

Instantly share code, notes, and snippets.

@varunpalekar
Created July 2, 2019 10:06
Show Gist options
  • Save varunpalekar/b9d824620ee6785eaef180a45ee02130 to your computer and use it in GitHub Desktop.
Save varunpalekar/b9d824620ee6785eaef180a45ee02130 to your computer and use it in GitHub Desktop.
python script to delete all repository registry of gitlab
import requests
api_token = "secret_token"
res = requests.get("https://gitlab.com/api/v4/projects/8525642/registry/repositories",
headers={"PRIVATE-TOKEN": api_token}
)
for rep in res.json():
print( rep['id'] )
del_response = requests.delete("https://gitlab.com/api/v4/projects/8525642/registry/repositories/",
headers={"PRIVATE-TOKEN": api_token}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment