mongocli cloud-manager cluster apply
The cluster apply
command creates the cluster in the
specified MongoDB Cloud Manager project if the cluster does not already exist or
updates the cluster in the specified MongoDB Cloud Manager project if
the cluster already exists. You can also:
Create a cluster through the Cloud Manager UI, CLI, and Automation Configuration API.
Update a cluster through the the Cloud Manager UI, CLI, and Automation Configuration API,
Syntax
mongocli cloud-manager|cm cluster apply --file|-f <cm-settings-file> [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
--file , -f | string | Path to the file that contains the settings for
creating the cluster. To learn more about the
configuration properties to specify in the file, see
Cluster Configuration File. | yes |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile where the public and private
keys for the project are saved. If omitted, uses the
default profile. To learn more about creating a
profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
Output
The command prints output similar to the following to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.
Changes are being applied, please check http://cloud.mongodb.com/v2/<projectId>#deployment/topology for status
where projectId
is the unique identifier of the project.
Examples
The following examples show two ways to run the command.
Example 1
The following mongocli cm cluster apply
command deploys the settings
in the file named cm-cluster.yaml
to the specified project. The
command uses the default profile for the API access keys and project
ID.
mongocli cm cluster apply --file cm-cluster.yaml
Example 2
The following mongocli cloud-manager cluster apply
command deploys
the settings in the file named cm-cluster.json
to the cluster named
myCluster
. It uses the profile CMprofile
for the API access
keys.
mongocli cloud-manager cluster apply --file cm-cluster.json --projectId 5e33a1e0f10fab0a7846aa1d --profile CMprofile
Output
The Example 1 and Example 2 commands print the following to the terminal:
Changes are being applied, please check https://cloud.mongodb.com/v2/5e33a1e0f10fab0a7846aa1d#deployment/topology for status