mongocli atlas cluster watch
The cluster watch
command monitors a running cluster in
the specified project until it becomes available, at which time it
displays a confirmation message. You can also view the
availability of a cluster with the Atlas
UI.
Syntax
mongocli atlas cluster watch <cluster-name> [ --output|-o <output-format> ] [ --projectId <project-ID> ] [ --profile|-P <profile-name> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
<cluster-name> | string | Name of the cluster you want to watch. | 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 set. 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 cluster watch
command continuously polls a cluster until the
cluster reaches an available state. While the command is polling, it
periodically prints dots (.
) to the terminal.
When the private endpoint connection reaches an available state, or if it is already in an available state, the command prints a status message and list of hosts for that cluster.
If the command prints an error, see Troubleshooting for recommended solutions.
Example
The following mongocli atlas cluster watch
command monitors a sample
cluster named myCluster
. The command uses the default profile.
mongocli atlas cluster watch myCluster --projectId abcdefghij0fab66c7d4072e
In this example, myCluster
is instantiated just before running the
command. The command prints dots while the cluster is instantiating,
then prints a status message and list of hosts:
....................... Cluster available at: mongodb://cluster0-shard-00-00.111xx.mongodb.net:27017,cluster0-shard-00-01.111xx.mongodb.net:27017,cluster0-shard-00-02.111xx.mongodb.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-123abc-shard-0