Use this API to manage remote mirrors. You can query and modify the state of these mirrors.
For security reasons, the url attribute in the API response is always scrubbed of username
and password information.
Pull mirrors use a different API endpoint to display and update them.
List all remote mirrors for a project
GET /api/v4/projects/{id}/remote_mirrors
Lists all remote mirrors for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Create a push mirror
POST /api/v4/projects/{id}/remote_mirrors
Creates a push mirror.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auth_ | String | Determines the mirror authentication method Allowed values: ssh_,password |
enabled | Boolean | Determines if the mirror is enabled |
host_ | Array of strings | SSH host keys in bare format (ssh- |
keep_ | Boolean | Determines if divergent refs are kept on the target |
only_ | Boolean | Determines if only protected branches are mirrored |
urlRequired | String | The URL for a remote mirror Example: https: |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Retrieve a remote mirror for a project
GET /api/v4/projects/{id}/remote_mirrors/{mirror_id}
Retrieves a specified remote mirror for a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
mirror_Path, | String | The ID of a remote mirror |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Update a remote mirror in a project
PUT /api/v4/projects/{id}/remote_mirrors/{mirror_id}
Updates the configuration or operational status of a specified remote mirror.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
mirror_Path, | String | The ID of a remote mirror |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auth_ | String | Determines the mirror authentication method |
enabled | Boolean | Determines if the mirror is enabled Example: true |
host_ | Array of strings | SSH host keys in bare format (ssh- |
keep_ | Boolean | Determines if divergent refs are kept on the target |
only_ | Boolean | Determines if only protected branches are mirrored |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Delete a remote mirror from a project
DELETE /api/v4/projects/{id}/remote_mirrors/{mirror_id}
Deletes a specified remote mirror from a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
mirror_Path, | String | The ID of a remote mirror |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Retrieve a public key for a remote mirror
GET /api/v4/projects/{id}/remote_mirrors/{mirror_id}/public_key
Retrieves the public key of a specified remote mirror that uses SSH authentication.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
mirror_Path, | String | The ID of a remote mirror |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Force push mirror update
POST /api/v4/projects/{id}/remote_mirrors/{mirror_id}/sync
Forces an update to a push mirror.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
mirror_Path, | String | The ID of a remote mirror |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad request | — |
401 | Unauthorized | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesMirrorHostKey
| Property | Type | Description |
|---|---|---|
fingerprint_ | String | Example:SHA256: |
APIEntitiesRemoteMirror
| Property | Type | Description |
|---|---|---|
auth_ | String | Example:password |
enabled | Boolean | Example:true |
host_ | Array of APIEntities | — |
id | Integer (int64) | Example:101486 |
keep_ | Boolean | — |
last_ | String | Example:The remote mirror URL is invalid. |
last_ | String (date- | Example:2020- |
last_ | String (date- | Example:2020- |
last_ | String (date- | Example:2020- |
only_ | Boolean | — |
update_ | String | Example:finished |
url | String | Example:https: |