Skip to content

Instantly share code, notes, and snippets.

@rafaelfoster
Last active January 3, 2016 11:29
Show Gist options
  • Save rafaelfoster/8456066 to your computer and use it in GitHub Desktop.
Save rafaelfoster/8456066 to your computer and use it in GitHub Desktop.
Gitlab API - Some commands
# 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