- 프로젝트 가시성 수준
- API v5에서 제거사항
- 프로젝트 Merge 방법
- 모든 프로젝트 나열
- 사용자 프로젝트 디렉터리
- 사용자가 기여한 프로젝트 디렉터리
- 사용자가 스타를 표시한 프로젝트 디렉터리
- 단일 프로젝트 가져오기
- 프로젝트 사용자 가져오기
- 프로젝트의 그룹 디렉터리
- 프로젝트의 공유 가능한 그룹 디렉터리 가져오기
- 프로젝트 이벤트 가져오기
- 프로젝트 생성
- 사용자를 위한 프로젝트 생성
- 프로젝트 수정
- 프로젝트 포크
- 프로젝트의 포크 디렉터리
- 프로젝트에 별표 표시하기
- 프로젝트에서 별표 제거하기
- 프로젝트 스타를 지정하기
- 사용된 언어
- 프로젝트 보관
- 프로젝트 해제
- 프로젝트 삭제
- 삭제 표시된 프로젝트 복원
- 파일 업로드
- 프로젝트 아바타 업로드
- 프로젝트 아바타 다운로드
- 프로젝트 아바타 삭제
- 그룹으로 프로젝트 공유
- 그룹 내에서 공유된 프로젝트 링크 삭제
- 프로젝트 멤버 가져오기
- 훅
- 포크 관계
- 프로젝트 이름으로 프로젝트 검색
- 프로젝트의 Housekeeping 작업 시작
- 푸시 규칙
- 사용자가 프로젝트를 이전할 수 있는 그룹 가져오기
- 프로젝트를 새 네임스페이스로 전송
- 브랜치
- 프로젝트 가져오기/내보내기
- 프로젝트 멤버
- 프로젝트 취약점
- 프로젝트의 풀 미러 세부 정보 가져오기
- 프로젝트의 풀 미러 구성하기
- 프로젝트의 풀 미러 프로세스 시작하기
- 프로젝트 뱃지
- Git 리포지터리의 스냅샷 다운로드
- 리포지터리 스토리지 경로 가져오기
프로젝트 API
프로젝트를 REST API를 사용하여 상호 작용합니다.
프로젝트 가시성 수준
GitLab의 프로젝트는 비공개(private), 내부(internal), 또는 공개(public)일 수 있습니다.
가시성 수준은 프로젝트의 visibility
필드에 의해 결정됩니다.
세부 내용은 프로젝트 가시성을 참조하세요.
응답으로 반환되는 필드는 인증된 사용자의 권한에 따라 다릅니다.
API v5에서 제거사항
다음 속성은 향후 API v5에서 제거 예정이며, 더 이상 사용되지 않습니다:
-
tag_list
: 대신topics
속성을 사용하세요. -
marked_for_deletion_at
: 대신marked_for_deletion_on
속성을 사용하세요. GitLab Premium 또는 Ultimate에서만 사용 가능합니다. -
approvals_before_merge
: 대신 Merge request approvals API를 사용하세요. GitLab Premium 또는 Ultimate에서만 사용 가능합니다.
프로젝트 Merge 방법
merge_method
는 다음 옵션을 사용할 수 있습니다:
-
merge
: 모든 Merge마다 Merge 커밋이 생성되며, 충돌이 없을 경우에만 Merge이 허용됩니다. -
rebase_merge
: 모든 Merge마다 Merge 커밋이 생성되지만, 퀵 프로워드 Merge이 가능한 경우에만 Merge이 허용됩니다. 이 Merge Request이 빌드되고 Merge된 후에 대상 브랜치가 빌드되도록 할 수 있습니다. -
ff
: Merge 커밋이 생성되지 않으며 모든 Merge이 퀵 프로워드됩니다. 브랜치가 퀵 프로워드될 수 있는 경우에만 Merge이 허용됩니다.
모든 프로젝트 나열
인증된 사용자를 위한 GitLab 전체의 모든 가시적 프로젝트 디렉터리을 얻습니다. 인증되지 않은 경우, 간단한 필드로만 구성된 공개 프로젝트만 반환됩니다.
GET /projects
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
archived
| boolean | 아니오 | 보관된 상태로 제한합니다. |
id_after
| integer | 아니오 | 지정된 ID보다 큰 ID를 가진 프로젝트로 결과를 제한합니다. |
id_before
| integer | 아니오 | 지정된 ID보다 작은 ID를 가진 프로젝트로 결과를 제한합니다. |
imported
| boolean | 아니오 | 현재 사용자에 의해 외부 시스템에서 가져온 프로젝트로 결과를 제한합니다. |
include_hidden
| boolean | 아니오 | 숨겨진 프로젝트를 포함합니다. (관리자 전용) Premium 및 Ultimate 전용. |
include_pending_delete
| boolean | 아니오 | 삭제 대기 중인 프로젝트를 포함합니다. (관리자 전용) |
last_activity_after
| 날짜 및 시간 | 아니오 | 지정된 시간 이후의 마지막 활동이 있는 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ )
|
last_activity_before
| 날짜 및 시간 | 아니오 | 지정된 시간 전의 마지막 활동이 있는 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ )
|
… |
메타 언어 및 시간 문서로 인간이 이해할 수 있는 언어로 번역하겠습니다.
페이지네이션 제한
GitLab 13.0 이상에서는 오프셋 기반 페이지네이션이 50,000개의 레코드로 한정됩니다. 이 한계를 초과하는 프로젝트를 검색하려면 키텍스트 페이지네이션이 필요합니다.
키텍스트 페이지네이션은 order_by=id
만 지원합니다. 다른 정렬 옵션은 사용할 수 없습니다.
사용자 프로젝트 디렉터리
- 응답의
_links.cluster_agents
속성은 GitLab 14.10에서 도입되었습니다.
지정된 사용자가 소유한 가시적인 프로젝트 디렉터리을 가져옵니다. 인증 없이 액세스하는 경우 공개 프로젝트만 반환됩니다.
필수 컴포넌트:
- 특정 속성을 보려면 프로젝트의 관리자이거나 프로젝트의 소유자 역할이어야 합니다.
user_id
에서의 사용자의 네임스페이스에 있는 프로젝트만 반환됩니다. 사용자가 소유한 그룹이나 하위 그룹의 프로젝트는 반환되지 않습니다. 프로필이 비공개로 설정된 경우 빈 디렉터리이 반환됩니다.이 엔드포인트는 선택된 order_by
옵션에 대해 키텍스트 페이지네이션을 지원합니다.
GET /users/:user_id/projects
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
user_id
| string | 네 | 사용자의 ID 또는 사용자 이름. |
archived
| boolean | 아니요 | 보관된 상태로 제한합니다. |
id_after
| integer | 아니요 | 지정된 ID보다 큰 ID를 가진 프로젝트로 결과를 제한합니다. |
id_before
| integer | 아니요 | 지정된 ID보다 작은 ID를 가진 프로젝트로 결과를 제한합니다. |
membership
| boolean | 아니요 | 현재 사용자가 멤버인 프로젝트로 제한합니다. |
min_access_level
| integer | 아니요 | 현재 사용자의 최소 역할 (access_level )로 제한합니다.
|
order_by
| string | 아니요 |
id , name , path , created_at , updated_at , 또는 last_activity_at 필드로 정렬된 프로젝트를 반환합니다. 기본값은 created_at 입니다.
|
owned
| boolean | 아니요 | 현재 사용자가 명시적으로 소유한 프로젝트로 제한합니다. |
search
| string | 아니요 | 검색 기준과 일치하는 프로젝트 디렉터리을 반환합니다. |
simple
| boolean | 아니요 | 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증 없이 이 작업은 아무런 효과가 없으며 간단한 필드만 반환됩니다. |
sort
| string | 아니요 |
asc 또는 desc 로 정렬된 프로젝트를 반환합니다. 기본값은 desc 입니다.
|
starred
| boolean | 아니요 | 현재 사용자가 즐겨찾기한 프로젝트로 제한합니다. |
statistics
| boolean | 아니요 | 프로젝트 통계를 포함합니다. 적어도 리포터 역할을 가진 사용자에게만 사용할 수 있습니다. |
updated_after
| datetime | 아니요 | 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입되었습니다.
|
updated_before
| datetime | 아니요 | 지정된 시간 이전에 마지막으로 업데이트된 프로젝트로 결과를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입되었습니다.
|
visibility
| string | 아니요 |
public , internal , 또는 private 으로 가시성으로 제한합니다.
|
with_custom_attributes
| boolean | 아니요 | 응답에 사용자 정의 속성을 포함시킵니다. (관리자 전용) |
with_issues_enabled
| boolean | 아니요 | 활성화된 이슈 기능으로 제한합니다. |
with_merge_requests_enabled
| boolean | 아니요 | 활성화된 Merge Request 기능으로 제한합니다. |
with_programming_language
| string | 아니요 | 특정 프로그래밍 언어를 사용하는 프로젝트로 제한합니다. |
[
{
"id": 4,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
"readme_url": "http://example.com/diaspora/diaspora-client/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora client"
],
"topics": [
"example",
"disapora client"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"import_url": null,
"import_type": null,
"import_status": "none",
"import_error": null,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_forward_deployment_rollback_allowed": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_separated_caches": true,
"ci_restrict_pipeline_cancellation_role": "developer",
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": "gitlab/%{id}-%{title}",
"marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on
"marked_for_deletion_on": "2020-04-03",
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
},
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-client",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
},
{
"id": 6,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
"web_url": "http://example.com/brightbox/puppet",
"readme_url": "http://example.com/brightbox/puppet/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"puppet"
],
"topics": [
"example",
"puppet"
],
"owner": {
"id": 4,
"name": "Brightbox",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Puppet",
"name_with_namespace": "Brightbox / Puppet",
"path": "puppet",
"path_with_namespace": "brightbox/puppet",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"import_url": null,
"import_type": null,
"import_status": "none",
"import_error": null,
"namespace": {
"id": 4,
"name": "Brightbox",
"path": "brightbox",
"kind": "group",
"full_path": "brightbox"
},
"import_status": "none",
"archived": false,
"avatar_url": null,
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
"ci_default_git_depth": 0,
"ci_forward_deployment_enabled": true,
"ci_forward_deployment_rollback_allowed": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_separated_caches": true,
"ci_restrict_pipeline_cancellation_role": "developer",
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"repository_storage": "default",
"approvals_before_merge": 0, // Deprecated. Use merge request approvals API instead.
"mirror": false,
"mirror_user_id": 45,
"mirror_trigger_builds": false,
"only_mirror_protected_branches": false,
"mirror_overwrites_diverged_branches": false,
"external_authorization_classification_label": null,
"packages_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": "gitlab/%{id}-%{title}",
"statistics": {
"commit_count": 12,
"storage_size": 2066080,
"repository_size": 2066080,
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
},
"container_registry_image_prefix": "registry.example.com/brightbox/puppet",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
]
사용자가 기여한 프로젝트 디렉터리
지정된 사용자가 기여한 프로젝트의 디렉터리을 가져옵니다.
GET /users/:user_id/contributed_projects
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
user_id
| 문자열 | 예 | 사용자의 ID 또는 사용자 이름입니다. |
order_by
| 문자열 | 아니요 | 프로젝트를 id , name , path , created_at , updated_at , 또는 last_activity_at 필드로 정렬하여 반환합니다. 기본값은 created_at 입니다.
|
simple
| 부울 | 아니요 | 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증되지 않은 경우, 이 작업은 무효이며 단순한 필드만 반환됩니다. |
sort
| 문자열 | 아니요 | 프로젝트를 asc 또는 desc 순서로 정렬하여 반환합니다. 기본값은 desc 입니다.
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/contributed_projects"
예시 응답:
[
{
"id": 4,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
...
},
{
"id": 6,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
"web_url": "http://example.com/brightbox/puppet",
...
}
]
사용자가 스타를 표시한 프로젝트 디렉터리
- 응답의
_links.cluster_agents
속성은 GitLab 14.10에서 도입되었습니다.
지정된 사용자가 스타를 표시한 가시적인 프로젝트 디렉터리을 얻습니다. 인증 없이 접근할 경우 공개 프로젝트만 반환됩니다.
GET /users/:user_id/starred_projects
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
user_id
| 문자열 | 예 | 사용자의 ID 또는 사용자 이름 |
archived
| 부울 | 아니요 | 보관된 상태로 제한 |
membership
| 부울 | 아니요 | 현재 사용자가 회원인 프로젝트로 제한 |
min_access_level
| 정수 | 아니요 | 현재 사용자의 최소 역할 (access_level )로 제한
|
order_by
| 문자열 | 아니요 |
id , name , path , created_at , updated_at , 또는 last_activity_at 필드로 정렬된 프로젝트를 반환합니다. 기본값은 created_at 입니다.
|
owned
| 부울 | 아니요 | 현재 사용자가 명시적으로 소유한 프로젝트로 제한 |
search
| 문자열 | 아니요 | 검색 기준과 일치하는 프로젝트 디렉터리을 반환합니다. |
simple
| 부울 | 아니요 | 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증 없이 이 작업은 무효화됩니다. 간단한 필드만 반환됩니다. |
sort
| 문자열 | 아니요 |
asc 또는 desc 순서로 정렬된 프로젝트를 반환합니다. 기본값은 desc 입니다.
|
starred
| 부울 | 아니요 | 현재 사용자가 스타를 표시한 프로젝트로 제한 |
statistics
| 부울 | 아니요 | 프로젝트 통계를 포함합니다. 적어도 기록자 역할을 가진 사용자에게만 사용할 수 있습니다. |
updated_after
| 날짜 및 시간 | 아니요 | 지정된 시간 이후에 마지막으로 업데이트된 프로젝트를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입되었습니다.
|
updated_before
| 날짜 및 시간 | 아니요 | 지정된 시간 이전에 마지막으로 업데이트된 프로젝트를 제한합니다. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입되었습니다.
|
visibility
| 문자열 | 아니요 |
public , internal , 또는 private 가시성으로 제한
|
with_custom_attributes
| 부울 | 아니요 | 응답에 사용자 정의 속성을 포함합니다. (관리자 전용) |
with_issues_enabled
| 부울 | 아니요 | 활성화된 이슈 기능으로 제한 |
with_merge_requests_enabled
| 부울 | 아니요 | 활성화된 Merge Request 기능으로 제한 |
curl -H "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/starred_projects"
예시 응답:
[
{
"id": 4,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
"readme_url": "http://example.com/diaspora/diaspora-client/blob/main/README.md",
"topics": [
"example",
"disapora client"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
// 기타 속성 생략
},
{
"id": 6,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
"web_url": "http://example.com/brightbox/puppet",
"readme_url": "http://example.com/brightbox/puppet/blob/main/README.md",
"topics": [
"example",
"puppet"
],
"owner": {
"id": 4,
"name": "Brightbox",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Puppet",
"name_with_namespace": "Brightbox / Puppet",
"path": "puppet",
"path_with_namespace": "brightbox/puppet",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
// 기타 속성 생략
}
]
단일 프로젝트 가져오기
- 응답의
_links.cluster_agents
속성은 GitLab 14.10에서 도입되었습니다.
특정 프로젝트를 가져옵니다. 이 엔드포인트는 프로젝트가 공개적으로 접근 가능한 경우에는 인증 없이 액세스할 수 있습니다.
GET /projects/:id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩 경로. |
license
| 부울값 | 아니오 | 프로젝트 라이선스 데이터를 포함합니다. |
statistics
| 부울값 | 아니오 | 프로젝트 통계를 포함합니다. 적어도 기록자 역할(Role)을 가진 사용자에게만 사용 가능합니다. |
with_custom_attributes
| 부울값 | 아니오 | 응답에 사용자 정의 속성를 포함합니다. (관리자 전용) |
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"container_expiration_policy": {
"cadence": "7d",
"enabled": false,
"keep_n": null,
"older_than": null,
"name_regex": null, // to be deprecated in GitLab 13.0 in favor of `name_regex_delete`
"name_regex_delete": null,
"name_regex_keep": null,
"next_run_at": "2020-01-07T21:42:58.658Z"
},
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora",
"avatar_url": "http://localhost:3000/uploads/group/avatar/3/foo.jpg",
"web_url": "http://localhost:3000/groups/diaspora"
},
"import_url": null,
"import_type": null,
"import_status": "none",
"import_error": null,
"permissions": {
"project_access": {
"access_level": 10,
"notification_level": 3
},
"group_access": {
"access_level": 50,
"notification_level": 3
}
},
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
"license": {
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"nickname": "GNU LGPLv3",
"html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_forward_deployment_rollback_allowed": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_separated_caches": true,
"ci_restrict_pipeline_cancellation_role": "developer",
"public_jobs": true,
"shared_with_groups": [
{
"group_id": 4,
"group_name": "Twitter",
"group_full_path": "twitter",
"group_access_level": 30
},
{
"group_id": 3,
"group_name": "Gitlab Org",
"group_full_path": "gitlab-org",
"group_access_level": 10
}
],
"repository_storage": "default",
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"printing_merge_requests_link_enabled": true,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"approvals_before_merge": 0, // Deprecated. Use merge request approvals API instead.
"mirror": false,
"mirror_user_id": 45,
"mirror_trigger_builds": false,
"only_mirror_protected_branches": false,
"mirror_overwrites_diverged_branches": false,
"external_authorization_classification_label": null,
"packages_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"autoclose_referenced_issues": true,
"suggestion_commit_message": null,
"enforce_auth_checks_on_uploads": true,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": "gitlab/%{id}-%{title}",
"marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on
"marked_for_deletion_on": "2020-04-03",
"compliance_frameworks": [ "sox" ],
"warn_about_potentially_unwanted_characters": true,
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
},
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-client",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
GitLab Ultimate 사용자는 GitLab 15.5 및 이후 버전에서 only_allow_merge_if_all_status_checks_passed
매개변수도 볼 수 있습니다.
{
"id": 1,
"project_id": 3,
"only_allow_merge_if_all_status_checks_passed": false,
...
}
프로젝트가 fork된 경우, 응답에 forked_from_project
필드가 나타납니다.
이 경우, 원본 프로젝트가 비공개인 경우 유효한 인증 토큰이 제공되어야 합니다.
또한 mr_default_target_self
필드가 나타납니다. 이 값이 false
이면 모든 Merge Request이 기본적으로 상위 프로젝트를 대상으로 합니다.
{
"id":3,
...
"mr_default_target_self": false,
"forked_from_project":{
"id":13083,
"description":"GitLab Community Edition",
"name":"GitLab Community Edition",
"name_with_namespace":"GitLab.org / GitLab Community Edition",
"path":"gitlab-foss",
"path_with_namespace":"gitlab-org/gitlab-foss",
"created_at":"2013-09-26T06:02:36.000Z",
"default_branch":"main",
"tag_list":[], //deprecated, use `topics` instead
"topics":[],
"ssh_url_to_repo":"git@gitlab.com:gitlab-org/gitlab-foss.git",
"http_url_to_repo":"https://gitlab.com/gitlab-org/gitlab-foss.git",
"web_url":"https://gitlab.com/gitlab-org/gitlab-foss",
"avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/13083/logo-extra-whitespace.png",
"license_url": "https://gitlab.com/gitlab-org/gitlab/-/blob/main/LICENSE",
"license": {
"key": "mit",
"name": "MIT License",
"nickname": null,
"html_url": "http://choosealicense.com/licenses/mit/",
"source_url": "https://opensource.org/licenses/MIT"
},
"star_count":3812,
"forks_count":3561,
"last_activity_at":"2018-01-02T11:40:26.570Z",
"namespace": {
"id": 72,
"name": "GitLab.org",
"path": "gitlab-org",
"kind": "group",
"full_path": "gitlab-org",
"parent_id": null
},
"repository_storage": "default"
}
...
}
이슈 및 Merge Request을 위한 템플릿
GitLab Premium 또는 Ultimate 사용자는 이슈 및 Merge Request 설명 템플릿 관리를 위한 issues_template
및 merge_requests_template
매개변수를 볼 수도 있습니다.
{
"id": 3,
"issues_template": null,
"merge_requests_template": null,
...
}
프로젝트 사용자 가져오기
프로젝트 사용자 디렉터리을 가져옵니다.
GET /projects/:id/users
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL로 인코딩된 경로. |
search
| 문자열 | 아니요 | 특정 사용자를 검색합니다. |
skip_users
| 정수 배열 | 아니요 | 지정된 ID를 가진 사용자를 걸러냅니다. |
[
{
"id": 1,
"username": "john_smith",
"name": "John Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"web_url": "http://localhost:3000/john_smith"
},
{
"id": 2,
"username": "jack_smith",
"name": "Jack Smith",
"state": "blocked",
"avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
"web_url": "http://localhost:3000/jack_smith"
}
]
프로젝트의 그룹 디렉터리
이 프로젝트의 상위 그룹 디렉터리을 가져옵니다.
GET /projects/:id/groups
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL로 인코딩된 경로. |
search
| 문자열 | 아니요 | 특정 그룹을 검색합니다. |
shared_min_access_level
| 정수 | 아니요 | 적어도 이 역할 (access_level )을 가진 공유 그룹으로 제한합니다.
|
shared_visible_only
| 부울 | 아니요 | 접근 권한이 있는 공유 그룹으로 제한합니다. |
skip_groups
| 정수 배열 | 아니요 | 전달된 그룹 ID를 건너뜁니다. |
with_shared
| 부울 | 아니요 | 해당 그룹과 공유된 프로젝트를 포함합니다. 기본값은 false 입니다.
|
[
{
"id": 1,
"name": "Foobar Group",
"avatar_url": "http://localhost:3000/uploads/group/avatar/1/foo.jpg",
"web_url": "http://localhost:3000/groups/foo-bar",
"full_name": "Foobar Group",
"full_path": "foo-bar"
},
{
"id": 2,
"name": "Shared Group",
"avatar_url": "http://gitlab.example.com/uploads/group/avatar/1/bar.jpg",
"web_url": "http://gitlab.example.com/groups/foo/bar",
"full_name": "Shared Group",
"full_path": "foo/shared"
}
]
프로젝트의 공유 가능한 그룹 디렉터리 가져오기
프로젝트와 공유할 수 있는 그룹 디렉터리을 가져옵니다
GET /projects/:id/share_locations
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL로 인코딩된 경로. |
search
| 문자열 | 아니요 | 특정 그룹을 검색합니다. |
[
{
"id": 22,
"web_url": "http://127.0.0.1:3000/groups/gitlab-org",
"name": "Gitlab Org",
"avatar_url": null,
"full_name": "Gitlab Org",
"full_path": "gitlab-org"
},
{
"id": 25,
"web_url": "http://127.0.0.1:3000/groups/gnuwget",
"name": "Gnuwget",
"avatar_url": null,
"full_name": "Gnuwget",
"full_path": "gnuwget"
}
]
프로젝트 이벤트 가져오기
이벤트 API 문서를 참조하세요.
프로젝트 생성
인증된 사용자가 소유한 새 프로젝트를 만듭니다.
HTTP 리포지터리가 공개적으로 접근할 수 없는 경우, URL에 https://username:password@gitlab.company.com/group/project.git
인증 정보를 추가하여,
password
가 api
범위가 활성화된 공개 액세스 키인 경우입니다.
POST /projects
예시 요청:
curl --request POST --header "PRIVATE-TOKEN: <your-token>" \
--header "Content-Type: application/json" --data '{
"name": "new_project", "description": "New Project", "path": "new_project",
"namespace_id": "42", "initialize_with_readme": "true"}' \
--url "https://gitlab.example.com/api/v4/projects/"
속성 | 타입 | 필요 | 설명 |
---|---|---|---|
name
| 문자열 | (만약 path 가 제공되지 않은 경우)
| 새 프로젝트의 이름. 제공되지 않은 경우 경로와 동일합니다. |
path
| 문자열 | (만약 name 이 제공되지 않은 경우)
| 새 프로젝트의 리포지터리 이름. 제공되지 않은 경우 이름을 기반으로 생성됩니다. (대시로 구분된 소문자로 생성됨) GitLab 14.9를 시작으로 경로는 특수 문자로 시작 또는 끝나면 안 되며 연속된 특수 문자를 포함해서는 안 됩니다. |
allow_merge_on_skipped_pipeline
| 부울 | 아니요 | 건너뛴 작업이 있는 경우 Merge Request을 Merge할 수 있는지 여부를 설정합니다. |
analytics_access_level
| 문자열 | 아니요 |
비활성화 , 개인 , 또는 활성화 중 하나
|
approvals_before_merge
| 정수 | 아니요 | 기본적으로 Merge Request을 승인해야 하는 승인자 수입니다. 승인 규칙을 설정하려면 Merge Request 승인 API를 참조하세요. GitLab 16.0에서 사용되지 않음. Premium 및 Ultimate 전용 |
auto_cancel_pending_pipelines
| 문자열 | 아니요 | 보류 중인 파이프라인을 자동으로 취소합니다. 이 동작은 활성화 및 비활성화 상태 사이를 토글합니다. 부울형이 아닙니다. |
auto_devops_deploy_strategy
| 문자열 | 아니요 | 자동 배포 전략 (연속 , 매뉴얼 , 또는 타임드_인크리멘탈 )
|
auto_devops_enabled
| 부울 | 아니요 | 이 프로젝트에 대해 Auto DevOps를 활성화합니다. |
autoclose_referenced_issues
| 부울 | 아니요 | 기본 브랜치에서 참조된 이슈를 자동으로 닫을지 여부를 설정합니다. |
avatar
| 믹스 | 아니요 | 프로젝트의 아바타 이미지 파일 |
build_git_strategy
| 문자열 | 아니요 | Git 전략. 기본값은 fetch 입니다.
|
build_timeout
| 정수 | 아니요 | 작업이 실행될 수 있는 최대 시간(초)입니다. |
builds_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
ci_config_path
| 문자열 | 아니요 | CI 구성 파일의 경로 |
container_expiration_policy_attributes
| 해시 | 아니요 | 이 프로젝트의 이미지 정리 정책을 업데이트합니다. cadence (문자열), keep_n (정수), older_than (문자열), name_regex (문자열), name_regex_delete (문자열), name_regex_keep (문자열), enabled (부울)을 수용합니다. 자세한 내용은 container registry 문서를 참조하세요.
|
container_registry_access_level
| 문자열 | 아니요 | 이 프로젝트의 컨테이너 레지스트리 가시성을, 비활성화 , 비공개 , 또는 활성화 중 하나로 설정합니다.
|
container_registry_enabled
| 부울 | 아니요 |
(사용되지 않음) 이 프로젝트에 대해 컨테이너 레지스트리를 활성화합니다. 대신 container_registry_access_level 을 사용하세요.
|
default_branch
| 문자열 | 아니요 |
기본 브랜치 이름. initialize_with_readme 가 true 여야 합니다.
|
description
| 문자열 | 아니요 | 프로젝트에 대한 짧은 설명 |
emails_disabled
| 부울 | 아니요 |
(사용되지 않음) 이메일 알림을 비활성화합니다. 대신 emails_enabled 를 사용하세요
|
emails_enabled
| 부울 | 아니요 | 이메일 알림을 활성화합니다. |
environments_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
external_authorization_classification_label
| 문자열 | 아니요 | 프로젝트의 분류 라벨. Premium 및 Ultimate 전용 |
feature_flags_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
forking_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
group_runners_enabled
| 부울 | 아니요 | 이 프로젝트에 대해 그룹 러너를 활성화합니다. |
group_with_project_templates_id
| 정수 | 아니요 | 그룹 수준 사용자 정의 템플릿을 위해, 모든 사용자 정의 프로젝트 템플릿이 소스인 그룹의 ID를 지정합니다. 인스턴스 수준 템플릿의 경우 비워둡니다. 사용자 정의 템플릿을 사용하려면 use_custom_template 이 true여야 합니다. Premium 및 Ultimate 전용
|
import_url
| 문자열 | 아니요 | 가져올 리포지터리의 URL. URL 값이 비어 있지 않으면 initialize_with_readme 를 true 로 설정하면 안 됩니다. 이러한 경우 다음 오류를 일으킬 수 있습니다: git 리포지터리가 아님 .
|
infrastructure_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
initialize_with_readme
| 부울 | 아니요 |
README.md 파일만 있는 Git 리포지터리를 만들지 여부. 기본값은 false 입니다. 이 부울이 true인 경우 리포지터리의 대체 내용을 지정하는 이 엔드포인트의 다른 속성을 전달해서는 안 됩니다. 이러한 경우 다음 오류를 일으킬 수 있습니다: git 리포지터리가 아님 .
|
issues_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
issues_enabled
| 부울 | 아니요 |
(사용되지 않음) 이 프로젝트에 대해 이슈를 활성화합니다. issues_access_level 을 사용하세요.
|
jobs_enabled
| 부울 | 아니요 |
(사용되지 않음) 이 프로젝트에 대해 작업을 활성화합니다. builds_access_level 을 사용하세요.
|
lfs_enabled
| 부울 | 아니요 | LFS를 활성화합니다. |
merge_method
| 문자열 | 아니요 | 사용되는 Merge 방법을 설정합니다. |
merge_pipelines_enabled
| 부울 | 아니요 | Merge된 결과 파이프라인을 활성화 또는 비활성화합니다. |
merge_requests_access_level
| 문자열 | 아니요 |
비활성화 , 비공개 , 또는 활성화 중 하나
|
merge_requests_enabled
| 부울 | 아니요 |
(사용되지 않음) 이 프로젝트에 대해 Merge Request을 활성화합니다. merge_requests_access_level 을 사용하세요.
|
merge_trains_enabled
| 부울 | 아니요 | Merge Train을 활성화 또는 비활성화합니다. |
mirror_trigger_builds
| 부울 | 아니요 | 풀 미러링이 트리거를 발생시키도록합니다. Premium 및 Ultimate 전용 |
mirror
| 부울 | 아니요 | 프 |
사용자를 위한 프로젝트 생성
지정된 사용자가 소유한 새 프로젝트를 생성합니다. 관리자 전용으로 사용 가능합니다.
만약 HTTP 리포지터리에 공개적으로 접근할 수 없다면, URL https://username:password@gitlab.company.com/group/project.git
에 인증 정보를 추가하세요. 여기서 password
는 api
범위가 활성화된 공개 액세스 키입니다.
POST /projects/user/:user_id
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
name
| string | 예 | 새 프로젝트의 이름입니다. |
user_id
| integer | 예 | 프로젝트 소유자의 사용자 ID입니다. |
allow_merge_on_skipped_pipeline
| boolean | 아니오 | 건너뛴 작업으로 Merge Request을 Merge할 수 있는지 여부를 설정합니다. |
analytics_access_level
| string | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
… (중략) | … | … | … |
:::TabTitle 소스 브랜치에서 대상 브랜치로 변경 내용을 통합하는 제안입니다. :::EndTab
프로젝트 수정
기존 프로젝트를 업데이트합니다.
만약 HTTP 리포지터리에 공개적으로 접근할 수 없는 경우 아래 URL에 인증 정보를 추가하세요. https://username:password@gitlab.company.com/group/project.git
여기서 password
는 api
스코프가 활성화된 공개 액세스 키입니다.
PUT /projects/:id
예를 들어, GitLab.com 프로젝트에서 공유 러너 설정 전환을 위한 설정을 변경하려면:
curl --request PUT --header "PRIVATE-TOKEN: <your-token>" \
--url "https://gitlab.com/api/v4/projects/<your-project-ID>" \
--data "shared_runners_enabled=true" # 끄려면: "shared_runners_enabled=false"
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
allow_merge_on_skipped_pipeline
| 부울 | 아니오 | 무시된 작업으로 머지 요청을 Merge할 수 있는지 여부를 설정합니다. |
allow_pipeline_trigger_approve_deployment
| 부울 | 아니오 | 파이프라인 트리거가 배포를 승인할 수 있는지 여부를 설정합니다. Premium 및 Ultimate 전용. |
only_allow_merge_if_all_status_checks_passed
| 부울 | 아니오 | 모든 상태 확인이 통과하지 않으면 머지 요청의 머지가 차단되어야 하는지 여부를 나타냅니다. 기본값은 false입니다. [GitLab 15.5에서 기능 깃발 only_allow_merge_if_all_status_checks_passed 가 기본으로 비활성화되어 소개되었으며, GitLab 15.9에서 기능 깃발이 기본으로 활성화되었습니다. Ultimate 전용입니다.
|
analytics_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
approvals_before_merge
| 정수 | 아니오 | 기본적으로 몇 명의 승인자가 머지 요청을 승인해야 하는지 나타냅니다. GitLab 16.0에서 폐기됨 . 승인 규칙을 구성하려면 머지 요청 승인 API를 참조하세요. Premium 및 Ultimate 전용. |
auto_cancel_pending_pipelines
| 문자열 | 아니오 | 보류 중인 파이프라인을 자동으로 취소합니다. 이 동작은 활성 상태와 비활성 상태 사이를 토글합니다. 부울 값이 아닙니다. |
auto_devops_deploy_strategy
| 문자열 | 아니오 | Auto DevOps 배포 전략(continuous , manual , 또는 timed_incremental ).
|
auto_devops_enabled
| 부울 | 아니오 | 이 프로젝트에 대해 Auto DevOps를 활성화합니다. |
autoclose_referenced_issues
| 부울 | 아니오 | 기본 브랜치의 참조된 이슈를 자동으로 닫을지 여부를 설정합니다. |
avatar
| 혼합 | 아니오 | 프로젝트 아바타를 위한 이미지 파일입니다. |
build_git_strategy
| 문자열 | 아니오 | Git 전략입니다. 기본값은 fetch 입니다.
|
build_timeout
| 정수 | 아니오 | 작업이 실행될 수 있는 최대 시간(초)입니다. |
builds_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
ci_config_path
| 문자열 | 아니오 | CI 구성 파일의 경로입니다. |
ci_default_git_depth
| 정수 | 아니오 | 얕은 복제의 기본 리비전 수입니다. |
ci_forward_deployment_enabled
| 부울 | 아니오 | 진행 중인 배포 작업 방지을 활성화 또는 비활성화합니다. |
ci_forward_deployment_rollback_allowed
| 부울 | 아니오 | 롤백 배포를 위한 작업 재시도를 허용합니다. |
ci_allow_fork_pipelines_to_run_in_parent_project
| 부울 | 아니오 | 포크된 머지 요청의 경우 상위 프로젝트에서 파이프라인을 실행을 활성화 또는 비활성화합니다. (GitLab 15.3에서 도입됨) . |
ci_separated_caches
| 부울 | 아니오 | 캐시를 브랜치 보호 상태별로 구분하는지 여부를 설정합니다. |
ci_restrict_pipeline_cancellation_role
| 문자열 | 아니오 | 파이프라인 또는 작업을 취소하려면 필요한 역할을 설정합니다. developer , maintainer , 또는 no_one 중 하나입니다. GitLab 16.8에 도입됨 . Premium 및 Ultimate 전용.
|
container_expiration_policy_attributes
| 해시 | 아니오 | 프로젝트의 이미지 정리 정책을 업데이트합니다. cadence (문자열), keep_n (정수), older_than (문자열), name_regex (문자열), name_regex_delete (문자열), name_regex_keep (문자열), enabled (부울)을 허용합니다.
|
container_registry_access_level
| 문자열 | 아니오 | 이 프로젝트의 컨테이너 레지스트리 가시성을 disabled , private , 또는 enabled 중 하나로 설정합니다.
|
container_registry_enabled
| 부울 | 아니오 | (폐기됨) 이 프로젝트의 컨테이너 레지스트리를 활성화합니다. 대신 container_registry_access_level 을 사용하세요.
|
default_branch
| 문자열 | 아니오 | 기본 브랜치 이름입니다. |
description
| 문자열 | 아니오 | 짧은 프로젝트 설명입니다. |
emails_disabled
| 부울 | 아니오 | (폐기됨) 이메일 알림을 비활성화합니다. 대신 emails_enabled 을 사용하세요.
|
emails_enabled
| 부울 | 아니오 | 이메일 알림을 활성화합니다. |
enforce_auth_checks_on_uploads
| 부울 | 아니오 | 업로드에서 인증 확인을 강화합니다. |
external_authorization_classification_label
| 문자열 | 아니오 | 프로젝트의 분류 레이블입니다. Premium 및 Ultimate 전용. |
forking_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
group_runners_enabled
| 부울 | 아니오 | 이 프로젝트를 위한 그룹 러너를 활성화합니다.. |
import_url
| 문자열 | 아니오 | 리포지터리가 가져온 URL입니다. |
issues_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
issues_enabled
| 부울 | 아니오 | (폐기됨) 이 프로젝트의 이슈를 활성화합니다. issues_access_level 을 사용하세요.
|
issues_template
| 문자열 | 아니오 | 이슈에 대한 기본 설명입니다. 설명은 GitLab Flavored Markdown로 구문 분석됩니다. 이슈 및 머지 요청을 위한 템플릿을 참조하세요. Premium 및 Ultimate 전용. |
jobs_enabled
| 부울 | 아니오 | (폐기됨) 이 프로젝트의 작업을 활성화합니다. 대신 builds_access_level 을 사용하세요.
|
keep_latest_artifact
| 부울 | 아니오 | 이 프로젝트의 최신 아티팩트 유지 기능을 사용 또는 사용 안함으로 설정합니다. |
lfs_enabled
| 부울 | 아니오 | LFS를 활성화합니다. |
merge_commit_template
| 문자열 | 아니오 | 머지 요청에서 머지 커밋 메시지를 생성하는 데 사용할 템플릿입니다. (GitLab 14.5에 도입됨) |
merge_method
| 문자열 | 아니오 | 사용할 머지 방법을 설정합니다. |
merge_pipelines_enabled
| 부울 | 아니오 | Merge된 결과 파이프라인을 활성화 또는 비활성화합니다. |
merge_requests_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
merge_requests_enabled
| 부울 | 아니오 | (폐기됨) 이 프로젝트의 머지 요청을 활성화합니다. merge_requests_access_level 을 사용하세요.
|
merge_requests_template
| 문자열 | 아니오 | 머지 요청에 대한 기본 설명입니다. 설명은 GitLab Flavored Markdown로 구문 분석됩니다. 이슈 및 머지 요청을 위한 템플릿을 참조하세요. Premium 및 Ultimate 전용. |
merge_trains_enabled
| 부울 | 아니오 | 머지 트레인을 활성화 또는 비활성화합니다. |
mirror_overwrites_diverged_branches
| 부울 | 아니오 | 풀 미러가 분기된 브랜치를 덮어쓰도록 설정합니다. Premium 및 Ultimate 전용. |
mirror_trigger_builds
| 부울 | 아니오 | 풀 미러링이 빌드를 트리거하도록 설정합니다. Premium 및 Ultimate 전용. |
mirror_user_id
| 정수 | 아니오 | 풀 미러 이벤트 주변의 모든 활동에 대한 책임을 지는 사용자입니다. (관리자 전용) Premium 및 Ultimate 전용. |
mirror
| 부울 | 아니오 | 프로젝트에서 풀 미러링을 활성화합니다. Premium 및 Ultimate 전용. |
mr_default_target_self
| 부울 | 아니오 | 포크된 프로젝트의 경우 머지 요청의 대상을 이 프로젝트로 설정합니다. false 이면 대상은 상위 프로젝트입니다.
|
name
| 문자열 | 아니오 | 프로젝트 이름입니다. |
only_allow_merge_if_all_discussions_are_resolved
| 부울 | 아니오 | 모든 토론이 해결된 경우에만 머지 요청을 허용할지 설정합니다. |
only_allow_merge_if_pipeline_succeeds
| 부울 | 아니오 | 성공한 작업으로만 머지 요청을 허용할지 설정합니다. |
only_mirror_protected_branches
| 부울 | 아니오 | 보호된 브랜치만 풀 미러링합니다. Premium 및 Ultimate 전용. |
packages_enabled
| 부울 | 아니오 | 패키지 리포지터리 기능을 활성화 또는 비활성화합니다. |
pages_access_level
| 문자열 | 아니오 |
disabled , private , enabled , 또는 public 중 하나입니다.
|
path
| 문자열 | 아니오 | 프로젝트의 사용자 정의 리포지터리 이름입니다. 기본적으로 이름을 기반으로 생성됩니다. |
prevent_merge_without_jira_issue
| 부울 | 아니오 | 머지 요청이 연관된 Jira 이슈를 요구하는지 설정합니다. Premium 및 Ultimate 전용. |
printing_merge_request_link_enabled
| 부울 | 아니오 | 명령줄에서 푸시할 때 머지 요청을 만들거나 보는 링크를 표시합니다. |
public_builds
| 부울 | 아니오 | (폐기됨) true 이면 프로젝트 외부 사용자가 작업을 볼 수 있습니다. public_jobs 을 사용하세요.
|
public_jobs
| 부울 | 아니오 |
true 이면 프로젝트 외부 사용자가 작업을 볼 수 있습니다.
|
releases_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
environments_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
feature_flags_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
infrastructure_access_level
| 문자열 | 아니오 |
disabled , private , 또는 enabled 중 하나입니다.
|
monitor_access_level
| 문자열 | 아니 |
프로젝트 포크
인증된 사용자의 사용자 이름 공간 또는 제공된 사용자의 사용자 이름 공간에 프로젝트를 포크합니다.
프로젝트의 포크 작업은 비동기적으로 진행되며 백그라운드 작업으로 완료됩니다. 요청은 즉시 반환됩니다. 프로젝트의 포크가 완료되었는지 확인하려면 새 프로젝트의 import_status
를 조회하십시오.
POST /projects/:id/fork
속성 | 유형 | 필수여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
branches
| 문자열 | 아니오 | 포크할 브랜치(모든 브랜치의 경우 비어 둡니다). |
description
| 문자열 | 아니오 | 포크 후 결과 프로젝트에 할당된 설명. |
mr_default_target_self
| 부울 | 아니오 | 포크된 프로젝트의 경우 본 프로젝트로 대상 Merge Request. false 인 경우 대상은 상위 프로젝트입니다.
|
name
| 문자열 | 아니오 | 포크 후 결과 프로젝트에 할당된 이름. |
namespace_id
| 정수 | 아니오 | 프로젝트의 포크가 생성된 네임스페이스의 ID. |
namespace_path
| 문자열 | 아니오 | 프로젝트의 포크가 생성된 네임스페이스의 경로. |
namespace
| 정수 또는 문자열 | 아니오 | (사용되지 않음) 프로젝트의 포크가 생성된 네임스페이스의 ID 또는 경로. |
path
| 문자열 | 아니오 | 포크 후 결과 프로젝트에 할당된 경로. |
visibility
| 문자열 | 아니오 | 포크 후 결과 프로젝트에 할당된 가시성 수준. |
프로젝트의 포크 디렉터리
- 응답에서
_links.cluster_agents
속성은 GitLab 14.10에서 추가되었습니다.
지정된 프로젝트와 설정된 포크된 관계를 가진 호출자의 접근 가능한 프로젝트를 나열합니다.
GET /projects/:id/forks
속성 | 유형 | 필수여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
archived
| 부울 | 아니오 | 보관된 상태로 제한. |
membership
| 부울 | 아니오 | 현재 사용자가 구성원인 프로젝트로 제한. |
min_access_level
| 정수 | 아니오 | 현재 사용자의 최소 역할 (access_level )로 제한.
|
order_by
| 문자열 | 아니오 |
id , name , path , created_at , updated_at , 또는 last_activity_at 필드로 프로젝트를 반환합니다. 기본값은 created_at 입니다.
|
owned
| 부울 | 아니오 | 현재 사용자가 명시적으로 소유한 프로젝트로 제한. |
search
| 문자열 | 아니오 | 검색 기준과 일치하는 프로젝트 디렉터리 반환. |
simple
| 부울 | 아니오 | 각 프로젝트에 대해 제한된 필드만 반환합니다. 인증되지 않은 경우, 이 작업은 무효입니다. 간단한 필드만 반환됩니다. |
sort
| 문자열 | 아니오 |
asc 또는 desc 순으로 정렬된 프로젝트를 반환합니다. 기본값은 desc 입니다.
|
starred
| 부울 | 아니오 | 현재 사용자가 별표를 붙인 프로젝트로 제한. |
statistics
| 부울 | 아니오 | 프로젝트 통계 포함. 최소한의 Reporter 역할을 가진 사용자만 사용할 수 있습니다. |
updated_after
| 날짜 및 시간 | 아니오 | 지정된 시간 이후에 마지막으로 업데이트된 프로젝트로 결과 제한. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입됨.
|
updated_before
| 날짜 및 시간 | 아니오 | 지정된 시간 이전에 마지막으로 업데이트된 프로젝트로 결과 제한. 형식: ISO 8601 (YYYY-MM-DDTHH:MM:SSZ ). GitLab 15.10에서 도입됨.
|
visibility
| 문자열 | 아니오 |
public , internal , 또는 private 가시성으로 제한.
|
with_custom_attributes
| 부울 | 아니오 | 응답에 사용자 정의 속성을 포함합니다. (관리자 전용) |
with_issues_enabled
| 부울 | 아니오 | 활성화된 이슈 기능으로 제한. |
with_merge_requests_enabled
| 부울 | 아니오 | 활성화된 Merge Request 기능으로 제한. |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/forks"
응답 예시:
[
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "internal",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //사용되지 않음, 대신 `topics` 사용
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"repository_object_format": "sha1",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, //사용않음, 대신 container_registry_access_level 사용
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"archived": true,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 1,
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
]
프로젝트에 별표 표시하기
- 응답에서
_links.cluster_agents
속성은 GitLab 14.10에서 소개되었습니다.
주어진 프로젝트에 별표를 표시합니다. 프로젝트에 이미 별표가 표시된 경우 상태 코드 304
를 반환합니다.
POST /projects/:id/star
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/star"
예시 응답:
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "internal",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"repository_object_format": "sha1",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, //deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"archived": true,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
"license": {
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"nickname": "GNU LGPLv3",
"html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 1,
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
프로젝트에서 별표 제거하기
- 응답에서
_links.cluster_agents
속성은 GitLab 14.10에서 소개되었습니다.
주어진 프로젝트의 별표를 제거합니다. 프로젝트에 이미 별표가 표시되지 않은 경우 상태 코드 304
를 반환합니다.
POST /projects/:id/unstar
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unstar"
예시 응답:
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "internal",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"repository_object_format": "sha1",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, //deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"archived": true,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
"license": {
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"nickname": "GNU LGPLv3",
"html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
프로젝트 스타를 지정하기
지정된 프로젝트를 스타 처리한 사용자의 디렉터리을 나열합니다.
GET /projects/:id/starrers
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL 인코딩된 경로. |
search
| string | No | 특정 사용자를 검색합니다. |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/starrers"
예시 응답:
[
{
"starred_since": "2019-01-28T14:47:30.642Z",
"user": {
"id": 1,
"username": "jane_smith",
"name": "Jane Smith",
"state": "active",
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"web_url": "http://localhost:3000/jane_smith"
}
},
{
"starred_since": "2018-01-02T11:40:26.570Z",
"user": {
"id": 2,
"username": "janine_smith",
"name": "Janine Smith",
"state": "blocked",
"avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
"web_url": "http://localhost:3000/janine_smith"
}
}
]
사용된 언어
프로젝트에서 사용된 언어 및 해당 언어의 백분율 값을 가져옵니다.
GET /projects/:id/languages
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL 인코딩된 경로. |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/languages"
예시 응답:
{
"Ruby": 66.69,
"JavaScript": 22.98,
"HTML": 7.91,
"CoffeeScript": 2.42
}
프로젝트 보관
- 응답에 있는
_links.cluster_agents
속성은 GitLab 14.10에서 소개되었습니다.
사용자가 관리자이거나 이 프로젝트의 소유자인 경우 프로젝트를 보관합니다. 이 작업은 멱등성을 가지므로 이미 보관된 프로젝트를 보관하면 프로젝트에 변경이 발생하지 않습니다.
POST /projects/:id/archive
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL 인코딩된 경로. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/archive"
예시 응답:
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"repository_object_format": "sha1",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"import_error": null,
"permissions": {
"project_access": {
"access_level": 10,
"notification_level": 3
},
"group_access": {
"access_level": 50,
"notification_level": 3
}
},
"archived": true,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
"license": {
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"nickname": "GNU LGPLv3",
"html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_forward_deployment_rollback_allowed": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_separated_caches": true,
"ci_restrict_pipeline_cancellation_role": "developer",
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
프로젝트 해제
- 응답에서
_links.cluster_agents
속성은 GitLab 14.10에서 소개되었습니다.
사용자가 관리자이거나 이 프로젝트의 소유자인 경우 프로젝트를 해제합니다. 이 작업은 멱등성을 가지므로 비아카이브된 프로젝트를 다시 해제하더라도 프로젝트가 변경되지 않습니다.
POST /projects/:id/unarchive
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unarchive"
예시 응답:
{
"id": 3,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"default_branch": "main",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git",
"web_url": "http://example.com/diaspora/diaspora-project-site",
"readme_url": "http://example.com/diaspora/diaspora-project-site/blob/main/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora project"
],
"topics": [
"example",
"disapora project"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Project Site",
"name_with_namespace": "Diaspora / Diaspora Project Site",
"path": "diaspora-project-site",
"path_with_namespace": "diaspora/diaspora-project-site",
"repository_object_format": "sha1",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"updated_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
},
"import_status": "none",
"import_error": null,
"permissions": {
"project_access": {
"access_level": 10,
"notification_level": 3
},
"group_access": {
"access_level": 50,
"notification_level": 3
}
},
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"license_url": "http://example.com/diaspora/diaspora-client/blob/main/LICENSE",
"license": {
"key": "lgpl-3.0",
"name": "GNU Lesser General Public License v3.0",
"nickname": "GNU LGPLv3",
"html_url": "http://choosealicense.com/licenses/lgpl-3.0/",
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
"group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
"ci_default_git_depth": 50,
"ci_forward_deployment_enabled": true,
"ci_forward_deployment_rollback_allowed": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_separated_caches": true,
"ci_restrict_pipeline_cancellation_role": "developer",
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-project-site",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
}
프로젝트 삭제
- GitLab 12.6의 기본 동작인 지연된 프로젝트 삭제가 GitLab 13.2에서 즉시 삭제로 변경되었습니다.
이 엔드포인트:
- 프로젝트 및 관련 리소스 (이슈 및 Merge Request 포함)를 삭제합니다.
- GitLab 12.6 및 그 이후, Premium 또는 Ultimate 티어에서 활성화된 경우 지연된 프로젝트 삭제가 적용됩니다.
-
GitLab 15.11부터는 Premium 또는 Ultimate 티어에서 프로젝트가 이미 삭제로 표시된 경우
permanently_remove
및full_path
매개변수가 전달되면 프로젝트가 즉시 삭제됩니다. - GitLab 16.0부터는 Premium 또는 Ultimate 티어에서 지연된 프로젝트 삭제가 기본으로 활성화됩니다. 기본 삭제 지연에 지정된 날짜 이후에 삭제가 수행됩니다 (기본 삭제 지연 참조).
DELETE /projects/:id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
full_path
| 문자열 | 아니오 |
permanently_remove 와 함께 사용할 프로젝트의 전체 경로. GitLab 15.11에서 도입. 프로젝트 경로를 찾으려면 단일 프로젝트 가져오기에서 path_with_namespace 를 사용하십시오. 오직 Premium 및 Ultimate에서만 사용 가능.
|
permanently_remove
| 부울/문자열 | 아니오 | 프로젝트가 삭제로 표시된 경우 즉시 프로젝트를 삭제합니다. GitLab 15.11에서 도입. Premium 및 Ultimate에서만 사용 가능. |
삭제 표시된 프로젝트 복원
- GitLab 12.6에 도입되었습니다.
삭제 표시된 프로젝트를 복원합니다.
POST /projects/:id/restore
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
파일 업로드
- 최대 첨부 파일 크기 강제 적용이 GitLab 13.11에서 feature flag인
enforce_max_attachment_size_upload_api
로 도입되었습니다. 기본적으로 비활성화됩니다.- 최대 첨부 파일 크기가 GitLab 13.11에서 GitLab.com에 활성화되었습니다.
- GitLab 15.10에서 일반적으로 사용 가능하게 되었습니다. 피처 플래그
enforce_max_attachment_size_upload_api
가 제거되었습니다.
지정된 프로젝트에 파일을 업로드하여 이슈 또는 Merge Request 설명 또는 댓글에 사용할 수 있습니다.
POST /projects/:id/uploads
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
file
| 문자열 | 예 | 업로드할 파일. |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
파일을 파일 시스템에서 업로드하려면 --form
인수를 사용하십시오. 이렇게 하면 cURL이 Content-Type: multipart/form-data
헤더를 사용하여 데이터를 게시합니다. file=
매개변수는 파일 시스템에서 파일을 가리켜야 하며 @
로 시작해야 합니다. 예:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--form "file=@dk.png" "https://gitlab.example.com/api/v4/projects/5/uploads"
반환된 객체:
{
"alt": "dk",
"url": "/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
"full_path": "/namespace1/project1/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
"markdown": ""
}
반환된 url
은 프로젝트 경로에 상대적입니다. 반환된 full_path
는 파일의 절대 경로입니다. Markdown 컨텍스트에서는 markdown
형식이 사용될 때 링크가 확장됩니다.
프로젝트 아바타 업로드
지정된 프로젝트에 아바타를 업로드합니다.
PUT /projects/:id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
avatar
| 문자열 | 예 | 업로드할 파일. |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
파일 시스템에서 아바타를 업로드하려면 --form
인수를 사용하십시오. 이렇게 하면 cURL이 Content-Type: multipart/form-data
헤더를 사용하여 데이터를 게시합니다. file=
매개변수는 파일 시스템에서 이미지 파일을 가리켜야 하며 @
로 시작해야 합니다. 예:
예시 요청:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
--form "avatar=@dk.png" "https://gitlab.example.com/api/v4/projects/5"
반환된 객체:
{
"avatar_url": "https://gitlab.example.com/uploads/-/system/project/avatar/2/dk.png"
}
프로젝트 아바타 다운로드
- GitLab 16.9에 도입되었습니다.
프로젝트 아바타를 가져옵니다. 프로젝트가 공개적으로 접근 가능한 경우, 권한 인증없이 이 엔드포인트에 액세스할 수 있습니다.
GET /projects/:id/avatar
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
예시:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/avatar"
프로젝트 아바타 삭제
- GitLab 15.4에 도입되었습니다.
프로젝트 아바타를 삭제하려면 avatar
속성에 빈 값을 사용합니다.
예시 요청:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
--data "avatar=" "https://gitlab.example.com/api/v4/projects/5"
그룹으로 프로젝트 공유
그룹과 프로젝트를 공유할 수 있습니다.
POST /projects/:id/share
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
group_access
| 정수 | 예 | 그룹에 부여할 역할 (access_level )
|
group_id
| 정수 | 예 | 공유할 그룹의 ID |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
expires_at
| 문자열 | 아니오 | ISO 8601 형식의 공유 만료 날짜. 예: 2016-09-26
|
그룹 내에서 공유된 프로젝트 링크 삭제
그룹에서 프로젝트를 공유 해제합니다. 성공 시 204
및 내용 없음 반환.
DELETE /projects/:id/share/:group_id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
group_id
| 정수 | 예 | 그룹의 ID |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/share/17"
프로젝트 멤버 가져오기
다른 프로젝트에서 멤버 가져오기.
대상 프로젝트에서 수입 멤버의 역할이:
- Maintainer : 소스 프로젝트의 소유자 역할을 갖는 멤버는 Maintainer 역할로 가져옵니다.
- Owner : 소스 프로젝트의 소유자 역할을 가진 멤버는 Owner 역할로 가져옵니다.
POST /projects/:id/import_project_members/:project_id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 멤버를 받을 대상 프로젝트의 ID 또는 URL 인코딩된 경로 |
project_id
| 정수 또는 문자열 | 예 | 멤버를 가져올 소스 프로젝트의 ID 또는 URL 인코딩된 경로 |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/import_project_members/32"
반환 값:
- 성공 시
200 OK
. - 대상 또는 소스 프로젝트가 존재하지 않거나 요청자가 액세스할 수 없는 경우
404 Project Not Found
. - 프로젝트 멤버 가져오기가 성공적으로 완료되지 않은 경우
422 Unprocessable Entity
.
예시 응답:
모든 이메일이 성공적으로 보내졌을 때 (HTTP 상태 코드 200
):
{ "status": "success" }
1개 이상의 멤버 가져오기에 문제가 있을 때 (HTTP 상태 코드 200
):
{
"status": "error",
"message": {
"john_smith": "개별 오류 메시지",
"jane_smith": "개별 오류 메시지"
},
"total_members_count": 3
}
시스템 오류가 있을 때 (HTTP 상태 코드 404
및 422
):
{ "message": "가져오기 실패" }
훅
프로젝트 훅 및 웹훅이라고도 불립니다. 이것들은 시스템 전체적인 시스템 훅과는 다릅니다.
프로젝트 훅 디렉터리
프로젝트 훅 디렉터리을 가져옵니다.
GET /projects/:id/hooks
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
프로젝트 훅 가져오기
프로젝트의 특정 훅을 가져옵니다.
GET /projects/:id/hooks/:hook_id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
hook_id
| 정수 | 예 | 프로젝트 훅의 ID |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로 |
{
"id": 1,
"url": "http://example.com/hook",
"project_id": 3,
"push_events": true,
"push_events_branch_filter": "",
"issues_events": true,
"confidential_issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"confidential_note_events": true,
"job_events": true,
"pipeline_events": true,
"wiki_page_events": true,
"deployment_events": true,
"releases_events": true,
"enable_ssl_verification": true,
"repository_update_events": false,
"alert_status": "executable",
"disabled_until": null,
"url_variables": [ ],
"created_at": "2012-10-12T17:04:47Z",
"resource_access_token_events": true,
"custom_webhook_template": "{\"event\":\"{{object_kind}}\"}"
}
프로젝트 후크 추가
지정된 프로젝트에 후크를 추가합니다.
POST /projects/:id/hooks
속성 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
url
| 문자열 | 예 | 후크 URL |
confidential_issues_events
| 부울 | 아니요 | 기밀 이슈 이벤트에서 후크를 트리거합니다. |
confidential_note_events
| 부울 | 아니요 | 기밀 노트 이벤트에서 후크를 트리거합니다. |
deployment_events
| 부울 | 아니요 | 배포 이벤트에서 후크를 트리거합니다. |
enable_ssl_verification
| 부울 | 아니요 | 후크를 트리거할 때 SSL 검증을 수행합니다. |
issues_events
| 부울 | 아니요 | 이슈 이벤트에서 후크를 트리거합니다. |
job_events
| 부울 | 아니요 | 작업 이벤트에서 후크를 트리거합니다. |
merge_requests_events
| 부울 | 아니요 | Merge Request 이벤트에서 후크를 트리거합니다. |
note_events
| 부울 | 아니요 | 노트 이벤트에서 후크를 트리거합니다. |
pipeline_events
| 부울 | 아니요 | 파이프라인 이벤트에서 후크를 트리거합니다. |
push_events_branch_filter
| 문자열 | 아니요 | 일치하는 브랜치에 대한 푸시 이벤트에서 후크를 트리거합니다. |
push_events
| 부울 | 아니요 | 푸시 이벤트에서 후크를 트리거합니다. |
releases_events
| 부울 | 아니요 | 릴리스 이벤트에서 후크를 트리거합니다. |
tag_push_events
| 부울 | 아니요 | 태그 푸시 이벤트에서 후크를 트리거합니다. |
token
| 문자열 | 아니요 | 수신된 페이로드를 검증하기 위한 비밀 토큰입니다. 응답에는 토큰이 포함되지 않습니다. |
wiki_page_events
| 부울 | 아니요 | 위키 페이지 이벤트에서 후크를 트리거합니다. |
resource_access_token_events
| 부울 | 아니요 | 프로젝트 접근 토큰 만료 이벤트에서 후크를 트리거합니다. |
custom_webhook_template
| 문자열 | 아니요 | 후크를 위한 사용자 정의 웹훅 템플릿입니다. |
프로젝트 후크 편집
지정된 프로젝트의 후크를 편집합니다.
PUT /projects/:id/hooks/:hook_id
속성 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
hook_id
| 정수 | 예 | 프로젝트 후크의 ID. |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
url
| 문자열 | 예 | 후크 URL |
confidential_issues_events
| 부울 | 아니요 | 기밀 이슈 이벤트에서 후크를 트리거합니다. |
confidential_note_events
| 부울 | 아니요 | 기밀 노트 이벤트에서 후크를 트리거합니다. |
deployment_events
| 부울 | 아니요 | 배포 이벤트에서 후크를 트리거합니다. |
enable_ssl_verification
| 부울 | 아니요 | 후크를 트리거할 때 SSL 검증을 수행합니다. |
issues_events
| 부울 | 아니요 | 이슈 이벤트에서 후크를 트리거합니다. |
job_events
| 부울 | 아니요 | 작업 이벤트에서 후크를 트리거합니다. |
merge_requests_events
| 부울 | 아니요 | Merge Request 이벤트에서 후크를 트리거합니다. |
note_events
| 부울 | 아니요 | 노트 이벤트에서 후크를 트리거합니다. |
pipeline_events
| 부울 | 아니요 | 파이프라인 이벤트에서 후크를 트리거합니다. |
push_events_branch_filter
| 문자열 | 아니요 | 일치하는 브랜치에 대한 푸시 이벤트에서 후크를 트리거합니다. |
push_events
| 부울 | 아니요 | 푸시 이벤트에서 후크를 트리거합니다. |
releases_events
| 부울 | 아니요 | 릴리스 이벤트에서 후크를 트리거합니다. |
tag_push_events
| 부울 | 아니요 | 태그 푸시 이벤트에서 후크를 트리거합니다. |
token
| 문자열 | 아니요 | 수신된 페이로드를 검증하기 위한 비밀 토큰입니다. 응답에는 토큰이 포함되지 않습니다. 웹훅 URL을 변경하면 비밀 토큰이 재설정되고 유지되지 않습니다. |
wiki_page_events
| 부울 | 아니요 | 위키 페이지 이벤트에서 후크를 트리거합니다. |
resource_access_token_events
| 부울 | 아니요 | 프로젝트 접근 토큰 만료 이벤트에서 후크를 트리거합니다. |
custom_webhook_template
| 문자열 | 아니요 | 후크를 위한 사용자 정의 웹훅 템플릿입니다. |
프로젝트 후크 삭제
프로젝트에서 후크를 제거합니다. 이 방법은 멱등성을 가지며 여러 번 호출할 수 있습니다. 후크가 사용 가능하거나 아닌 경우가 있습니다.
DELETE /projects/:id/hooks/:hook_id
속성 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
hook_id
| 정수 | 예 | 프로젝트 후크의 ID. |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
프로젝트 후크가 사용 가능한 경우 JSON 응답이 반환되거나 빈 응답이 반환됩니다.
포크 관계
기존 프로젝트의 포크된 관계를 수정하는 것을 허용합니다. 프로젝트 소유자 및 관리자만 사용할 수 있습니다.
기존 프로젝트 간에 포크된 관계 생성
POST /projects/:id/fork/:forked_from_id
속성 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
forked_from_id
| ID | 예 | 포크된 프로젝트의 ID. |
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
기존 포크된 관계 삭제
DELETE /projects/:id/fork
속성 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
프로젝트 이름으로 프로젝트 검색
인증된 사용자에게 접근 가능한 프로젝트를 이름으로 검색하십시오. 이 엔드포인트는 프로젝트가 공개적으로 접근 가능한 경우에는 인증 없이 액세스할 수 있습니다.
GET /projects
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
search
| string | Yes | 프로젝트 이름에 포함된 문자열입니다. |
order_by
| string | No |
id , name , created_at , 또는 last_activity_at 필드로 정렬된 결과를 반환합니다.
|
sort
| string | No |
asc 또는 desc 순서로 정렬된 결과를 반환합니다.
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?search=test"
프로젝트의 Housekeeping 작업 시작
POST /projects/:id/housekeeping
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path입니다. |
task
| string | No | 매뉴얼으로 접근할 수 없는 객체를 정리하려면 prune , eager housekeeping을 트리거하려면 eager 입니다.
|
푸시 규칙
프로젝트 푸시 규칙 가져오기
프로젝트의 푸시 규칙을 가져옵니다.
GET /projects/:id/push_rule
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path입니다. |
{
"id": 1,
"project_id": 3,
"commit_message_regex": "Fixes \\d+\\..*",
"commit_message_negative_regex": "ssh\\:\\/\\/",
"branch_name_regex": "",
"deny_delete_tag": false,
"created_at": "2012-10-12T17:04:47Z",
"member_check": false,
"prevent_secrets": false,
"author_email_regex": "",
"file_name_regex": "",
"max_file_size": 5,
"commit_committer_check": false,
"commit_committer_name_check": false,
"reject_unsigned_commits": false
}
프로젝트 푸시 규칙 추가
지정된 프로젝트에 푸시 규칙을 추가합니다.
POST /projects/:id/push_rule
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path입니다. |
author_email_regex
| string | No | 모든 커밋 작성자 이메일은 이와 일치해야 합니다. 예: @my-company.com$ .
|
branch_name_regex
| string | No | 모든 브랜치 이름은 이와 일치해야 합니다. 예: (feature|hotfix)\/* .
|
commit_committer_check
| boolean | No | 사용자는 자신의 확인된 이메일 중 하나인 경우에만 이 리포지터리로 커밋을 푸시할 수 있습니다. |
commit_committer_name_check
| boolean | No | 사용자는 이 리포지터리로 커밋을 푸시할 수 있도록 하려면 커밋 작성자 이름이 GitLab 계정 이름과 일치해야 합니다. |
commit_message_negative_regex
| string | No | 어떤 커밋 메시지도 이와 일치하지 않아야 합니다. 예: ssh\:\/\/ .
|
commit_message_regex
| string | No | 모든 커밋 메시지는 이와 일치해야 합니다. 예: Fixed \d+\..* .
|
deny_delete_tag
| boolean | No | 태그 삭제를 거부합니다. |
file_name_regex
| string | No | 모든 커밋된 파일 이름은 이와 일치하면 안 됩니다. 예: (jar|exe)$ .
|
max_file_size
| integer | No | 최대 파일 크기 (MB). |
member_check
| boolean | No | 기존 GitLab 사용자에 의해 작성된 커밋을 제한합니다. |
prevent_secrets
| boolean | No | 가능성이 있는 비밀 정보를 포함하고 있는 파일을 GitLab이 거부합니다. |
reject_unsigned_commits
| boolean | No | 커밋이 GPG를 통해 서명되지 않은 경우 거부합니다. |
프로젝트 푸시 규칙 편집
지정된 프로젝트에 대해 푸시 규칙을 편집합니다.
PUT /projects/:id/push_rule
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer or string | Yes | 프로젝트의 ID 또는 URL-encoded path입니다. |
author_email_regex
| string | No | 모든 커밋 작성자 이메일은 이와 일치해야 합니다. 예: @my-company.com$ .
|
branch_name_regex
| string | No | 모든 브랜치 이름은 이와 일치해야 합니다. 예: (feature|hotfix)\/* .
|
commit_committer_check
| boolean | No | 사용자는 자신의 확인된 이메일 중 하나인 경우에만 이 리포지터리로 커밋을 푸시할 수 있습니다. |
commit_committer_name_check
| boolean | No | 사용자는 이 리포지터리로 커밋을 푸시할 수 있도록 하려면 커밋 작성자 이름이 GitLab 계정 이름과 일치해야 합니다. |
commit_message_negative_regex
| string | No | 어떤 커밋 메시지도 이와 일치하지 않아야 합니다. 예: ssh\:\/\/ .
|
commit_message_regex
| string | No | 모든 커밋 메시지는 이와 일치해야 합니다. 예: Fixed \d+\..* .
|
deny_delete_tag
| boolean | No | 태그 삭제를 거부합니다. |
file_name_regex
| string | No | 모든 커밋된 파일 이름은 이와 일치하면 안 됩니다. 예: (jar|exe)$ .
|
max_file_size
| integer | No | 최대 파일 크기 (MB). |
member_check
| boolean | No | 기존 GitLab 사용자에 의해 작성된 커밋을 제한합니다. |
prevent_secrets
| boolean | No | 가능성이 있는 비밀 정보를 포함하고 있는 파일을 GitLab이 거부합니다. |
reject_unsigned_commits
| boolean | No | GPG를 통해 서명되지 않은 커밋이 있으면 거부합니다. |
프로젝트 푸시 규칙 삭제
- GitLab 13.9에서 GitLab Premium으로 이동되었습니다.
프로젝트에서 푸시 규칙을 제거합니다.
DELETE /projects/:id/push_rule
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
사용자가 프로젝트를 이전할 수 있는 그룹 가져오기
- GitLab 15.4에 도입되었습니다.
사용자가 프로젝트를 전송할 수있는 그룹 디렉터리을 검색합니다.
GET /projects/:id/transfer_locations
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
search
| 문자열 | 아니오 | 검색할 그룹 이름. |
예시 요청:
curl --request GET "https://gitlab.example.com/api/v4/projects/1/transfer_locations"
예시 응답:
[
{
"id": 27,
"web_url": "https://gitlab.example.com/groups/gitlab",
"name": "GitLab",
"avatar_url": null,
"full_name": "GitLab",
"full_path": "GitLab"
},
{
"id": 31,
"web_url": "https://gitlab.example.com/groups/foobar",
"name": "FooBar",
"avatar_url": null,
"full_name": "FooBar",
"full_path": "FooBar"
}
]
프로젝트를 새 네임스페이스로 전송
- 응답의
_links.cluster_agents
속성은 GitLab 14.10에서 도입되었습니다.
프로젝트를 전송하려면 프로젝트 문서에서 전송 사전 조건을 확인하세요.
PUT /projects/:id/transfer
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
namespace
| 정수 또는 문자열 | 예 | 프로젝트를 전송할 네임스페이스의 ID 또는 경로. |
예시 요청:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/transfer?namespace=14"
예시 응답:
{
"id": 7,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"description_html": "<p data-sourcepos=\"1:1-1:56\" dir=\"auto\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
"name": "hello-world",
"name_with_namespace": "cute-cats / hello-world",
"path": "hello-world",
"path_with_namespace": "cute-cats/hello-world",
...
// (내용이 길어 중략됨)
...
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_on",
"suggestion_commit_message": null,
"merge_commit_template": null,
...
// (내용이 길어 중략됨)
...
"mirror": false,
"compliance_frameworks": [],
"warn_about_potentially_unwanted_characters": true
}
브랜치
브랜치 설명서에서 자세히 알아보기.
프로젝트 가져오기/내보내기
프로젝트 가져오기/내보내기 설명서에서 자세히 알아보기.
프로젝트 멤버
프로젝트 멤버 설명서에서 자세히 알아보기.
프로젝트 취약점
프로젝트 취약점 설명서에서 자세히 알아보기.
프로젝트의 풀 미러 세부 정보 가져오기
- GitLab 15.6에서 도입되었습니다.
프로젝트의 풀 미러의 세부 정보를 반환합니다.
GET /projects/:id/mirror/pull
지원되는 속성:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
예시 요청:
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"
예시 응답:
{
"id": 101486,
"last_error": null,
"last_successful_update_at": "2020-01-06T17:32:02.823Z",
"last_update_at": "2020-01-06T17:32:02.823Z",
"last_update_started_at": "2020-01-06T17:31:55.864Z",
"update_status": "finished",
"url": "https://*****:*****@gitlab.com/gitlab-org/security/gitlab.git"
}
프로젝트의 풀 미러 구성하기
- 필드
mirror_branch_regex
는 GitLab 15.8에서mirror_only_branches_match_regex
라는 플래그와 함께 도입되었습니다. 기본으로 비활성화됩니다.- GitLab 16.0에서 기본으로 활성화됩니다.
- GitLab 16.2에서 일반적으로 사용 가능해집니다.
mirror_only_branches_match_regex
피처 플래그가 제거되었습니다.
풀 미러를 구성하여 API를 사용하여 새 프로젝트를 생성하거나 기존 프로젝트를 업데이트하는 동안 원격 리포지터리가 공개적으로 접근 가능한 경우 또는 username:token
인증을 통해 진행합니다. HTTP 리포지터리가 공개적으로 접근이 불가능한 경우 URL에 인증 정보를 추가할 수 있습니다: https://username:token@gitlab.company.com/group/project.git
, 여기서 token
은 개인 액세스 토큰입니다.
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
import_url
| 문자열 | 예 | 미러링되는 원격 리포지터리의 URL (user:token 이 필요한 경우 포함).
|
mirror
| 부울 | 예 |
true 로 설정할 경우 프로젝트에서 풀 미러링을 활성화합니다.
|
mirror_trigger_builds
| 부울 | 아니요 |
true 로 설정할 경우 미러 업데이트를 위해 파이프라인을 트리거합니다.
|
only_mirror_protected_branches
| 부울 | 아니요 |
true 로 설정할 경우 미러링을 보호된 브랜치에만 제한합니다.
|
mirror_branch_regex
| 문자열 | 아니요 | 정규 표현식을 포함합니다. 해당 정규식과 일치하는 브랜치만 미러링됩니다. only_mirror_protected_branches 가 비활성화되어 있어야 합니다.
|
풀 미러가 포함된 프로젝트를 생성하는 예시:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-Type: application/json" \
--data '{
"name": "new_project",
"namespace_id": "1",
"mirror": true,
"import_url": "https://username:token@gitlab.example.com/group/project.git"
}' \
--url "https://gitlab.example.com/api/v4/projects/"
풀 미러를 추가하는 예시:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/:id" \
--data "mirror=true&import_url=https://username:token@gitlab.example.com/group/project.git"
풀 미러를 제거하는 예시:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/:id" \
--data "mirror=false"
프로젝트의 풀 미러 프로세스 시작하기
- GitLab 13.9에서 GitLab Premium으로 이동되었습니다.
POST /projects/:id/mirror/pull
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"
프로젝트 뱃지
프로젝트 뱃지 설명서에서 자세히 알아보기.
Git 리포지터리의 스냅샷 다운로드
이 엔드포인트는 관리자 권한을 가진 사용자만이 액세스할 수 있습니다.
프로젝트 (또는 요청된 경우 위키) Git 리포지터리의 스냅샷을 다운로드합니다. 이 스냅샷은 항상 압축 해제된 tar 형식입니다.
git clone
이 작동하지 않을 정도로 리포지터리가 손상된 경우 스냅샷을 사용하여 데이터의 일부를 검색할 수 있습니다.
GET /projects/:id/snapshot
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
wiki
| 부울 | 아니요 | 프로젝트 리포지터리 대신 위키를 다운로드할지 여부. |
리포지터리 스토리지 경로 가져오기
- 소개됨 GitLab 14.0에서.
만약 Gitaly 클러스터를 사용하지 않는 경우, 지정된 프로젝트의 리포지터리 저장 경로를 가져옵니다. Gitaly 클러스터를 사용하는 경우, Praefect에 의해 생성된 복제 경로(GitLab 15.0 이상)를 참조하세요.
관리자 전용 기능입니다.
GET /projects/:id/storage
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL-인코딩된 경로. |
[
{
"project_id": 1,
"disk_path": "@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b",
"created_at": "2012-10-12T17:04:47Z",
"repository_storage": "default"
}
]