|
| 1 | +.. _mcli-om-server-usage-list-org-hosts-command: |
| 2 | + |
| 3 | +======================================================== |
| 4 | +mongocli ops-manager serverUsage organization hosts list |
| 5 | +======================================================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +The ``serverUsage organizations hosts list`` command retrieves all host |
| 16 | +assignments for one organization. You can also retrieve this |
| 17 | +information using the |mms| :opsmgr:`UI |
| 18 | +</admin/general/mongodb-usage-page/>` or :opsmgr:`API |
| 19 | +</reference/api/usage/list-all-host-assignments-in-one-organization/>`. |
| 20 | + |
| 21 | +.. _om-server-usage-list-all-org-hosts-syntax: |
| 22 | + |
| 23 | +Syntax |
| 24 | +------ |
| 25 | + |
| 26 | +.. code-block:: text |
| 27 | + |
| 28 | + mongocli ops-manager|om serverUsage organization|s host|s list|ls |
| 29 | + [--orgId <organization-ID>] |
| 30 | + [--startDate <start-date>] |
| 31 | + [--endDate <end-date>] |
| 32 | + |
| 33 | +.. include:: /includes/fact-command-line-help.rst |
| 34 | + |
| 35 | +.. _om-server-usage-list-all-org-hosts-options: |
| 36 | + |
| 37 | +Options |
| 38 | +------- |
| 39 | + |
| 40 | +.. list-table:: |
| 41 | + :header-rows: 1 |
| 42 | + :widths: 20 10 60 10 |
| 43 | + |
| 44 | + * - Option |
| 45 | + - Type |
| 46 | + - Description |
| 47 | + - Required? |
| 48 | + |
| 49 | + * - ``--orgId`` |
| 50 | + - string |
| 51 | + - Unique identifier of the organization associated with the |
| 52 | + desired hosts. If omitted, uses the organization ID in |
| 53 | + the profile or :ref:`environment variable <mcli-env-var>`. |
| 54 | + - no |
| 55 | + |
| 56 | + * - ``--startDate`` |
| 57 | + - string |
| 58 | + - |iso8601| formatted date when the list of host assignments |
| 59 | + starts. |
| 60 | + - yes |
| 61 | + |
| 62 | + * - ``--endDate`` |
| 63 | + - string |
| 64 | + - |iso8601| formatted date when the list of host assignments ends. |
| 65 | + - yes |
| 66 | + |
| 67 | +.. _om-server-usage-list-all-org-hosts-output: |
| 68 | + |
| 69 | +Output |
| 70 | +------ |
| 71 | + |
| 72 | +If the command succeeds, it returns the following output in the default |
| 73 | +format. If the command returns errors, see |
| 74 | +:ref:`Troubleshooting <troubleshooting>` for recommended solutions. |
| 75 | + |
| 76 | +.. code-block:: sh |
| 77 | + :copyable: false |
| 78 | + |
| 79 | + HOSTNAME SERVER TYPE MEM SIZE MB CHARGEABLE |
| 80 | + <domain-name> <host-server-type> <memory-size> <true-or-false> |
| 81 | + |
| 82 | +.. include:: /includes/fact-default-output.rst |
| 83 | + |
| 84 | +- :opsmgr:`Ops Manager API </reference/api/usage/list-all-host-assignments-in-one-organization/>` |
| 85 | + |
| 86 | +Example |
| 87 | +------- |
| 88 | + |
| 89 | +.. tabs:: |
| 90 | + |
| 91 | + .. tab:: Default Output |
| 92 | + :tabid: default-output |
| 93 | + |
| 94 | + The following command retrieves the retrieves all host |
| 95 | + assignments for one organization using the {+default-profile+}, |
| 96 | + which contains credentials to access the organization and the organization ID. The output is returned in the default format. |
| 97 | + |
| 98 | + .. code-block:: sh |
| 99 | + |
| 100 | + mongocli om serverUsage organizations hosts list --startDate 2021-01-01 --endDate 2020-01-01 |
| 101 | + |
| 102 | + The previous command prints the following to the terminal. |
| 103 | + |
| 104 | + .. code-block:: sh |
| 105 | + :copyable: false |
| 106 | + |
| 107 | + HOSTNAME SERVER TYPE MEM SIZE MB CHARGEABLE |
| 108 | + repl-0.example.com PRODUCTION_SERVER 178 true |
| 109 | + repl-1.example.com PRODUCTION_SERVER 178 true |
| 110 | + repl-2.example.com RAM_POOL 178 true |
| 111 | + |
| 112 | + .. tab:: JSON Output |
| 113 | + :tabid: json-output |
| 114 | + |
| 115 | + The following command retrieves the retrieves all host |
| 116 | + assignments for one organization using the {+default-profile+}, |
| 117 | + which contains credentials to access the organization and the |
| 118 | + organization ID. The output is returned in |json| format. |
| 119 | + |
| 120 | + .. code-block:: sh |
| 121 | + |
| 122 | + mongocli om serverUsage organizations hosts list --startDate 2021-01-01 --endDate 2020-01-01 --output json |
| 123 | + |
| 124 | + The previous command prints the following to the terminal in |
| 125 | + |json| format. |
| 126 | + |
| 127 | + .. code-block:: json |
| 128 | + :copyable: false |
| 129 | + |
| 130 | + { |
| 131 | + "links": [ |
| 132 | + { |
| 133 | + "rel": "self", |
| 134 | + "href": "http://om.example.com/api/public/v1.0/usage/groups/5f1f39ffc902201990f53874/hosts?endDate=2020-01-01\u0026startDate=2021-01-01\u0026pageNum=1\u0026itemsPerPage=100" |
| 135 | + }, |
| 136 | + ], |
| 137 | + "results":[{ |
| 138 | + "hostname":"repl-0.example.com", |
| 139 | + }, |
| 140 | + "serverType": { |
| 141 | + "name": "PRODUCTION_SERVER", |
| 142 | + "label": "Production Server" |
| 143 | + }, |
| 144 | + "isChargeable": true, |
| 145 | + "memSizeMB": 178 |
| 146 | + }, |
| 147 | + { |
| 148 | + "hostname":"repl-2.example.com", |
| 149 | + }, |
| 150 | + "serverType": { |
| 151 | + "name": "PRODUCTION_SERVER", |
| 152 | + "label": "Production Server" |
| 153 | + }, |
| 154 | + "isChargeable": true, |
| 155 | + "memSizeMB": 178 |
| 156 | + }, |
| 157 | + "hostname":"repl-3.example.com", |
| 158 | + }, |
| 159 | + "serverType": { |
| 160 | + "name": "RAM_POOL", |
| 161 | + "label": "RAM Pool" |
| 162 | + }, |
| 163 | + "isChargeable": true, |
| 164 | + "memSizeMB": 178 |
| 165 | + }, |
| 166 | + ] |
| 167 | + "totalCount": 3, |
| 168 | + } |
0 commit comments