프로젝트 관계 내보내기 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-Managed, GitLab Dedicated
  • GitLab 14.4에 도입, 기본적으로 비활성화된 bulk_import 기능 플래그 뒤에서.
  • GitLab 15.8에서 도입된 새로운 애플리케이션 설정 bulk_import_enabled. bulk_import 기능 플래그가 제거되었습니다.

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

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

새로운 내보내기 일정

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

POST /projects/:id/export_relations
속성 타입 필수 여부 설명
id 정수/문자열 인증된 사용자가 소유한 프로젝트 ID.
batched 부울 아니요 일괄로 내보내기할지 여부.
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 정수/문자열 인증된 사용자가 소유한 프로젝트 ID.
relation 문자열 아니요 보고자 하는 프로젝트 최상위 관계의 이름.
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" \
     "https://gitlab.example.com/api/v4/projects/1/export_relations/status"

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

  • 0 - 시작됨(started)
  • 1 - 완료됨(finished)
  • -1 - 실패함(failed)
[
  {
    "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 정수/문자열 인증된 사용자가 소유한 프로젝트 ID.
relation 문자열 다운로드할 프로젝트 최상위 관계의 이름.
batched 부울 아니요 내보내기가 일괄로 수행되었는지 여부.
batch_number 정수 아니요 다운로드할 내보내기 일괄의 번호.
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

관련 주제