Last active
January 3, 2016 11:29
-
-
Save rafaelfoster/8456066 to your computer and use it in GitHub Desktop.
Gitlab API - Some commands
This file contains 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
# Gitlab API reference: http://api.gitlab.org/ | |
# To use Gitlab API you must specify the Private Token. | |
# You can get it on Profile -> Account -> Private Token. | |
# Some operations require that the Tokens belongs to an Admin | |
# Get a list of All projects | |
curl --header "PRIVATE-TOKEN: [private token]" "http[s]://[servername_or_ip]/api/v3/projects/$id" | |
# Simple mass deletion of Gitlab projects | |
for id in $(seq 1 100) | |
do | |
curl -X DELETE --header "PRIVATE-TOKEN: [private token]" "http[s]://[servername_or_ip]/api/v3/projects/$id" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment