Navigation

mongocli ops-manager serverUsage project hosts list

The serverUsage projects hosts list command retrieves all host assignments for one project. You can also retrieve this information using the Ops Manager UI or API.

mongocli ops-manager|om serverUsage project|s host|s list|ls
[--projectId <project-ID>]
[--startDate <start-date>]
[--endDate <end-date>]
Note

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

Option
Type
Description
Required?
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no
--startDate
string
ISO 8601 formatted date when the list of host assignments starts.
yes
--endDate
string
ISO 8601 formatted date when the list of host assignments ends.
yes

If the command succeeds, it returns the following output in the default format. If the command returns errors, see Troubleshooting for recommended solutions.

HOSTNAME SERVER TYPE MEM SIZE MB CHARGEABLE
<domain-name> <host-server-type> <memory-size> <true-or-false>

The default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the Public API reference for your MongoDB service:

The following command retrieves the retrieves all host assignments for one project using the default profile, which contains credentials to access the project and the project ID. The output is returned in the default format.

mongocli om serverUsage projects hosts list --startDate 2020-01-01 --endDate 2021-01-01

The previous command prints the following to the terminal.

HOSTNAME SERVER TYPE MEM SIZE MB CHARGEABLE
repl-0.example.com PRODUCTION_SERVER 178 true
repl-1.example.com PRODUCTION_SERVER 178 true
repl-2.example.com RAM_POOL 178 true
Give Feedback