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 | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of 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 | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auth_ | String | Mirror authentication method Allowed values: ssh_,password |
enabled | Boolean | If true, |
host_ | Array of strings | SSH host keys in bare format,ssh-,known_ format,hostname ssh-. |
keep_ | Boolean | If true, |
only_ | Boolean | If true, |
urlRequired | String | Target URL to which the repository is mirrored 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 | ID or URL- |
mirror_Path, | String | ID of the 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 | ID or URL- |
mirror_Path, | String | ID of the remote mirror |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auth_ | String | Mirror authentication method |
enabled | Boolean | If true,Example: true |
host_ | Array of strings | SSH host keys in bare format,ssh-,known_ format,hostname ssh-. |
keep_ | Boolean | If true, |
only_ | Boolean | If true, |
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 | ID or URL- |
mirror_Path, | String | ID of the 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 | ID or URL- |
mirror_Path, | String | ID of the 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 | ID or URL- |
mirror_Path, | String | ID of the 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: |