Skip to content

Commit 3acd138

Browse files
(DOCSP-22948): start endpoint (#11)
* (DOCSP-22948): start endpoint * update request formatting * wording * missing space * typo fix
1 parent 2cda30f commit 3acd138

File tree

5 files changed

+119
-1
lines changed

5 files changed

+119
-1
lines changed

source/includes/api/requests/start.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
curl localhost:27182/api/v1/start -XPOST
2+
--data '
3+
{
4+
"source": "cluster0",
5+
"destination": "cluster1"
6+
} '
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"success":true}

source/reference.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Reference
77
.. toctree::
88
:titlesonly:
99

10+
/reference/api
1011
/reference/mongosync
11-
12+

source/reference/api.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _c2c-api:
2+
3+
.. default-domain:: mongodb
4+
5+
===
6+
API
7+
===
8+
9+
.. toctree::
10+
:titlesonly:
11+
12+
/reference/api/start

source/reference/api/start.txt

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. _c2c-api-start:
2+
3+
=========
4+
``start``
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+
Starts the synchronization between a source and destination cluster.
19+
20+
Request
21+
-------
22+
23+
.. code-block:: http
24+
25+
POST /api/v1/start
26+
27+
Request Body Parameters
28+
~~~~~~~~~~~~~~~~~~~~~~~
29+
30+
.. list-table::
31+
:header-rows: 1
32+
:stub-columns: 1
33+
:widths: 20 13 13 54
34+
35+
* - Parameter
36+
- Type
37+
- Necessity
38+
- Description
39+
40+
* - ``source``
41+
- string
42+
- Required
43+
- Name of the source cluster.
44+
45+
* - ``destination``
46+
- string
47+
- Required
48+
- Name of the destination cluster.
49+
50+
Response
51+
--------
52+
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``.
75+
76+
Example
77+
-------
78+
79+
The following example starts a synchronization job where ``cluster0`` is
80+
the source and ``cluster1`` is the destination.
81+
82+
Request
83+
~~~~~~~
84+
85+
.. literalinclude:: /includes/api/requests/start.sh
86+
:language: shell
87+
88+
Response
89+
~~~~~~~~
90+
91+
.. literalinclude:: /includes/api/responses/success.sh
92+
:language: shell
93+
94+
Behavior
95+
--------
96+
97+
If {+c2c-product-name+} is in a state other than ``IDLE``, the request
98+
fails.

0 commit comments

Comments
 (0)