그룹 관계 익스포트 API
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
- GitLab 13.12에서 소개되었습니다.
그룹 관계 익스포트 API는 주로 직접 이관에 의한 그룹 이관에서 사용되며 귀하의 GitLab 인스턴스는 특정 사전 조건을 충족해야합니다. 이 API는 그룹 가져오기 및 익스포트 API와 함께 사용할 수 없습니다.
새 익스포트 일정
새 그룹 관계 익스포트를 시작합니다:
POST /groups/:id/export_relations
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
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
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
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
:시작됨
-
1
:완료됨
-
-1
:실패함
[
{
"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
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
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