0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GitLab API の使い方

Last updated at Posted at 2022-05-06

プロジェクトID の調べ方
image.png

プロジェクトのメンバーの取得

get_members.sh
#
#	get_mbembers.sh
#
#
#
FILE_JSON="tmp01.json"
TOKEN="glpat-xxxxxxx"
PROJECT_ID="35195199"
LIMIT="?page=1&per_page=10"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}"/members"${LIMIT}
#
rm -f ${FILE_JSON}
http $URL "PRIVATE-TOKEN:"${TOKEN} > ${FILE_JSON}
#
jq ".[] | { id : .id, username: .username, name : .name, web_url : .web_url, created_at : .created_at }" ${FILE_JSON}
#

プロジェクトのブランチの取得

get_branches.sh
#
#	get_branches.sh
#
#
#
FILE_JSON="tmp02.json"
TOKEN="glpat-xxxxxx"
PROJECT_ID="35195199"
LIMIT="?page=1&per_page=10"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}"/repository/branches"${LIMIT}
#
rm -f ${FILE_JSON}
http $URL "PRIVATE-TOKEN:"${TOKEN} > ${FILE_JSON}
#
jq ".[] | {name : .name, merged : .merged, author_name: .commit.author_name}" ${FILE_JSON}
#

プロジェクトの削除

参考情報
Delete project

TOKEN="glpat-xxxxxx"
PROJECT_ID="35195199"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}
#
http DELETE $URL "PRIVATE-TOKEN:"${TOKEN}
0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?