보호된 태그 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

유효한 액세스 수준

다음 액세스 수준이 인식됩니다:

  • 0: 액세스 없음
  • 30: 개발자 역할
  • 40: 유지 관리자 역할

보호된 태그 디렉터리

  • GitLab 16.0에서 소개된 배포 키 정보.

프로젝트에서 보호된 태그 디렉터리을 가져옵니다. 이 함수는 페이지네이션 매개변수 pageper_page를 사용하여 보호된 태그 디렉터리을 제한합니다.

GET /projects/:id/protected_tags
속성 유형 필수 여부 설명
id 정수 또는 문자열 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩된 경로
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  "https://gitlab.example.com/api/v4/projects/5/protected_tags"

예시 응답:

[
  {
    "name": "release-1-0",
    "create_access_levels": [
      {
        "id":1,
        "access_level": 40,
        "access_level_description": "Maintainers"
      },
      {
        "id": 2,
        "accces_level": 40,
        "access_level_description": "Deploy key",
        "deploy_key_id": 1
      }
    ]
  },
  ...
]

단일 보호된 태그 또는 와일드카드 보호된 태그 가져오기

단일 보호된 태그 또는 와일드카드 보호된 태그를 가져옵니다.

GET /projects/:id/protected_tags/:name
속성 유형 필수 여부 설명
id 정수 또는 문자열 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩된 경로
name 문자열 태그 또는 와일드카드의 이름
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  "https://gitlab.example.com/api/v4/projects/5/protected_tags/release-1-0"

예시 응답:

{
  "name": "release-1-0",
  "create_access_levels": [
    {
      "id": 1,
      "access_level": 40,
      "access_level_description": "Maintainers"
    }
  ]
}

리포지터리 태그 보호

단일 리포지터리 태그 또는 와일드카드 보호된 태그를 보호합니다.

POST /projects/:id/protected_tags
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
   "https://gitlab.example.com/api/v4/projects/5/protected_tags" -d '{
   "allowed_to_create" : [
      {
         "user_id" : 1
      },
      {
         "access_level" : 30
      }
   ],
   "create_access_level" : 30,
   "name" : "*-stable"
}'
속성 유형 필수 여부 설명
id 정수 또는 문자열 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩된 경로
name 문자열 태그 또는 와일드카드의 이름
allowed_to_create 배열 아니오 태그를 만들 수있는 액세스 수준의 배열, 각각은 {user_id: integer}, {group_id: integer}, 또는 {access_level: integer} 형식의 해시로 설명됩니다.
create_access_level 문자열 아니오 만들 권한이 허용된 액세스 수준. 기본값: 40(유지 관리자 역할).

예시 응답:

{
  "name": "*-stable",
  "create_access_levels": [
    {
      "id": 1,
      "access_level": 30,
      "access_level_description": "Developers + Maintainers"
    }
  ]
}

리포지터리 태그 보호 해제

지정된 보호된 태그 또는 와일드카드 보호된 태그의 보호를 해제합니다.

DELETE /projects/:id/protected_tags/:name
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" \
  "https://gitlab.example.com/api/v4/projects/5/protected_tags/*-stable"
속성 유형 필수 여부 설명
id 정수 또는 문자열 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩된 경로
name 문자열 태그의 이름

관련 주제