그룹 관계 내보내기 API

Tier: Free, Premium, Ultimate

Offering: GitLab.com, Self-managed, GitLab Dedicated

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

그룹 관계 내보내기 API는 직접 전송을 통한 그룹 마이그레이션에서 주로 사용되며, 귀하의 GitLab 인스턴스는 특정 전제 조건을 충족해야 합니다.

이 API는 그룹 가져오기 및 내보내기 API와 함께 사용할 수 없습니다.

새 내보내기 예약

새 그룹 관계 내보내기를 시작합니다:

POST /groups/:id/export_relations
Attribute Type Required Description
id integer/string yes 그룹의 ID입니다.
batched boolean no 배치로 내보낼지를 나타냅니다.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/export_relations"
{
  "message": "202 Accepted"
}

내보내기 상태

관계 내보내기의 상태를 조회합니다:

GET /groups/:id/export_relations/status
Attribute Type Required Description
id integer/string yes 그룹의 ID입니다.
relation string no 조회할 프로젝트 최상위 관계의 이름입니다.
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" \
     "https://gitlab.example.com/api/v4/groups/1/export_relations/status"

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

  • 0: started
  • 1: finished
  • -1: failed
[
  {
    "relation": "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 /groups/:id/export_relations/download
Attribute Type Required Description
id integer/string yes 그룹의 ID입니다.
relation string yes 다운로드할 그룹의 최상위 관계의 이름입니다.
batched boolean no 내보내기가 배치인지 여부입니다.
batch_number integer no 다운로드할 내보내기 배치의 번호입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" --remote-header-name \
     --remote-name "https://gitlab.example.com/api/v4/groups/1/export_relations/download?relation=labels"
ls labels.ndjson.gz
labels.ndjson.gz

관련 주제