mongosync usage and instructions on how
to upgrade your version of mongosync.Description
Returns either an updated status of the synchronization process or an error.
Request
GET /api/v1/progress
Response
The progress endpoint returns either an updated status or an error.
Successful Response
If mongosync successfully gets the status of the sync process,
all response fields are wrapped in a top-level progress object
with the following fields:
Field | Type | Description |
|---|---|---|
| string | The current state of |
| boolean | If |
| boolean | If Index validation continues until the commit is complete. |
| string | Provides extra information on the synchronization progress.
Possible
|
| integer | Time in seconds between the last applied event and time of the
current latest event for this instance of Note
|
| object | Estimates the total amount of data being copied from collections and the amount that has already been copied to the destination cluster |
| integer | Estimated total number of bytes to be copied globally by all
|
| integer | Estimated number of bytes which have been copied to the destination
cluster by this To calculate the total estimated progress as a percentage, add the value
of the The value of |
| object | Describes the mapping direction for the synchronization, namely the source and destination clusters. |
| string | Source cluster. Returned in the form
|
| string | Destination cluster. Returned in the form
|
| string | The identifier string for the |
| string | The identifier string for the coordinator instance.
|
Error Response
If mongosync encounters an error, the progress endpoint returns
the following field:
Field | Type | Description |
|---|---|---|
| string | If an error occurred, gives a detailed description of the error. This field is omitted when the call to the endpoint is successful |
Behavior
When
mongosyncis in theIDLEstate, all output fields exceptstateandcanCommitarenull.When
mongosyncis in thePAUSEDstate, thelagTimeSecondsfield isnull.The endpoint does not auto-refresh. To get updated status, call the
progressendpoint again.Note
Starting in
mongosync1.7.3,mongosynccan take at least two minutes to respond when you resume or restart a sync operation. During this time, any calls to theprogressendpoint might fail. If aprogresscall fails, it is safe to retry.
Endpoint Protection
mongosync does not protect the progress endpoint. However, by default
the API binds to localhost only and does not accept calls from other sources.
Additionally, the progress call does not expose connection credentials
or user data.
Example
The following example returns the status of the synchronization process.
Request
curl localhost:27182/api/v1/progress -XGET
Response
{ "progress": { "state":"RUNNING", "canCommit":true, "canWrite":false, "info":"change event application", "lagTimeSeconds":0, "collectionCopy": { "estimatedTotalBytes":694, "estimatedCopiedBytes":694 }, "directionMapping": { "Source":"cluster0: localhost:27017", "Destination":"cluster1: localhost:27018" } } }