3737.. code-block:: text
3838
3939 mongocli iam organization|organizations|org|orgs list|ls
40+ [ --limit <number-of-orgs> ]
41+ [ --page <number-of-pages> ]
4042 [ --profile|-P <profile-name> ]
4143
4244.. include:: /includes/fact-command-line-help.rst
@@ -55,6 +57,30 @@ Options
5557 - Description
5658 - Required?
5759
60+ * - ``--limit``
61+ - integer
62+ - Number of organizations to return per page.
63+
64+ - If this value exceeds the number of organizations,
65+ ``mongocli`` returns all organizations. Maximum value is
66+ ``500``.
67+ - If omitted, defaults to ``100``.
68+
69+ For example usage, see :ref:`mcli-organization-list-examples-pagination`.
70+ - no
71+
72+ * - ``--page``
73+ - integer
74+ - Page number (1-based) to return from the
75+ result set.
76+
77+ - The ``--limit`` flag sets the number of
78+ organizations per page.
79+ - If omitted, returns the first page.
80+
81+ For example usage, see :ref:`mcli-organization-list-examples-pagination`.
82+ - no
83+
5884 * - ``--profile``, ``-P``
5985 - string
6086 - Name of the profile where your credentials are saved.
@@ -215,3 +241,86 @@ The command returns the following |json| document:
215241 "totalCount": 2
216242 }
217243
244+ .. _mcli-organization-list-examples-pagination:
245+
246+ List the Sixth through Tenth Organizations
247+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248+
249+ The following ``mongocli iam org list`` command lists the sixth through
250+ tenth organizations in an |onprem| deployment that has 20 organizations.
251+ The command uses the ``om-personalkey`` profile, which contains a
252+ :opsmgr:`Personal API Key
253+ </tutorial/configure-public-api-access/#personal-api-keys-deprecated>`.
254+
255+ .. code-block:: sh
256+
257+ mongocli iam org list -P om-personalkey --limit 5 --page 2
258+
259+ This command returns the following list in |json| format to
260+ the terminal. To learn more about these fields, see
261+ :ref:`Output <mcli-iam-organization-list-output>`.
262+
263+ .. code-block:: json
264+ :copyable: false
265+
266+ {
267+ "links": [
268+ {
269+ "rel": "self",
270+ "href": "http://www.example.com:8080/api/public/v1.0/orgs?pageNum=1\u0026itemsPerPage=5"
271+ }
272+ ],
273+ "results": [
274+ {
275+ "id": "5e332f3e1234de007b387a9f",
276+ "links": [
277+ {
278+ "rel": "self",
279+ "href": "http://www.example.com:8080/api/public/v1.0/orgs/5e332f3e1234de007b387a9f"
280+ }
281+ ],
282+ "name": "Org6"
283+ },
284+ {
285+ "id": "5e38efd83b60f567896baf4d",
286+ "links": [
287+ {
288+ "rel": "self",
289+ "href": "http://www.example.com:8080/api/public/v1.0/orgs/5e38efd83b60f567896baf4d"
290+ }
291+ ],
292+ "name": "Org7"
293+ },
294+ {
295+ "id": "27a91237ba9cb28a15ed3f51",
296+ "links": [
297+ {
298+ "rel": "self",
299+ "href": "http://www.example.com:8080/api/public/v1.0/orgs/27a91237ba9cb28a15ed3f51"
300+ }
301+ ],
302+ "name": "Org8"
303+ },
304+ {
305+ "id": "959bd41f6c65d5a31077f78a",
306+ "links": [
307+ {
308+ "rel": "self",
309+ "href": "http://www.example.com:8080/api/public/v1.0/orgs/959bd41f6c65d5a31077f78a"
310+ }
311+ ],
312+ "name": "Org9"
313+ },
314+ {
315+ "id": "f459b51a9a6e4eba907b47ad",
316+ "links": [
317+ {
318+ "rel": "self",
319+ "href": "http://www.example.com:8080/api/public/v1.0/orgs/f459b51a9a6e4eba907b47ad"
320+ }
321+ ],
322+ "name": "Org10"
323+ }
324+ ],
325+ "totalCount": 20
326+ }
0 commit comments