Navigation

mongocli ops-manager serverUsage organization hosts list

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

mongocli ops-manager|om serverUsage organization|s host|s list|ls
[--orgId <organization-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?
--orgId
string
Unique identifier of the organization associated with the desired hosts. If omitted, uses the organization 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 organization using the default profile, which contains credentials to access the organization and the organization ID. The output is returned in the default format.

mongocli om serverUsage organizations hosts list --startDate 2021-01-01 --endDate 2020-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