Skip to content

Commit d51d778

Browse files
(DOCSP-22949): pause endpoint (#12)
* (DOCSP-22949): pause endpoint * update example * fix example links * wording and reformatting * add link to faq * wording * typo
1 parent 07bf306 commit d51d778

File tree

6 files changed

+104
-25
lines changed

6 files changed

+104
-25
lines changed

source/faq.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ When ``mongosync`` runs on its own hardware, it does not have to use
1818
the same operation system (OS) as the source or destination clusters it
1919
is connecting.
2020

21+
.. _c2c-faq-increase-oplog:
22+
2123
Should I increase the size of the oplog in the source cluster?
2224
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2325

@@ -88,4 +90,3 @@ have more than 2 non-arbiter nodes and you must sync from a non-arbiter
8890
node. Use the source cluster's connection string to specify a
8991
:ref:`read preference <mongodb-uri>` for a non-arbiter, data-bearing
9092
node.
91-

source/includes/api/requests/pause.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl localhost:27182/api/v1/pause -XPOST --data '{ }'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:stub-columns: 1
4+
:widths: 20 14 66
5+
6+
* - Name
7+
- Type
8+
- Description
9+
10+
* - ``success``
11+
- boolean
12+
- When the request is successful, this value is ``true``.
13+
14+
* - ``error``
15+
- string
16+
- If an error occurred, indicates the name of the error. This field
17+
is omitted from the response when ``success`` is ``true``.
18+
19+
* - ``errorDescription``
20+
- string
21+
- Detailed description of the error that occurred. This field is
22+
omitted from the response when ``success`` is ``true``.

source/reference/api.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ API
99
.. toctree::
1010
:titlesonly:
1111

12+
/reference/api/pause
1213
/reference/api/start

source/reference/api/pause.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.. _c2c-api-pause:
2+
3+
=========
4+
``pause``
5+
=========
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 2
13+
:class: singlecol
14+
15+
Description
16+
-----------
17+
18+
Pauses the current synchronization operation.
19+
20+
Requirement
21+
-----------
22+
23+
To use the ``pause`` endpoint, the {+c2c-product-name+} must be in the
24+
``RUNNING`` state.
25+
26+
Request
27+
-------
28+
29+
.. code-block:: http
30+
31+
POST /api/v1/pause
32+
33+
Request Body Parameters
34+
~~~~~~~~~~~~~~~~~~~~~~~
35+
36+
This endpoint does not use HTTP request body parameters.
37+
38+
Response
39+
--------
40+
41+
.. include:: /includes/api/tables/basic-response.rst
42+
43+
Example
44+
-------
45+
46+
The following example pauses the current synchronization operation.
47+
48+
Request
49+
~~~~~~~
50+
51+
.. literalinclude:: /includes/api/requests/pause.sh
52+
:language: shell
53+
54+
Response
55+
~~~~~~~~
56+
57+
.. literalinclude:: /includes/api/responses/success.sh
58+
:language: shell
59+
60+
Behavior
61+
--------
62+
63+
- If the ``pause`` request is successful, {+c2c-product-name+} enters the
64+
``PAUSED`` state.
65+
66+
- If you plan to pause synchronization for an extended period of time,
67+
increase the size of the replica set :term:`oplog` in the source
68+
cluster. To learn more, see :ref:`Frequently Asked Questions
69+
<c2c-faq-increase-oplog>`.

source/reference/api/start.txt

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Description
1717

1818
Starts the synchronization between a source and destination cluster.
1919

20+
Requirement
21+
-----------
22+
23+
To use the ``start`` endpoint, the {+c2c-product-name+} must be in the
24+
``IDLE`` state.
25+
2026
Request
2127
-------
2228

@@ -50,28 +56,7 @@ Request Body Parameters
5056
Response
5157
--------
5258

53-
.. list-table::
54-
:header-rows: 1
55-
:stub-columns: 1
56-
:widths: 20 14 66
57-
58-
* - Name
59-
- Type
60-
- Description
61-
62-
* - ``success``
63-
- boolean
64-
- When the request is successful, this value is ``true``.
65-
66-
* - ``error``
67-
- string
68-
- If an error occurred, indicates the name of the error. This field
69-
is omitted from the response when ``success`` is ``true``.
70-
71-
* - ``errorDescription``
72-
- string
73-
- Detailed description of the error that occurred. This field is
74-
omitted from the response when ``success`` is ``true``.
59+
.. include:: /includes/api/tables/basic-response.rst
7560

7661
Example
7762
-------
@@ -94,5 +79,5 @@ Response
9479
Behavior
9580
--------
9681

97-
If {+c2c-product-name+} is in a state other than ``IDLE``, the request
98-
fails.
82+
If the ``start`` request is successful, {+c2c-product-name+} enters the
83+
``RUNNING`` state.

0 commit comments

Comments
 (0)