Skip to content

Commit f4c3f40

Browse files
authored
Merge pull request #134 from davidhou17/DOCSP-29111
(DOCSP-29111): Add info on how to use the Open API spec to create JSON config files
2 parents a96a0d1 + da7ad8c commit f4c3f40

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed

snooty.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ toc_landing_pages = [
1818
"/connect-atlas-cli",
1919
"/install-atlas-cli",
2020
"/migrate-to-atlas-cli",
21+
"/reference/json",
2122
"/telemetry"
2223
]
2324

source/reference/json.txt

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,107 @@
1+
.. _json-cluster-config:
12

23
======
34
|json|
45
======
56

7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
If an {+atlas-cli+} command accepts the ``--file`` option, you can pass
14+
a ``.json`` configuration file to define specific settings. For example,
15+
you can pass a configuration file when using the {+atlas-cli+} to:
16+
17+
- :ref:`Create <atlas-clusters-create>`, :ref:`update <atlas-clusters-update>`,
18+
or :ref:`upgrade a cluster <atlas-clusters-upgrade>`.
19+
- :ref:`Update a cloud backup schedule <atlas-backups-schedule-update>`.
20+
- :ref:`Create <atlas-clusters-search-indexes-create>` or
21+
:ref:`update an Atlas Search Index <atlas-clusters-search-indexes-update>`.
22+
23+
Usage
24+
-----
25+
26+
To learn which settings are accepted by the {+atlas-cli+}, view the request
27+
body schema and copy the request samples in the :ref:`Atlas Admin API Specification
28+
<api-resources-spec>` for the endpoint that corresponds to the {+atlas-cli+}
29+
command. The commands you can use include but are not limited to:
30+
31+
.. list-table::
32+
:header-rows: 1
33+
:widths: 50 50
34+
35+
* - {+atlas-cli+} Command
36+
- API Endpoint
37+
38+
* - :ref:`atlas-clusters-create`
39+
- :oas-atlas-op:`Create One Cluster </createLegacyCluster>`
40+
41+
* - :ref:`atlas-clusters-update`
42+
- :oas-atlas-op:`Update Configuration of One Cluster </updateClusterConfiguration>`
43+
44+
* - :ref:`atlas-clusters-upgrade`
45+
- :oas-atlas-op:`Upgrade One Shared-tier Cluster </upgradeSharedCluster>`
46+
47+
* - :ref:`atlas-backups-schedule-update`
48+
- :oas-atlas-op:`Update Cloud Backup Schedule for One Cluster </updateBackupSchedule>`
49+
50+
* - :ref:`atlas-clusters-search-indexes-create`
51+
- :oas-atlas-op:`Create One Atlas Search Index </createAtlasSearchIndex>`
52+
53+
* - :ref:`atlas-clusters-search-indexes-update`
54+
- :oas-atlas-op:`Update One Atlas Search Index </updateAtlasSearchIndex>`
55+
56+
When you run the command in your terminal, specify the ``--file`` option
57+
and provide the path to the |json| configuration file that defines your
58+
desired settings.
59+
60+
Example
61+
~~~~~~~
62+
63+
For example, consider the following configuration file
64+
to enable backups and add a label:
65+
66+
.. code-block:: sh
67+
:caption: /example.json
68+
69+
{
70+
"backupEnabled" : true,
71+
"labels": [
72+
{
73+
"key": "<myKey>",
74+
"value": "<myValue>"
75+
}
76+
]
77+
}
78+
79+
The following command updates the ``myCluster`` deployment
80+
based on the settings specified in the configuration file:
81+
82+
.. code-block:: sh
83+
84+
atlas clusters update myCluster --file /example.json
85+
86+
{+Cluster+} Configuration File
87+
------------------------------
88+
89+
To learn more about {+cluster+} configuration files, see
90+
:ref:`atlas-cli-cluster-config-file`. For sample files,
91+
see:
92+
93+
- :ref:`example-cluster-config-file`
94+
- :ref:`multi-cloud-example-cluster-config-file`
95+
- :ref:`geosharded-example-cluster-config-file`
96+
97+
98+
Cloud Backup Schedule Configuration File
99+
----------------------------------------
100+
101+
To learn more about cloud backup schedule configuration files, see
102+
:ref:`atlas-cli-cloud-backup-schedule-config-file`. For a sample file,
103+
see :ref:`example-cloud-backup-schedule-config-file`.
104+
6105
.. toctree::
7106
:titlesonly:
8107

source/reference/json/cluster-config-file.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ following example file:
210210

211211
.. literalinclude:: /includes/json-cluster-config-file-multi.json
212212

213+
.. _geosharded-example-cluster-config-file:
214+
213215
Example Geosharded Cluster Configuration File
214216
---------------------------------------------
215217

0 commit comments

Comments
 (0)