직접 전송으로 그룹 및 프로젝트 마이그레이션 API
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
이 API를 사용하여 직접 전송으로 그룹 및 프로젝트를 마이그레이션합니다. 새 그룹 또는 프로젝트 마이그레이션을 시작합니다. 모든 그룹 또는 프로젝트 마이그레이션을 나열합니다. 상태는 다음 중 하나일 수 있습니다: 모든 그룹 또는 프로젝트 마이그레이션 엔티티를 나열합니다.
이 API를 사용하여 직접 전송으로 그룹 및 프로젝트를 마이그레이션합니다.
사전 요구사항:
- 직접 전송으로 그룹 마이그레이션 사전 요구사항을 참조하세요.
그룹 또는 프로젝트 마이그레이션 시작#
새 그룹 또는 프로젝트 마이그레이션을 시작합니다.
프로젝트를 마이그레이션하려면 entities[project_entity]를 지정합니다.
POST /bulk_imports
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
configuration |
Hash | 예 | 소스 GitLab 인스턴스 구성. |
configuration[url] |
String | 예 | 소스 GitLab 인스턴스 URL. |
configuration[access_token] |
String | 예 | 소스 GitLab 인스턴스에 대한 액세스 토큰. |
entities |
Array | 예 | 가져올 엔티티 목록. |
entities[source_type] |
String | 예 | 소스 엔티티 유형. 유효한 값은 group_entity 및 project_entity입니다. |
entities[source_full_path] |
String | 예 | 가져올 엔티티의 소스 전체 경로. 예: gitlab-org/gitlab. |
entities[destination_slug] |
String | 예 | 엔티티의 대상 슬러그. GitLab은 슬러그를 엔티티의 URL 경로로 사용합니다. 가져온 엔티티의 이름은 슬러그가 아닌 소스 엔티티의 이름에서 복사됩니다. |
entities[destination_namespace] |
String | 예 | 엔티티의 대상 그룹 네임스페이스 전체 경로. project_entity의 경우 이 값은 대상 인스턴스의 기존 그룹이어야 합니다. group_entity의 경우 이 값은 대상 인스턴스의 기존 그룹이거나 대상 인스턴스(GitLab Self-Managed 및 GitLab Dedicated)에서 최상위 그룹을 생성하는 빈 문자열 ""일 수 있습니다. 개인 네임스페이스는 지원되지 않습니다. |
entities[destination_name] |
String | 아니오 | 더 이상 사용되지 않음: 대신 destination_slug를 사용하세요. 엔티티의 대상 슬러그. |
entities[migrate_memberships] |
Boolean | 아니오 | 사용자 멤버십 가져오기. 기본값은 true. |
entities[migrate_projects] |
Boolean | 아니오 | 그룹의 중첩된 프로젝트도 가져오기(source_type이 group_entity인 경우). 기본값은 true. |
curl --request POST \
--url "https://destination-gitlab-instance.example.com/api/v4/bulk_imports" \
--header "PRIVATE-TOKEN: <your_access_token_for_destination_gitlab_instance>" \
--header "Content-Type: application/json" \
--data '{
"configuration": {
"url": "https://source-gitlab-instance.example.com",
"access_token": "<your_access_token_for_source_gitlab_instance>"
},
"entities": [
{
"source_full_path": "source/full/path",
"source_type": "group_entity",
"destination_slug": "destination_slug",
"destination_namespace": "destination/namespace/path"
}
]
}'
{
"id": 1,
"status": "created",
"source_type": "gitlab",
"source_url": "https://gitlab.example.com",
"created_at": "2021-06-18T09:45:55.358Z",
"updated_at": "2021-06-18T09:46:27.003Z",
"has_failures": false
}
모든 그룹 또는 프로젝트 마이그레이션 목록#
모든 그룹 또는 프로젝트 마이그레이션을 나열합니다.
GET /bulk_imports
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
per_page |
integer | 아니오 | 페이지당 반환할 레코드 수. |
page |
integer | 아니오 | 조회할 페이지. |
sort |
string | 아니오 | 생성 날짜별로 asc 또는 desc 순서로 정렬된 레코드를 반환합니다. 기본값은 desc. |
status |
string | 아니오 | 가져오기 상태. |
상태는 다음 중 하나일 수 있습니다:
createdstartedfinishedfailed
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports?per_page=2&page=1"
[
{
"id": 1,
"status": "finished",
"source_type": "gitlab",
"source_url": "https://gitlab.example.com",
"created_at": "2021-06-18T09:45:55.358Z",
"updated_at": "2021-06-18T09:46:27.003Z",
"has_failures": false
},
{
"id": 2,
"status": "started",
"source_type": "gitlab",
"source_url": "https://gitlab.example.com",
"created_at": "2021-06-18T09:47:36.581Z",
"updated_at": "2021-06-18T09:47:58.286Z",
"has_failures": false
}
]
모든 그룹 또는 프로젝트 마이그레이션 엔티티 목록#
모든 그룹 또는 프로젝트 마이그레이션 엔티티를 나열합니다.
GET /bulk_imports/entities
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
per_page |
integer | 아니오 | 페이지당 반환할 레코드 수. |
page |
integer | 아니오 | 조회할 페이지. |
sort |
string | 아니오 | 생성 날짜별로 asc 또는 desc 순서로 정렬된 레코드를 반환합니다. 기본값은 desc. |
status |
string | 아니오 | 가져오기 상태. |
상태는 다음 중 하나일 수 있습니다:
createdstartedfinishedfailed
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/entities?per_page=2&page=1&status=started"
[
{
"id": 1,
"bulk_import_id": 1,
"status": "finished",
"entity_type": "group",
"source_full_path": "source_group",
"destination_full_path": "destination/full_path",
"destination_name": "destination_slug",
"destination_slug": "destination_slug",
"destination_namespace": "destination_path",
"parent_id": null,
"namespace_id": 1,
"project_id": null,
"created_at": "2021-06-18T09:47:37.390Z",
"updated_at": "2021-06-18T09:47:51.867Z",
"failures": [],
"migrate_projects": true,
"migrate_memberships": true,
"has_failures": false,
"stats": {
"labels": {
"source": 10,
"fetched": 10,
"imported": 10
},
"milestones": {
"source": 10,
"fetched": 10,
"imported": 10
}
}
},
{
"id": 2,
"bulk_import_id": 2,
"status": "failed",
"entity_type": "group",
"source_full_path": "another_group",
"destination_full_path": "destination/full_path",
"destination_name": "destination_slug",
"destination_slug": "another_slug",
"destination_namespace": "another_namespace",
"parent_id": null,
"namespace_id": null,
"project_id": null,
"created_at": "2021-06-24T10:40:20.110Z",
"updated_at": "2021-06-24T10:40:46.590Z",
"failures": [
{
"relation": "group",
"step": "extractor",
"exception_message": "Error!",
"exception_class": "Exception",
"correlation_id_value": "dfcf583058ed4508e4c7c617bd7f0edd",
"created_at": "2021-06-24T10:40:46.495Z",
"pipeline_class": "BulkImports::Groups::Pipelines::GroupPipeline",
"pipeline_step": "extractor"
}
],
"migrate_projects": true,
"migrate_memberships": true,
"has_failures": false,
"stats": { }
}
]
그룹 또는 프로젝트 마이그레이션 조회#
그룹 또는 프로젝트 마이그레이션의 세부 정보를 조회합니다.
GET /bulk_imports/:id
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/1"
{
"id": 1,
"status": "finished",
"source_type": "gitlab",
"source_url": "https://gitlab.example.com",
"created_at": "2021-06-18T09:45:55.358Z",
"updated_at": "2021-06-18T09:46:27.003Z"
}
그룹 또는 프로젝트 마이그레이션 엔티티 목록#
특정 마이그레이션에 대한 그룹 또는 프로젝트 마이그레이션 엔티티를 나열합니다.
GET /bulk_imports/:id/entities
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
per_page |
integer | 아니오 | 페이지당 반환할 레코드 수. |
page |
integer | 아니오 | 조회할 페이지. |
sort |
string | 아니오 | 생성 날짜별로 asc 또는 desc 순서로 정렬된 레코드를 반환합니다. 기본값은 desc. |
status |
string | 아니오 | 가져오기 상태. |
상태는 다음 중 하나일 수 있습니다:
createdstartedfinishedfailed
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/1/entities?per_page=2&page=1&status=finished"
[
{
"id": 1,
"bulk_import_id": 1,
"status": "finished",
"entity_type": "group",
"source_full_path": "source_group",
"destination_full_path": "destination/full_path",
"destination_name": "destination_slug",
"destination_slug": "destination_slug",
"destination_namespace": "destination_path",
"parent_id": null,
"namespace_id": 1,
"project_id": null,
"created_at": "2021-06-18T09:47:37.390Z",
"updated_at": "2021-06-18T09:47:51.867Z",
"failures": [
{
"relation": "group",
"step": "extractor",
"exception_message": "Error!",
"exception_class": "Exception",
"correlation_id_value": "dfcf583058ed4508e4c7c617bd7f0edd",
"created_at": "2021-06-24T10:40:46.495Z",
"pipeline_class": "BulkImports::Groups::Pipelines::GroupPipeline",
"pipeline_step": "extractor"
}
],
"migrate_projects": true,
"migrate_memberships": true,
"has_failures": true,
"stats": {
"labels": {
"source": 10,
"fetched": 10,
"imported": 10
},
"milestones": {
"source": 10,
"fetched": 10,
"imported": 10
}
}
}
]
그룹 또는 프로젝트 마이그레이션 엔티티 조회#
그룹 또는 프로젝트 마이그레이션 엔티티의 세부 정보를 조회합니다.
GET /bulk_imports/:id/entities/:entity_id
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/1/entities/2"
{
"id": 1,
"bulk_import_id": 1,
"status": "finished",
"entity_type": "group",
"source_full_path": "source_group",
"destination_full_path": "destination/full_path",
"destination_name": "destination_slug",
"destination_slug": "destination_slug",
"destination_namespace": "destination_path",
"parent_id": null,
"namespace_id": 1,
"project_id": null,
"created_at": "2021-06-18T09:47:37.390Z",
"updated_at": "2021-06-18T09:47:51.867Z",
"failures": [
{
"relation": "group",
"step": "extractor",
"exception_message": "Error!",
"exception_class": "Exception",
"correlation_id_value": "dfcf583058ed4508e4c7c617bd7f0edd",
"created_at": "2021-06-24T10:40:46.495Z",
"pipeline_class": "BulkImports::Groups::Pipelines::GroupPipeline",
"pipeline_step": "extractor"
}
],
"migrate_projects": true,
"migrate_memberships": true,
"has_failures": true,
"stats": {
"labels": {
"source": 10,
"fetched": 10,
"imported": 10
},
"milestones": {
"source": 10,
"fetched": 10,
"imported": 10
}
}
}
마이그레이션 엔티티의 실패한 가져오기 레코드 목록#
히스토리
- GitLab 16.6에서 도입됨.
그룹 또는 프로젝트 마이그레이션 엔티티의 실패한 가져오기 레코드를 나열합니다.
GET /bulk_imports/:id/entities/:entity_id/failures
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/1/entities/2/failures"
{
"relation": "issues",
"exception_message": "Error!",
"exception_class": "StandardError",
"correlation_id_value": "06289e4b064329a69de7bb2d7a1b5a97",
"source_url": "https://gitlab.example/project/full/path/-/issues/1",
"source_title": "Issue title"
}
마이그레이션 취소#
히스토리
- GitLab 17.1에서 도입됨.
직접 전송 마이그레이션을 취소합니다.
POST /bulk_imports/:id/cancel
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/bulk_imports/1/cancel"
{
"id": 1,
"status": "canceled",
"source_type": "gitlab",
"created_at": "2021-06-18T09:45:55.358Z",
"updated_at": "2021-06-18T09:46:27.003Z",
"has_failures": false
}
가능한 응답 상태 코드:
| 상태 | 설명 |
|---|---|
| 200 | 마이그레이션이 성공적으로 취소됨 |
| 401 | 권한 없음 |
| 403 | 금지됨 |
| 404 | 마이그레이션을 찾을 수 없음 |
| 503 | 서비스를 사용할 수 없음 |
