標籤:amp within rsh eating require pipe desc git tor
前戲
擷取gitlab中admin使用者的private_token
Groups API擷取某個組的詳細
curl --header "PRIVATE-TOKEN: *********" http://192.168.10.7:8090/api/v4/groups/client #擷取client組的詳細資料
client組的詳細資料
{"id":6,"name":"client","path":"client","description":"用戶端","visibility":"private","lfs_enabled":true,"avatar_url":null,"web_url":"http://192.168.10.7:8090/groups/client","request_access_enabled":false,"full_name":"client","full_path":"client","parent_id":null,"projects":[],"shared_projects":[]} |
添加一個組
POST /groups
Parameters:
name (required) - The name of the group #必須
path (required) - The path of the group #必須
description (optional) - The group‘s description
membership_lock (optional, boolean) - Prevent adding new members to project membership within this group
share_with_group_lock (optional, boolean) - Prevent sharing a project with another group within this group
visibility (optional) - The group‘s visibility. Can be private, internal, or public.
lfs_enabled (optional) - Enable/disable Large File Storage (LFS) for the projects in this group
request_access_enabled (optional) - Allow users to request member access.
parent_id (optional) - The parent group id for creating nested group.
shared_runners_minutes_limit (optional) - (admin-only) Pipeline minutes quota for this group
curl --request POST --header "PRIVATE-TOKEN: *****" --data "name=shanxi&path=shanxi" http://192.168.10.7:8090/api/v4/groups; #添加山西組
添加一個子組
gitlab社區版在9.0以後增加了子組的功能,比如我在shanxi這個組下面添加taiyuan這個子組
curl --request POST --header "PRIVATE-TOKEN: ******" --data "name=taiyuan&path=taiyuan&parent_id=父組的id" http://192.168.10.7:8090/api/v4/groups;
User API添加一個使用者
curl -d "password=$password&email=$mail&username=$username&name=$name&private_token=************" http://192.168.10.7:8090/api/v4/users
Projects API添加一個項目
加入shanxi組的id是4,我想在shanxi組下面建立一個majiang項目
curl --request POST --header "PRIVATE-TOKEN: *********" --data "name=majiang&namespace_id=4" http://192.168.10.7:8090/api/v4/projects
詳細文檔猛戳
https://docs.gitlab.com/ee/api/README.html
gitlab通過api建立組、項目、成員