Skip to content

Commit d131408

Browse files
authored
DOCSP-1175: [mongocli] atlas backup (create, describe, watch, delete) commands (#194)
1 parent 420e7f5 commit d131408

File tree

6 files changed

+488
-0
lines changed

6 files changed

+488
-0
lines changed

_mcli-atlas-backup-snapshots-list-cmd:

Whitespace-only changes.

source/reference/atlas/backup-commands.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ Atlas ``backup`` Commands
1212
Start a Backup Restore </reference/atlas/backup-restore-start>
1313
List Backup Snapshots </reference/atlas/backup-snapshots-list>
1414
List Backup Restore Jobs </reference/atlas/backup-restore-list>
15+
Create a Backup Snapshot </reference/atlas/backup-snapshots-create>
16+
Describe a Backup Snapshot </reference/atlas/backup-snapshots-describe>
17+
Watch a Backup Snapshot </reference/atlas/backup-snapshots-watch>
18+
Delete a Backup Snapshot </reference/atlas/backup-snapshots-delete>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
.. _mcli-atlas-backup-snapshots-create-cmd:
2+
3+
======================================
4+
mongocli atlas backup snapshots create
5+
======================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/styles/corrections.rst
16+
17+
The ``backup snapshots create`` command creates a backup snapshot on the
18+
specified cluster. You can also create a backup snapshot through the
19+
|service| :atlas:`UI </backup/cloud-backup/overview/#on-demand-snapshots>`
20+
or :atlas:`API </reference/api/cloud-backup/backup/take-one-ondemand-backup/>`.
21+
22+
.. important::
23+
24+
On-demand backup snapshots are available to |service| cluster tiers
25+
``M10`` and higher. :atlas:`Learn more </scale-cluster/>` about upgrading
26+
a cluster to a higher tier.
27+
28+
.. _mcli-atlas-backup-snapshots-create-syntax:
29+
30+
Syntax
31+
------
32+
33+
.. code-block:: text
34+
35+
mongocli atlas backup snapshots create <cluster-name>
36+
--desc "<description-of-snapshot>"
37+
--retention <number-of-days>
38+
[ --output|-o <output-format> ]
39+
[ --profile|-P <profile-name> ]
40+
[ --projectId <project-ID> ]
41+
42+
.. include:: /includes/fact-command-line-help.rst
43+
44+
.. _mcli-atlas-backup-snapshots-create-options:
45+
46+
Options
47+
-------
48+
49+
.. list-table::
50+
:header-rows: 1
51+
:widths: 20 10 60 10
52+
53+
* - Option
54+
- Type
55+
- Description
56+
- Required?
57+
58+
* - ``<cluster-name>``
59+
- string
60+
- Name of the cluster.
61+
- yes
62+
63+
* - ``--desc``
64+
- string
65+
- Description of the snapshot.
66+
- yes
67+
68+
* - ``--retention``
69+
- integer
70+
- Number of days to retain the snapshot.
71+
- yes
72+
73+
* - ``--output``, ``-o``
74+
- string
75+
- .. include:: /includes/extracts/fact-basic-options-output.rst
76+
- no
77+
78+
* - ``--profile``, ``-P``
79+
- string
80+
- Name of the profile where the project ID and the |svc-api-key|\s
81+
for the project are saved. If omitted, uses the {+default-profile+}.
82+
To learn more about creating a profile, see :ref:`mcli-configure`.
83+
- no
84+
85+
* - ``--projectId``
86+
- string
87+
- Unique identifier of the project that contains the cluster.
88+
If omitted, uses the project ID in the profile or :ref:`environment
89+
variable <mcli-env-var>`.
90+
- no
91+
92+
.. _mcli-atlas-backup-snapshots-create-output:
93+
94+
Output
95+
------
96+
97+
If the command is successful, it returns the following response:
98+
99+
.. code-block:: none
100+
:copyable: false
101+
102+
Snapshot '<snapshot-id>' created.
103+
104+
.. _mcli-atlas-backup-snapshots-create-examples:
105+
106+
Example
107+
-------
108+
109+
The following example uses the ``mongocli atlas backup snapshots create``
110+
command to create a backup snapshot for the cluster named ``myDemo``. The
111+
command uses the {+default-profile+}, where the project ID and the
112+
|svc-api-key|\s are stored.
113+
114+
.. code-block:: json
115+
116+
mongocli atlas backups snapshots create myDemo --desc "Daily snapshot" --retention 30
117+
118+
The command prints the following output to the terminal.
119+
120+
.. code-block:: none
121+
:copyable: false
122+
123+
Snapshot '5f4006d29d52d968122ee664' created.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.. _mcli-atlas-backup-snapshots-delete-cmd:
2+
3+
======================================
4+
mongocli atlas backup snapshots delete
5+
======================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/styles/corrections.rst
16+
17+
The ``backup snapshots delete`` command deletes a specified backup snapshot.
18+
You can also delete a snapshot through the |service| :atlas:`UI
19+
</backup/cloud-backup/overview/>` or :atlas:`API
20+
</reference/api/cloud-backup/backup/delete-one-backup/>`.
21+
22+
.. _mcli-atlas-backup-snapshots-delete-syntax:
23+
24+
Syntax
25+
------
26+
27+
.. code-block:: text
28+
29+
mongocli atlas backup snapshots delete <snapshot-id>
30+
--clusterName <cluster-name>
31+
[ --force ]
32+
[ --output|-o <output-format> ]
33+
[ --profile|-P <profile-name> ]
34+
[ --projectId <project-ID> ]
35+
36+
.. include:: /includes/fact-command-line-help.rst
37+
38+
.. _mcli-atlas-backup-snapshots-delete-options:
39+
40+
Options
41+
-------
42+
43+
.. list-table::
44+
:header-rows: 1
45+
:widths: 20 10 60 10
46+
47+
* - Option
48+
- Type
49+
- Description
50+
- Required?
51+
52+
* - ``<snapshot-id>``
53+
- string
54+
- Unique identifier of the snapshot.
55+
- yes
56+
57+
* - ``--clusterName``
58+
- string
59+
- Name of the cluster.
60+
- yes
61+
62+
* - ``--force``
63+
-
64+
- Flag that indicates that the snapshot can
65+
be deleted without requiring confirmation.
66+
- no
67+
68+
* - ``--output``, ``-o``
69+
- string
70+
- .. include:: /includes/extracts/fact-basic-options-output.rst
71+
- no
72+
73+
* - ``--profile``, ``-P``
74+
- string
75+
- Name of the profile where the project ID and the |svc-api-key|\s
76+
for the project are saved. If omitted, uses the {+default-profile+}.
77+
To learn more about creating a profile, see :ref:`mcli-configure`.
78+
- no
79+
80+
* - ``--projectId``
81+
- string
82+
- Unique identifier of the project that contains the cluster.
83+
If omitted, uses the project ID in the profile or :ref:`environment
84+
variable <mcli-env-var>`.
85+
- no
86+
87+
.. _mcli-atlas-backup-snapshots-delete-output:
88+
89+
Output
90+
------
91+
92+
If the command is successful, it returns the following response:
93+
94+
.. code-block:: none
95+
:copyable: false
96+
97+
Snapshot '<snapshot-id>' deleted
98+
99+
.. _mcli-atlas-backup-snapshots-delete-examples:
100+
101+
Example
102+
-------
103+
104+
The following example uses the ``mongocli atlas backup snapshots delete``
105+
command to delete a backup snapshot for the cluster named ``myDemo``. The
106+
command uses the {+default-profile+}, where the project ID and the
107+
|svc-api-key|\s are stored.
108+
109+
.. code-block:: json
110+
111+
mongocli atlas backups snapshots delete 5f4007f327a3bd7b6f4103c5 --clusterName myDemo
112+
113+
The command prints the following output to the terminal.
114+
115+
.. code-block:: none
116+
:copyable: false
117+
118+
Snapshot '5f4006d29d52d968122ee664' deleted
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
.. _mcli-atlas-backup-snapshots-describe-cmd:
2+
3+
========================================
4+
mongocli atlas backup snapshots describe
5+
========================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/styles/corrections.rst
16+
17+
The ``backup snapshots describe`` command returns information about a
18+
specified backup snapshot. You can also retrieve information about a
19+
snapshot through the |service| :atlas:`UI
20+
</backup/cloud-backup/overview/#on-demand-snapshots>`
21+
or :atlas:`API </reference/api/cloud-backup/backup/get-one-backup/>`.
22+
23+
.. _mcli-atlas-backup-snapshots-describe-syntax:
24+
25+
Syntax
26+
------
27+
28+
.. code-block:: text
29+
30+
mongocli atlas backup snapshots describe <snapshot-id>
31+
--clusterName <cluster-name>
32+
[ --output|-o <output-format> ]
33+
[ --profile|-P <profile-name> ]
34+
[ --projectId <project-ID> ]
35+
36+
.. include:: /includes/fact-command-line-help.rst
37+
38+
.. _mcli-atlas-backup-snapshots-describe-options:
39+
40+
Options
41+
-------
42+
43+
.. list-table::
44+
:header-rows: 1
45+
:widths: 20 10 60 10
46+
47+
* - Option
48+
- Type
49+
- Description
50+
- Required?
51+
52+
* - ``<snapshot-id>``
53+
- string
54+
- Unique identifier of the snapshot.
55+
- yes
56+
57+
* - ``--clusterName``
58+
- string
59+
- Name of the cluster.
60+
- yes
61+
62+
* - ``--output``, ``-o``
63+
- string
64+
- .. include:: /includes/extracts/fact-basic-options-output.rst
65+
- no
66+
67+
* - ``--profile``, ``-P``
68+
- string
69+
- Name of the profile where the project ID and the |svc-api-key|\s
70+
for the project are saved. If omitted, uses the {+default-profile+}.
71+
To learn more about creating a profile, see :ref:`mcli-configure`.
72+
- no
73+
74+
* - ``--projectId``
75+
- string
76+
- Unique identifier of the project that contains the cluster.
77+
If omitted, uses the project ID in the profile or :ref:`environment
78+
variable <mcli-env-var>`.
79+
- no
80+
81+
.. _mcli-atlas-backup-snapshots-describe-output:
82+
83+
Output
84+
------
85+
86+
If the command is successful, it returns the following information:
87+
88+
.. list-table::
89+
:header-rows: 1
90+
:widths: 30 70
91+
92+
* - Field
93+
- Description
94+
95+
* - ``ID``
96+
- Unique identifier of the snapshot.
97+
98+
* - ``SNAPSHOT-TYPE``
99+
- Type of snapshot. Valid values include:
100+
101+
- ``scheduled``
102+
- ``onDemand``
103+
104+
* - ``TYPE``
105+
- Type of MongoDB cluster. Valid values include:
106+
107+
- ``replicaSet``
108+
- ``shardedCluster``
109+
110+
* - ``DESCRIPTION``
111+
- Description associated with this snapshot.
112+
113+
* - ``EXPIRES AT``
114+
- Expiration date for this snapshot.
115+
116+
.. _mcli-atlas-backup-snapshots-describe-examples:
117+
118+
Example
119+
-------
120+
121+
The following example uses the ``mongocli atlas backup snapshots describe``
122+
command to retrieve information about a backup snapshot for the cluster
123+
named ``myDemo``. The command uses the {+default-profile+}, where the project
124+
ID and the |svc-api-key|\s are stored.
125+
126+
.. code-block:: json
127+
128+
mongocli atlas backups snapshots describe 5f4007f327a3bd7b6f4103c5 --clusterName myDemo
129+
130+
The command prints the following output to the terminal.
131+
132+
.. code-block:: none
133+
:copyable: false
134+
135+
ID SNAPSHOT TYPE TYPE DESCRIPTION EXPIRES AT
136+
5f4007f327a3bd7b6f4103c5 onDemand replicaSet "daily snap" 2020-08-24T17:53:03Z

0 commit comments

Comments
 (0)