- Retrieve all snippet repository storage moves
- Retrieve all repository storage moves for a snippet
- Get a single snippet repository storage move
- Get a single repository storage move for a snippet
- Schedule a repository storage move for a snippet
- Schedule repository storage moves for all snippets on a storage shard
Snippet repository storage moves API
Snippet repositories can be moved between storages. This can be useful when
migrating to Gitaly Cluster, for
example.
As snippet repository storage moves are processed, they transition through different states. Values
of To ensure data integrity, snippets are put in a temporary read-only state for the
duration of the move. During this time, users receive a This API requires you to authenticate yourself as an administrator.
For other repository types see:
By default, Example request:
Example response:
By default, Supported attributes:
state
are:
initial
: The record has been created but the background job has not yet been scheduled.
scheduled
: The background job has been scheduled.
started
: The snippet repository is being copied to the destination storage.
replicated
: The snippet has been moved.
failed
: The snippet repository failed to copy or the checksum did not match.
finished
: The snippet has been moved and the repository on the source storage has been deleted.
cleanup failed
: The snippet has been moved but the repository on the source storage could not be deleted.
The repository is temporarily
read-only. Please try again later.
message if they try to push new commits.
Retrieve all snippet repository storage moves
GET /snippet_repository_storage_moves
GET
requests return 20 results at a time because the API results
are paginated.
curl --header "PRIVATE-TOKEN: <your_access_token>" "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"
}
}
]
Retrieve all repository storage moves for a snippet
GET /snippets/:snippet_id/repository_storage_moves
GET
requests return 20 results at a time because the API results
are paginated.
Attribute | Type | Required | Description |
---|---|---|---|
snippet_id
| integer | yes | ID of the snippet. |
Example request:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves"
Example response:
[
{
"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 a single snippet repository storage move
GET /snippet_repository_storage_moves/:repository_storage_id
Supported attributes:
Attribute | Type | Required | Description |
---|---|---|---|
repository_storage_id
| integer | yes | ID of the snippet repository storage move. |
Example request:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/snippet_repository_storage_moves/1"
Example response:
{
"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 a single repository storage move for a snippet
GET /snippets/:snippet_id/repository_storage_moves/:repository_storage_id
Supported attributes:
Attribute | Type | Required | Description |
---|---|---|---|
snippet_id
| integer | yes | ID of the snippet. |
repository_storage_id
| integer | yes | ID of the snippet repository storage move. |
Example request:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/snippets/1/repository_storage_moves/1"
Example response:
{
"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"
}
}
Schedule a repository storage move for a snippet
Supported attributes:
POST /snippets/:snippet_id/repository_storage_moves