InfoGrab Docs

스니펫 저장소 스토리지 이동 API

요약

이 API를 사용하여 스니펫 저장소 스토리지 이동을 관리합니다. 스니펫 저장소 스토리지 이동이 처리되면서 다양한 상태를 거칩니다. 데이터 무결성을 보장하기 위해 이동 기간 동안 스니펫은 임시 읽기 전용 상태가 됩니다. 이 API를 사용하려면 관리자로 인증해야 합니다.

이 API를 사용하여 스니펫 저장소 스토리지 이동을 관리합니다. 이 API는 예를 들어 Gitaly Cluster(Praefect)로 마이그레이션 시 도움이 됩니다.

스니펫 저장소 스토리지 이동이 처리되면서 다양한 상태를 거칩니다. state 값은 다음과 같습니다:

  • initial: 레코드가 생성되었지만 백그라운드 잡이 아직 예약되지 않았습니다.
  • scheduled: 백그라운드 잡이 예약되었습니다.
  • started: 스니펫 저장소가 대상 스토리지로 복사되고 있습니다.
  • replicated: 스니펫이 이동되었습니다.
  • failed: 스니펫 저장소를 복사하지 못했거나 체크섬이 일치하지 않았습니다.
  • finished: 스니펫이 이동되었고 소스 스토리지의 저장소가 삭제되었습니다.
  • cleanup failed: 스니펫이 이동되었지만 소스 스토리지의 저장소를 삭제할 수 없었습니다.

데이터 무결성을 보장하기 위해 이동 기간 동안 스니펫은 임시 읽기 전용 상태가 됩니다. 이 기간 동안 사용자가 새 커밋을 푸시하려고 하면 The repository is temporarily read-only. Please try again later. 메시지를 받습니다.

이 API를 사용하려면 관리자로 인증해야 합니다.

다른 저장소 유형의 경우:

모든 스니펫 저장소 스토리지 이동 목록#

모든 스니펫 저장소 스토리지 이동을 나열합니다.

GET /snippet_repository_storage_moves

기본적으로 GET 요청은 API 결과가 페이지네이션되므로 한 번에 20개의 결과를 반환합니다.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves"

응답 예시:

[
  {
    "id": 1,
    "created_at": "2020-05-07T04:27:17.234Z",
    "state": "scheduled",
    "source_storage_name": "default",
    "destination_storage_name": "storage2",
    "snippet": {
      "id": 65,
      "title": "Test Snippet",
      "description": null,
      "visibility": "internal",
      "updated_at": "2020-12-01T11:15:50.385Z",
      "created_at": "2020-12-01T11:15:50.385Z",
      "project_id": null,
      "web_url": "https://gitlab.example.com/-/snippets/65",
      "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
      "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
      "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
    }
  }
]

스니펫의 모든 저장소 스토리지 이동 목록#

지정된 스니펫의 모든 저장소 스토리지 이동을 나열합니다.

GET /snippets/:snippet_id/repository_storage_moves

기본적으로 GET 요청은 API 결과가 페이지네이션되므로 한 번에 20개의 결과를 반환합니다.

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves"

응답 예시:

[
  {
    "id": 1,
    "created_at": "2020-05-07T04:27:17.234Z",
    "state": "scheduled",
    "source_storage_name": "default",
    "destination_storage_name": "storage2",
    "snippet": {
      "id": 65,
      "title": "Test Snippet",
      "description": null,
      "visibility": "internal",
      "updated_at": "2020-12-01T11:15:50.385Z",
      "created_at": "2020-12-01T11:15:50.385Z",
      "project_id": null,
      "web_url": "https://gitlab.example.com/-/snippets/65",
      "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
      "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
      "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
    }
  }
]

스니펫 저장소 스토리지 이동 검색#

지정된 스니펫 저장소 스토리지 이동을 검색합니다.

GET /snippet_repository_storage_moves/:repository_storage_id

지원되는 속성:

속성 유형 필수 설명
repository_storage_id integer 스니펫 저장소 스토리지 이동의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves/1"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스니펫의 저장소 스토리지 이동 검색#

지정된 스니펫의 저장소 스토리지 이동을 검색합니다.

GET /snippets/:snippet_id/repository_storage_moves/:repository_storage_id

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.
repository_storage_id integer 스니펫 저장소 스토리지 이동의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves/1"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스니펫의 저장소 스토리지 이동 예약#

지정된 스니펫의 저장소 스토리지 이동을 예약합니다.

POST /snippets/:snippet_id/repository_storage_moves

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.
destination_storage_name string 아니요 대상 스토리지 샤드의 이름. 제공하지 않으면 스토리지 가중치에 따라 자동으로 선택됩니다.

요청 예시:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --header "Content-Type: application/json" \
  --data '{"destination_storage_name":"storage2"}' \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스토리지 샤드의 모든 스니펫에 대한 저장소 스토리지 이동 예약#

소스 스토리지 샤드에 저장된 각 스니펫 저장소에 대한 저장소 스토리지 이동을 예약합니다. 이 엔드포인트는 모든 스니펫을 한 번에 마이그레이션합니다.

POST /snippet_repository_storage_moves

지원되는 속성:

속성 유형 필수 설명
source_storage_name string 소스 스토리지 샤드의 이름.
destination_storage_name string 아니요 대상 스토리지 샤드의 이름. 제공하지 않으면 스토리지 가중치에 따라 자동으로 선택됩니다.

요청 예시:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --header "Content-Type: application/json" \
  --data '{"source_storage_name":"default"}' \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves"

응답 예시:

{
  "message": "202 Accepted"
}

관련 항목#

스니펫 저장소 스토리지 이동 API

Tier: Free, Premium, Ultimate
Offering: GitLab Self-Managed, GitLab Dedicated
원문 보기
요약

이 API를 사용하여 스니펫 저장소 스토리지 이동을 관리합니다. 스니펫 저장소 스토리지 이동이 처리되면서 다양한 상태를 거칩니다. 데이터 무결성을 보장하기 위해 이동 기간 동안 스니펫은 임시 읽기 전용 상태가 됩니다. 이 API를 사용하려면 관리자로 인증해야 합니다.

이 API를 사용하여 스니펫 저장소 스토리지 이동을 관리합니다. 이 API는 예를 들어 Gitaly Cluster(Praefect)로 마이그레이션 시 도움이 됩니다.

스니펫 저장소 스토리지 이동이 처리되면서 다양한 상태를 거칩니다. state 값은 다음과 같습니다:

  • initial: 레코드가 생성되었지만 백그라운드 잡이 아직 예약되지 않았습니다.
  • scheduled: 백그라운드 잡이 예약되었습니다.
  • started: 스니펫 저장소가 대상 스토리지로 복사되고 있습니다.
  • replicated: 스니펫이 이동되었습니다.
  • failed: 스니펫 저장소를 복사하지 못했거나 체크섬이 일치하지 않았습니다.
  • finished: 스니펫이 이동되었고 소스 스토리지의 저장소가 삭제되었습니다.
  • cleanup failed: 스니펫이 이동되었지만 소스 스토리지의 저장소를 삭제할 수 없었습니다.

데이터 무결성을 보장하기 위해 이동 기간 동안 스니펫은 임시 읽기 전용 상태가 됩니다. 이 기간 동안 사용자가 새 커밋을 푸시하려고 하면 The repository is temporarily read-only. Please try again later. 메시지를 받습니다.

이 API를 사용하려면 관리자로 인증해야 합니다.

다른 저장소 유형의 경우:

모든 스니펫 저장소 스토리지 이동 목록#

모든 스니펫 저장소 스토리지 이동을 나열합니다.

GET /snippet_repository_storage_moves

기본적으로 GET 요청은 API 결과가 페이지네이션되므로 한 번에 20개의 결과를 반환합니다.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves"

응답 예시:

[
  {
    "id": 1,
    "created_at": "2020-05-07T04:27:17.234Z",
    "state": "scheduled",
    "source_storage_name": "default",
    "destination_storage_name": "storage2",
    "snippet": {
      "id": 65,
      "title": "Test Snippet",
      "description": null,
      "visibility": "internal",
      "updated_at": "2020-12-01T11:15:50.385Z",
      "created_at": "2020-12-01T11:15:50.385Z",
      "project_id": null,
      "web_url": "https://gitlab.example.com/-/snippets/65",
      "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
      "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
      "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
    }
  }
]

스니펫의 모든 저장소 스토리지 이동 목록#

지정된 스니펫의 모든 저장소 스토리지 이동을 나열합니다.

GET /snippets/:snippet_id/repository_storage_moves

기본적으로 GET 요청은 API 결과가 페이지네이션되므로 한 번에 20개의 결과를 반환합니다.

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves"

응답 예시:

[
  {
    "id": 1,
    "created_at": "2020-05-07T04:27:17.234Z",
    "state": "scheduled",
    "source_storage_name": "default",
    "destination_storage_name": "storage2",
    "snippet": {
      "id": 65,
      "title": "Test Snippet",
      "description": null,
      "visibility": "internal",
      "updated_at": "2020-12-01T11:15:50.385Z",
      "created_at": "2020-12-01T11:15:50.385Z",
      "project_id": null,
      "web_url": "https://gitlab.example.com/-/snippets/65",
      "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
      "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
      "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
    }
  }
]

스니펫 저장소 스토리지 이동 검색#

지정된 스니펫 저장소 스토리지 이동을 검색합니다.

GET /snippet_repository_storage_moves/:repository_storage_id

지원되는 속성:

속성 유형 필수 설명
repository_storage_id integer 스니펫 저장소 스토리지 이동의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves/1"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스니펫의 저장소 스토리지 이동 검색#

지정된 스니펫의 저장소 스토리지 이동을 검색합니다.

GET /snippets/:snippet_id/repository_storage_moves/:repository_storage_id

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.
repository_storage_id integer 스니펫 저장소 스토리지 이동의 ID.

요청 예시:

curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves/1"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스니펫의 저장소 스토리지 이동 예약#

지정된 스니펫의 저장소 스토리지 이동을 예약합니다.

POST /snippets/:snippet_id/repository_storage_moves

지원되는 속성:

속성 유형 필수 설명
snippet_id integer 스니펫의 ID.
destination_storage_name string 아니요 대상 스토리지 샤드의 이름. 제공하지 않으면 스토리지 가중치에 따라 자동으로 선택됩니다.

요청 예시:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --header "Content-Type: application/json" \
  --data '{"destination_storage_name":"storage2"}' \
  --url "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves"

응답 예시:

{
  "id": 1,
  "created_at": "2020-05-07T04:27:17.234Z",
  "state": "scheduled",
  "source_storage_name": "default",
  "destination_storage_name": "storage2",
  "snippet": {
    "id": 65,
    "title": "Test Snippet",
    "description": null,
    "visibility": "internal",
    "updated_at": "2020-12-01T11:15:50.385Z",
    "created_at": "2020-12-01T11:15:50.385Z",
    "project_id": null,
    "web_url": "https://gitlab.example.com/-/snippets/65",
    "raw_url": "https://gitlab.example.com/-/snippets/65/raw",
    "ssh_url_to_repo": "ssh://user@gitlab.example.com/snippets/65.git",
    "http_url_to_repo": "https://gitlab.example.com/snippets/65.git"
  }
}

스토리지 샤드의 모든 스니펫에 대한 저장소 스토리지 이동 예약#

소스 스토리지 샤드에 저장된 각 스니펫 저장소에 대한 저장소 스토리지 이동을 예약합니다. 이 엔드포인트는 모든 스니펫을 한 번에 마이그레이션합니다.

POST /snippet_repository_storage_moves

지원되는 속성:

속성 유형 필수 설명
source_storage_name string 소스 스토리지 샤드의 이름.
destination_storage_name string 아니요 대상 스토리지 샤드의 이름. 제공하지 않으면 스토리지 가중치에 따라 자동으로 선택됩니다.

요청 예시:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --header "Content-Type: application/json" \
  --data '{"source_storage_name":"default"}' \
  --url "https://gitlab.example.com/api/v4/snippet_repository_storage_moves"

응답 예시:

{
  "message": "202 Accepted"
}

관련 항목#