JSON
On this page
If an Atlas CLI command accepts the --file
option, you can pass
a .json
configuration file to define specific settings. For example,
you can pass a configuration file when using the Atlas CLI to:
Usage
To learn which settings are accepted by the Atlas CLI, view the request body schema and copy the request samples in the Atlas Admin API Specification for the endpoint that corresponds to the Atlas CLI command. The commands you can use include but are not limited to:
Atlas CLI Command | API Endpoint |
---|---|
When you run the command in your terminal, specify the --file
option
and provide the path to the JSON configuration file that defines your
desired settings.
Example
For example, consider the following configuration file to enable backups and add a label:
{ "backupEnabled" : true, "labels": [ { "key": "<myKey>", "value": "<myValue>" } ] }
The following command updates the myCluster
deployment
based on the settings specified in the configuration file:
atlas clusters update myCluster --file example.json
Cluster Configuration File
To learn more about cluster configuration files, see Cluster Configuration File. For sample files, see:
Cloud Backup Schedule Configuration File
To learn more about cloud backup schedule configuration files, see Cloud Backup Schedule Configuration File. For a sample file, see Create a Configuration File.
Atlas Search Index Configuration File
To learn more about Atlas Search index configuration files, see Atlas Search Index Configuration File. For a sample file, see Example Atlas Search Index Configuration File.
Search Nodes Configuration File
To learn more about search nodes configuration files, see Search Nodes Configuration File. For a sample file, see Example Search Nodes Configuration File.
Atlas Data Federation Configuration File
To learn more about Atlas Data Federation configuration files, see Atlas Data Federation Configuration File. For a sample file, see Example Atlas Data Federation Configuration File.
Alert Configuration File
To learn more about alert configuration files, see Alert Configuration File. For a sample file, see Example Alert Configuration File.