|
| 1 | +.. _json-cluster-config: |
1 | 2 |
|
2 | 3 | ======
|
3 | 4 | |json|
|
4 | 5 | ======
|
5 | 6 |
|
| 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 | + |
6 | 105 | .. toctree::
|
7 | 106 | :titlesonly:
|
8 | 107 |
|
|
0 commit comments