Created
July 2, 2019 10:06
-
-
Save varunpalekar/b9d824620ee6785eaef180a45ee02130 to your computer and use it in GitHub Desktop.
python script to delete all repository registry of gitlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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