그룹 및 프로젝트 마이그레이션 직접 전송 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
  • 프로젝트 마이그레이션은 도입됨 GitLab 15.11에 있습니다.

직접 전송 API를 통한 그룹 마이그레이션을 사용하면 group migration by direct transfer로 시작된 마이그레이션의 진행 상황을 볼 수 있습니다.

caution
이 API를 통한 프로젝트 마이그레이션은 베타입니다. 이 기능은 프로덕션 사용에 적합하지 않습니다.

필수 조건

직접 전송 API를 통한 그룹 마이그레이션의 필수 조건에 대한 정보는 migrating groups by direct transfer를 참조하십시오.

새 그룹 또는 프로젝트 마이그레이션 시작하기

  • project_entity 소스 유형은 도입됨 GitLab 15.11에 있습니다.

이 엔드포인트를 사용하여 새 그룹 또는 프로젝트 마이그레이션을 시작합니다. 다음을 지정하십시오:

  • entities[group_entity]로 그룹을 마이그레이션합니다.
  • entities[project_entity]로 프로젝트를 마이그레이션합니다. (상태: Beta)
POST /bulk_imports
속성 유형 필수 설명
configuration Hash 소스 GitLab 인스턴스 구성.
configuration[url] String 소스 GitLab 인스턴스 URL.
configuration[access_token] String 소스 GitLab 인스턴스에 대한 액세스 토큰.
entities Array 가져올 엔터티 목록.
entities[source_type] String 소스 엔터티 유형. 유효한 값은 group_entityproject_entity입니다 (GitLab 15.11 이상).
entities[source_full_path] String 가져올 엔터티의 소스 전체 경로. 예: gitlab-org/gitlab.
entities[destination_slug] String 엔터티의 대상 슬러그. GitLab은 슬러그를 엔터티의 URL 경로로 사용합니다. 가져온 엔터티의 이름은 소스 엔터티의 이름을 복사하는 것이며 슬러그가 아닙니다.
entities[destination_name] String 아니오 더 이상 사용되지 않음: 대신 destination_slug를 사용하세요. 엔터티의 대상 슬러그.
entities[destination_namespace] String 엔터티의 대상 그룹 namespace의 전체 경로. 이는 대상 인스턴스에 있는 기존 그룹이어야 합니다.
entities[migrate_projects] Boolean 아니오 그룹의 모든 하위 프로젝트도 가져옵니다(만약 source_typegroup_entity인 경우). 기본값은 true입니다.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token_for_destination_gitlab_instance>" "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": "<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 정수 아니오 페이지당 반환할 레코드 수.
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",
        "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 정수 아니오 페이지당 반환할 레코드 수.
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",
        "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,
        "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,
        "has_failures": false,
        "stats": { }
    }
]

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

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",
  "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 아니요 가져오기 상태입니다.

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

  • 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,
        "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,
        "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>" "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,
    "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/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": "Issue title"
}

마이그레이션 취소

직접 전송 마이그레이션을 취소합니다.

POST /bulk_imports/:id/cancel
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "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
}

가능한 응답 상태 코드:

Status Description
200 마이그레이션이 성공적으로 취소됨
401 인증되지 않음
403 금지됨
404 마이그레이션을 찾을 수 없음
503 서비스가 사용 불가능함