Retrieves the synchronization status for the specified repository. In addition to listing refs which cannot be synchronized, if any, the status also provides the timestamp for the most recent synchronization and indicates whether synchronization is available and enabled. If "?at" is specified in the URL, the synchronization status for the specified ref is returned, rather than the complete repository status.
The authenticated user must have REPO_READ permission for the repository, or it must be public if the request is anonymous. Additionally, after synchronization is enabled for a repository, meaning synchronization was available at that time, permission changes and other actions can cause it to become unavailable. Even when synchronization is enabled, if it is no longer available for the repository it will not be performed.
string
Requiredstring
Requiredstring
Synchronization status for the specified repository, or specific ref within that repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"aheadRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"divergedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"orphanedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"enabled": true,
"available": true
}
Enables or disables synchronization for the specified repository. When synchronization is enabled, branches within the repository are immediately synchronized and the status is updated with the outcome. That initial synchronization is performed before the REST request returns, allowing it to return the updated status.
The authenticated user must have REPO_ADMIN permission for the specified repository. Anonymous users cannot manage synchronization, even on public repositories. Additionally, synchronization must be available for the specified repository. Synchronization is only available if:
string
Requiredstring
Requiredboolean
The updated synchronization status for the repository, after enabling synchronization. 204 NO CONTENT is returned instead after disabling synchronization.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"aheadRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"divergedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"orphanedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"enabled": true,
"available": true
}
Allows developers to apply a manual operation to bring a ref back in sync with upstream when it becomes out of sync due to conflicting changes. The following actions are supported:
The authenticated user must have REPO_WRITE permission for the specified repository. Anonymous users cannot synchronize refs, even on public repositories. Additionally, synchronization must be enabled and available for the specified repository.
string
Requiredstring
Requiredstring
Context
string
The requested action was successfully performed, and has updated the ref's state, but the ref if is still not in sync with upstream. For example, after applying the MERGE action, the ref will still be AHEAD of upstream. If the action brings the ref in sync with upstream, 204 NO CONTENT is returned instead.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}/synchronize' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"action": "MERGE",
"context": {
"commitMessage": "Merging in latest from upstream."
},
"refId": "refs/heads/master"
}'
1
2
3
4
5
6
7
{
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Rate this page: