@@ -8,7 +8,7 @@ Percona MongoLink is a tool for replicating data from a source MongoDB cluster t
88- ** Real-Time Replication** : Tail the oplog to keep your target cluster up to date.
99- ** Namespace Filtering** : Specify which databases and collections to include or exclude.
1010- ** Automatic Index Management** : Ensure necessary indexes are created on the target.
11- - ** HTTP API** : Start, finalize, and check replication status via REST endpoints.
11+ - ** HTTP API** : Start, finalize, pause, resume, and check replication status via REST endpoints.
1212
1313## Setup
1414
@@ -87,6 +87,38 @@ bin/mongolink finalize
8787curl -X POST http://localhost:2242/finalize
8888` ` `
8989
90+ # ## Pausing the Replication
91+
92+ To pause the replication process, you can either use the command-line interface or send a POST request to the ` /pause` endpoint:
93+
94+ # ### Using Command-Line Interface
95+
96+ ` ` ` sh
97+ bin/mongolink pause
98+ ` ` `
99+
100+ # ### Using HTTP API
101+
102+ ` ` ` sh
103+ curl -X POST http://localhost:2242/pause
104+ ` ` `
105+
106+ # ## Resuming the Replication
107+
108+ To resume the replication process, you can either use the command-line interface or send a POST request to the ` /resume` endpoint:
109+
110+ # ### Using Command-Line Interface
111+
112+ ` ` ` sh
113+ bin/mongolink resume
114+ ` ` `
115+
116+ # ### Using HTTP API
117+
118+ ` ` ` sh
119+ curl -X POST http://localhost:2242/resume
120+ ` ` `
121+
90122# ## Checking the Status
91123
92124To check the current status of the replication process, you can either use the command-line interface or send a GET request to the ` /status` endpoint:
@@ -131,12 +163,10 @@ When using the `--log-json` option, the logs will be output in JSON format with
131163- ` s` : Scope of the log entry.
132164- ` ns` : Namespace (database.collection format).
133165- ` elapsed_secs` : The duration in seconds for the specific operation to complete.
134- - ` total_elapsed_secs` : The cumulative time in seconds for the entire process, including all operations.
135166
136167Example:
137168
138169` ` ` json
139-
140170{ " level" : " info" ,
141171 " s" : " clone" ,
142172 " ns" : " db_1.coll_1" ,
@@ -149,7 +179,6 @@ Example:
149179 " elapsed_secs" : 0,
150180 " time" : " 2025-02-23 11:26:03.857" ,
151181 " message" : " Change replication stopped at 1740335163.1740335163 source cluster time" }
152-
153182` ` `
154183
155184# # HTTP API
@@ -202,29 +231,61 @@ Example:
202231}
203232` ` `
204233
234+ # ## POST /pause
235+
236+ Pauses the replication process.
237+
238+ # ### Response
239+
240+ - ` ok` : Boolean indicating if the operation was successful.
241+ - ` error` (optional): Error message if the operation failed.
242+
243+ Example:
244+
245+ ` ` ` json
246+ {
247+ " ok" : true
248+ }
249+ ` ` `
250+
251+ # ## POST /resume
252+
253+ Resumes the replication process.
254+
255+ # ### Response
256+
257+ - ` ok` : Boolean indicating if the operation was successful.
258+ - ` error` (optional): Error message if the operation failed.
259+
260+ Example:
261+
262+ ` ` ` json
263+ {
264+ " ok" : true
265+ }
266+ ` ` `
267+
205268# ## GET /status
206269
207- The /status endpoint provides the current state of the MongoLink replication
208- process, including its progress, lag, and event processing details.
270+ The /status endpoint provides the current state of the MongoLink replication process, including its progress, lag, and event processing details.
209271
210272# ### Response
211273
212274- ` ok` : indicates if the operation was successful.
213275- ` state` : the current state of the replication.
214- - ` info` (optional) : provides additional information about the current state.
276+ - ` info` : provides additional information about the current state.
215277- ` error` (optional): the error message if the operation failed.
216278
217- - ` lagTime` (optional) : the current lag time in logical seconds between source and target clusters.
218- - ` eventsProcessed` (optional) : the number of events processed.
219- - ` lastReplicatedOpTime` (optional) : the last replicated operation time.
279+ - ` lagTime` : the current lag time in logical seconds between source and target clusters.
280+ - ` eventsProcessed` : the number of events processed.
281+ - ` lastReplicatedOpTime` : the last replicated operation time.
220282
221- - ` initialSync.pauseOnInitialSync` (optional): indicates if the replication is paused on initial sync.
222283- ` initialSync.completed` : indicates if the initial sync is completed.
223284- ` initialSync.lagTime` : the lag time in logical seconds until the initial sync completed.
224285
225286- ` initialSync.cloneCompleted` : indicates if the cloning process is completed.
226- - ` initialSync.estimatedCloneSize` (optional) : the estimated total size of the clone.
227- - ` initialSync.clonedSize` (optional) : the size of the data that has been cloned.
287+ - ` initialSync.estimatedCloneSize` : the estimated total size of the clone.
288+ - ` initialSync.clonedSize` : the size of the data that has been cloned.
228289
229290Example:
230291
0 commit comments