그룹 및 프로젝트 이전을 위한 직접 전송 API

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

그룹 이전을 위한 직접 전송 API를 사용하면 직접 전송에 의한 그룹 이전으로 시작하고 진행 상황을 확인할 수 있습니다.

caution
이 API를 사용한 프로젝트 이전은 베타 상태입니다. 이 기능은 아직 제품으로 사용하기에 준비되지 않았습니다.

사전 요구 사항

직접 전송 API를 사용한 그룹 이전의 사전 요구 사항에 대한 정보는 직접 전송에 의한 그룹 이전의 사전 요구 사항을 참조하세요.

새로운 그룹 또는 프로젝트 이전 시작하기

이 엔드포인트를 사용하여 새로운 그룹 또는 프로젝트 이전을 시작하세요. 다음을 지정하세요:

  • 그룹을 마이그레이션하려면 entities[group_entity]를 지정합니다.
  • 프로젝트를 마이그레이션하려면 entities[project_entity]를 지정합니다. (상태: 베타)
POST /bulk_imports
속성 유형 필수 설명
configuration 해시 소스 GitLab 인스턴스 구성
configuration[url] 문자열 소스 GitLab 인스턴스 URL
configuration[access_token] 문자열 소스 GitLab 인스턴스 액세스 토큰
entities 배열 가져올 엔터티 디렉터리
entities[source_type] 문자열 소스 엔터티 유형. 유효한 값은 group_entityproject_entity입니다 (GitLab 15.11부터).
entities[source_full_path] 문자열 가져올 엔터티의 소스 전체 경로. 예: gitlab-org/gitlab.
entities[destination_slug] 문자열 엔터티의 대상 슬러그. GitLab은 슬러그를 엔터티의 URL 경로로 사용합니다. 가져온 엔터티의 이름은 소스 엔터티의 이름이 아니라 슬러그에서 복사됩니다.
entities[destination_name] 문자열 아니오 사용되지 않음: 대신 destination_slug를 사용하세요. 엔터티의 대상 슬러그입니다.
entities[destination_namespace] 문자열 엔터티의 대상 그룹 네임스페이스의 전체 경로. 대상 인스턴스에 기존 그룹이어야 합니다.
entities[migrate_projects] 부울 아니오 그룹 엔터티의 경우 모든 중첩된 프로젝트도 가져옵니다(소스 유형이 group_entity인 경우). 기본값은 true입니다.
curl --request POST --header "PRIVATE-TOKEN: <대상_gitlab_인스턴스에_대한_액세스_토큰>" "https://destination-gitlab-instance.example.com/api/v4/bulk_imports" \
  --header "Content-Type: application/json" \
  --data '{
    "configuration": {
      "url": "https://source-gitlab-instance.example.com",
      "access_token": "<소스_gitlab_인스턴스에_대한_액세스_토큰>"
    },
    "entities": [
      {
        "source_full_path": "소스/전체/경로",
        "source_type": "group_entity",
        "destination_slug": "대상_슬러그",
        "destination_namespace": "대상/네임스페이스/경로"
      }
    ]
  }'
{ "id": 1, "status": "created", "source_type": "gitlab", "created_at": "2021-06-18T09:45:55.358Z", "updated_at": "2021-06-18T09:46:27.003Z" }

모든 그룹 또는 프로젝트 마이그레이션 디렉터리

GET /bulk_imports
속성 유형 필수 설명
per_page 정수 아니오 페이지당 반환할 레코드 수.
page 정수 아니오 검색할 페이지.
sort 문자열 아니오 생성 날짜로 asc 또는 desc 순으로 정렬된 레코드를 반환합니다. 기본값은 desc입니다.
status 문자열 아니오 가져오기 상태.

상태는 다음 중 하나일 수 있습니다:

  • created
  • started
  • finished
  • failed
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/bulk_imports?per_page=2&page=1"
[
    {
        "id": 1,
        "status": "finished",
        "source_type": "gitlab",
        "created_at": "2021-06-18T09:45:55.358Z",
        "updated_at": "2021-06-18T09:46:27.003Z"
    },
    {
        "id": 2,
        "status": "started",
        "source_type": "gitlab",
        "created_at": "2021-06-18T09:47:36.581Z",
        "updated_at": "2021-06-18T09:47:58.286Z"
    }
]

모든 그룹 또는 프로젝트 마이그레이션 엔터티 디렉터리

GET /bulk_imports/entities
속성 유형 필수 설명
per_page 정수 아니오 페이지당 반환할 레코드 수.
page 정수 아니오 검색할 페이지.
sort 문자열 아니오 생성 날짜로 asc 또는 desc 순으로 정렬된 레코드를 반환합니다. 기본값은 desc입니다.
status 문자열 아니오 가져오기 상태.

상태는 다음 중 하나일 수 있습니다:

  • created
  • started
  • finished
  • failed
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/bulk_imports/entities?per_page=2&page=1&status=started"
[
    {
        "id": 1,
        "bulk_import_id": 1,
        "status": "finished",
        "source_full_path": "소스_그룹",
        "destination_slug": "대상_슬러그",
        "destination_namespace": "대상_경로",
        "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": [],
        "stats": {
            "labels": {
                "source": 10,
                "fetched": 10,
                "imported": 10
            },
            "milestones": {
                "source": 10,
                "fetched": 10,
                "imported": 10
            }
        }
    },
    {
        "id": 2,
        "bulk_import_id": 2,
        "status": "failed",
        "source_full_path": "다른_그룹",
        "destination_slug": "다른_슬러그",
        "destination_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": "그룹",
                "step": "추출기",
                "exception_message": "에러!",
                "exception_class": "예외",
                "correlation_id_value": "dfcf583058ed4508e4c7c617bd7f0edd",
                "created_at": "2021-06-24T10:40:46.495Z",
                "pipeline_class": "BulkImports::Groups::Pipelines::GroupPipeline",
                "pipeline_step": "추출기"
            }
        ]
    }
]


## 그룹 또는 프로젝트 마이그레이션 세부 정보 가져오기

```plaintext
GET /bulk_imports/:id
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/bulk_imports/1"
{
  "id": 1,
  "status": "finished",
  "source_type": "gitlab",
  "created_at": "2021-06-18T09:45:55.358Z",
  "updated_at": "2021-06-18T09:46:27.003Z"
}

그룹 또는 프로젝트 마이그레이션 엔터티 디렉터리 가져오기

GET /bulk_imports/:id/entities
속성 유형 필수 설명
per_page integer no 페이지당 반환할 레코드 수.
page integer no 검색할 페이지.
sort string no 생성 날짜순으로 asc 또는 desc 순서로 정렬된 레코드를 반환. 기본값은 desc.
status string no 가져올 레코드의 상태.

상태는 다음 중 하나일 수 있습니다:

  • created
  • started
  • finished
  • failed
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/bulk_imports/1/entities?per_page=2&page=1&status=finished"
[
    {
        "id": 1,
        "status": "finished",
        "source_type": "gitlab",
        "created_at": "2021-06-18T09:45:55.358Z",
        "updated_at": "2021-06-18T09:46:27.003Z",
        "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>" "https://gitlab.example.com/api/v4/bulk_imports/1/entities/2"
{
  "id": 2,
  "status": "finished",
  "source_type": "gitlab",
  "created_at": "2021-06-18T09:45:55.358Z",
  "updated_at": "2021-06-18T09:46:27.003Z"
}

그룹 또는 프로젝트 마이그레이션 엔터티의 실패한 가져오기 레코드 디렉터리

GET /bulk_imports/:id/entities/:entity_id/failures
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "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": "이슈 제목"
}