Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas alerts settings fields type

On this page

  • Syntax
  • Options
  • Output
  • Example

The alerts settings fields type command retrieves all field names that the matchers.fieldName option accepts when you create or update an alert configuration.

mongocli atlas alert|alerts settings|config fields type|types
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

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

The command prints the following array to the terminal if the command succeeds. If the command returns an error, see Troubleshooting for recommended solutions.

[
"TYPE_NAME",
"HOSTNAME",
"PORT",
"HOSTNAME_AND_PORT",
"REPLICA_SET_NAME",
"SHARD_NAME",
"CLUSTER_NAME"
]

When you create or update an alert configuration:

  • Host alerts support these fields:

    • TYPE_NAME

    • HOSTNAME

    • PORT

    • HOSTNAME_AND_PORT

    • REPLICA_SET_NAME

  • Replica set alerts support these fields:

    • REPLICA_SET_NAME

    • SHARD_NAME

    • CLUSTER_NAME

  • Sharded cluster alerts support these fields:

    • CLUSTER_NAME

    • SHARD_NAME

The following example uses the mongocli atlas alerts settings fields type command to retrieve all field names that the matchers.fieldName option accepts when you create or update an alert configuration. It uses the profile named myprofile for accessing Atlas.

mongocli atlas alerts settings fields type --profile myprofile -o json

The previous command prints the following fields in the specified format to the terminal. To learn more about these fields, see Output.

[
"TYPE_NAME",
"HOSTNAME",
"PORT",
"HOSTNAME_AND_PORT",
"REPLICA_SET_NAME",
"SHARD_NAME",
"CLUSTER_NAME"
]

Back

Delete One Alert Configuration