프로젝트 관계 내보내기 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
  • GitLab 15.8에서 새 애플리케이션 설정 bulk_import_enabled가 도입되었습니다. bulk_import 기능 플래그가 제거되었습니다.

프로젝트 관계 내보내기 API는 프로젝트의 구조를 최상위 관계별로 각기 다른 파일로 부분적으로 내보냅니다
(예: 마일스톤, 이슈 및 레이블).

프로젝트 관계 내보내기 API는 주로
그룹 마이그레이션에서 사용되며,
프로젝트 가져오기 및 내보내기 API와 함께 사용할 수 없습니다.

새 내보내기 예약

새 프로젝트 관계 내보내기를 시작합니다:

POST /projects/:id/export_relations
속성 유형 필수 설명
id integer/string 프로젝트의 ID입니다.
batched boolean 아니오 배치로 내보낼지 여부입니다.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/export_relations"
{
  "message": "202 Accepted"
}

내보내기 상태

관계 내보내기 상태를 확인합니다:

GET /projects/:id/export_relations/status
속성 유형 필수 설명
id integer/string 프로젝트의 ID입니다.
relation string 아니오 확인할 프로젝트 최상위 관계의 이름입니다.
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/export_relations/status"

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

  • 0 - 시작됨
  • 1 - 완료됨
  • -1 - 실패
[
  {
    "relation": "project_badges",
    "status": 1,
    "error": null,
    "updated_at": "2021-05-04T11:25:20.423Z",
    "batched": true,
    "batches_count": 1,
    "batches": [
      {
        "status": 1,
        "batch_number": 1,
        "objects_count": 1,
        "error": null,
        "updated_at": "2021-05-04T11:25:20.423Z"
      }
    ]
  },
  {
    "relation": "boards",
    "status": 1,
    "error": null,
    "updated_at": "2021-05-04T11:25:20.085Z",
    "batched": false,
    "batches_count": 0
  }
]

내보내기 다운로드

완료된 관계 내보내기를 다운로드합니다:

GET /projects/:id/export_relations/download
속성 유형 필수 설명
id integer/string 프로젝트의 ID입니다.
relation string 다운로드할 프로젝트 최상위 관계의 이름입니다.
batched boolean 아니오 내보내기가 배치인지의 여부입니다.
batch_number integer 아니오 다운로드할 내보내기 배치 번호입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" --remote-header-name \
     --remote-name "https://gitlab.example.com/api/v4/projects/1/export_relations/download?relation=labels"
ls labels.ndjson.gz
labels.ndjson.gz

관련 주제