- 모든 프로젝트 저장소 이동 검색
- 프로젝트의 모든 저장소 이동 검색
- 단일 프로젝트 저장소 이동 검색
- 프로젝트용 단일 리포지토리 저장소 이동 가져오기
- 프로젝트용 리포지토리 저장소 이동 일정
- 저장소 샤드에 있는 모든 프로젝트용 리포지토리 저장소 이동 일정화
프로젝트 저장소 이동 API
- GitLab 13.0에서 도입되었습니다.
위키 및 디자인 저장소를 포함한 프로젝트 저장소는 저장소 간에 이동할 수 있습니다. 이 API는 예를 들어 Gitaly 클러스터로 이주할 때 도움이 될 수 있습니다.
프로젝트 저장소 이동은 처리됨에 따라 다양한 상태로 전환됩니다. state
의 값은 다음과 같습니다.
-
initial
: 레코드가 생성되었지만 백그라운드 작업이 아직 예약되지 않았습니다. -
scheduled
: 백그라운드 작업이 예약되었습니다. -
started
: 프로젝트 저장소가 대상 저장소로 복사되고 있습니다. -
replicated
: 프로젝트가 이동되었습니다. -
failed
: 프로젝트 저장소가 복사되지 못했거나 체크섬이 일치하지 않았습니다. -
finished
: 프로젝트가 이동되었으며 소스 저장소의 저장소가 삭제되었습니다. -
cleanup failed
: 프로젝트가 이동되었지만 소스 저장소의 저장소를 삭제할 수 없었습니다.
데이터 무결성을 보장하기 위해 프로젝트는 이동 기간 동안 임시 읽기 전용 상태로 설정됩니다. 이 기간 동안 사용자가 새 커밋을 푸시하려고 하면 저장소는 임시 읽기 전용입니다. 나중에 다시 시도해주세요.
라는 메시지가 표시됩니다.
이 API를 사용하려면 관리자로 인증해야 합니다.
다른 저장소 유형을 보려면:
모든 프로젝트 저장소 이동 검색
GET /project_repository_storage_moves
기본적으로 GET
요청은 API 결과가 페이징됨으로 한 번에 20개의 결과가 반환됩니다.
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_repository_storage_moves"
예시 응답:
[
{
"id": 1,
"created_at": "2020-05-07T04:27:17.234Z",
"state": "scheduled",
"source_storage_name": "default",
"destination_storage_name": "storage2",
"project": {
"id": 1,
"description": null,
"name": "project1",
"name_with_namespace": "John Doe2 / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17.016Z"
}
}
]
프로젝트의 모든 저장소 이동 검색
GET /projects/:project_id/repository_storage_moves
기본적으로 GET
요청은 API 결과가 페이징됨으로 한 번에 20개의 결과가 반환됩니다.
매개변수:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
project_id
| 정수 | 예 | 프로젝트 ID |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/repository_storage_moves"
예시 응답:
[
{
"id": 1,
"created_at": "2020-05-07T04:27:17.234Z",
"state": "scheduled",
"source_storage_name": "default",
"destination_storage_name": "storage2",
"project": {
"id": 1,
"description": null,
"name": "project1",
"name_with_namespace": "John Doe2 / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17.016Z"
}
}
]
단일 프로젝트 저장소 이동 검색
GET /project_repository_storage_moves/:repository_storage_id
매개변수:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
repository_storage_id
| 정수 | 예 | 프로젝트 저장소 이동 ID |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_repository_storage_moves/1"
예시 응답:
{
"id": 1,
"created_at": "2020-05-07T04:27:17.234Z",
"state": "scheduled",
"source_storage_name": "default",
"destination_storage_name": "storage2",
"project": {
"id": 1,
"description": null,
"name": "project1",
"name_with_namespace": "John Doe2 / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17.016Z"
}
}
프로젝트용 단일 리포지토리 저장소 이동 가져오기
GET /projects/:project_id/repository_storage_moves/:repository_storage_id
매개변수:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
project_id
| 정수 | 예 | 프로젝트 ID |
repository_storage_id
| 정수 | 예 | 프로젝트 리포지토리 저장소 이동 ID |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/repository_storage_moves/1"
예시 응답:
{
"id": 1,
"created_at": "2020-05-07T04:27:17.234Z",
"state": "scheduled",
"source_storage_name": "default",
"destination_storage_name": "storage2",
"project": {
"id": 1,
"description": null,
"name": "project1",
"name_with_namespace": "John Doe2 / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17.016Z"
}
}
프로젝트용 리포지토리 저장소 이동 일정
- GitLab 13.1에 도입됨.
- GitLab 13.3에 도입됨, 원본 리포지토리는 성공적인 이동 및 무결성 확인 후 자동으로 제거됨.
경고: GitLab 13.3 이전에는 리포지토리 이동이 원래 저장소 디스크 위치에서 원본 리포지토리가 삭제되지 않고 수동으로 정리해야 하는 리포지토리 복사와 같은 방식으로 작동했습니다.
POST /projects/:project_id/repository_storage_moves
매개변수:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
project_id
| 정수 | 예 | 프로젝트 ID |
destination_storage_name
| 문자열 | 아니요 | 대상 저장소 샤드의 이름. 제공되지 않으면 GitLab 13.5 및 이후에는 저장소가 저장소 가중치에 따라 자동으로 선택됨 |
예시 요청:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" \
--data '{"destination_storage_name":"storage2"}' \
"https://gitlab.example.com/api/v4/projects/1/repository_storage_moves"
예시 응답:
{
"id": 1,
"created_at": "2020-05-07T04:27:17.234Z",
"state": "scheduled",
"source_storage_name": "default",
"destination_storage_name": "storage2",
"project": {
"id": 1,
"description": null,
"name": "project1",
"name_with_namespace": "John Doe2 / project1",
"path": "project1",
"path_with_namespace": "namespace1/project1",
"created_at": "2020-05-07T04:27:17.016Z"
}
}
저장소 샤드에 있는 모든 프로젝트용 리포지토리 저장소 이동 일정화
소스 저장소 샤드에 저장된 각 프로젝트 리포지토리에 대해 리포지토리 저장소 이동을 일정화합니다. 이 엔드포인트는 모든 프로젝트를 한꺼번에 이전합니다. 자세한 정보는 모든 프로젝트 이동를 참조하세요.
POST /project_repository_storage_moves
매개변수:
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
source_storage_name
| 문자열 | 예 | 원본 저장소 샤드의 이름. |
destination_storage_name
| 문자열 | 아니요 | 대상 저장소 샤드의 이름. 제공되지 않으면 저장소 가중치에 따라 자동으로 선택됨 |
예시 요청:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" \
--data '{"source_storage_name":"default"}' \
"https://gitlab.example.com/api/v4/project_repository_storage_moves"
예시 응답:
{
"message": "202 Accepted"
}