|
| 1 | +.. _iam-project-user-list: |
| 2 | + |
| 3 | +================================ |
| 4 | +mongocli iam projects users 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 ``mongocli iam projects users list`` command lists users in the |
| 16 | +MongoDB service project. You can also retrieve the users in your |
| 17 | +projects through the: |
| 18 | + |
| 19 | +- |service| :atlas:`UI |
| 20 | + </access/manage-project-access/#view-who-can-access-a-project>` and |
| 21 | + :atlas:`API </reference/api/user-get-all/>` |
| 22 | +- |cloud-short| :cloudmgr:`UI |
| 23 | + </tutorial/manage-users/#view-who-can-access-a-project>` and :cloudmgr:`API |
| 24 | + </reference/api/groups/get-all-users-in-one-group/>` |
| 25 | +- |onprem| :opsmgr:`UI </tutorial/manage-users/#view-who-can-access-a-project>` |
| 26 | + and :opsmgr:`API </reference/api/groups/get-all-users-in-one-group/>` |
| 27 | + |
| 28 | +.. _mcli-iam-project-user-list-cmd-permissions: |
| 29 | + |
| 30 | +Permissions Required |
| 31 | +-------------------- |
| 32 | + |
| 33 | +The following table shows the role you must have in your MongoDB service to |
| 34 | +list the users in your project: |
| 35 | + |
| 36 | +.. list-table:: |
| 37 | + :header-rows: 1 |
| 38 | + :widths: 40 60 |
| 39 | + |
| 40 | + * - MongoDB Service |
| 41 | + - Role |
| 42 | + |
| 43 | + * - |service| |
| 44 | + - :atlas:`Project Owner </reference/user-roles/#Project-Owner>` |
| 45 | + |
| 46 | + * - |cloud-short| |
| 47 | + - - :cloudmgr:`Project Owner </reference/user-roles/#Project-Owner>` or, |
| 48 | + - :cloudmgr:`Project User Admin |
| 49 | + </reference/user-roles/#Project-User-Admin>` |
| 50 | + |
| 51 | + * - |onprem| |
| 52 | + - - :opsmgr:`Project Owner </reference/user-roles/#Project-Owner>` or, |
| 53 | + - :opsmgr:`Project User Admin |
| 54 | + </reference/user-roles/#Project-User-Admin>` |
| 55 | + |
| 56 | +.. _mcli-iam-project-user-list-syntax: |
| 57 | + |
| 58 | +Syntax |
| 59 | +------ |
| 60 | + |
| 61 | +.. code-block:: text |
| 62 | + |
| 63 | + mongocli iam projects users list |
| 64 | + [ --limit <integer> ] |
| 65 | + [ --output|-o <output-format> ] |
| 66 | + [ --page <integer> ] |
| 67 | + [ --profile|-P <profile-name> ] |
| 68 | + [ --projectId <project-ID> ] |
| 69 | + |
| 70 | +.. include:: /includes/fact-command-line-help.rst |
| 71 | + |
| 72 | +.. _mcli-iam-project-user-list-options: |
| 73 | + |
| 74 | +Options |
| 75 | +------- |
| 76 | + |
| 77 | +.. list-table:: |
| 78 | + :header-rows: 1 |
| 79 | + :widths: 20 10 60 10 |
| 80 | + |
| 81 | + * - Option |
| 82 | + - Type |
| 83 | + - Description |
| 84 | + - Required? |
| 85 | + |
| 86 | + * - ``--limit`` |
| 87 | + - integer |
| 88 | + - Number of projects to return from the result set. |
| 89 | + |
| 90 | + - If omitted, returns all projects. |
| 91 | + - If this value exceeds the number of projects, ``mongocli`` |
| 92 | + returns all projects. |
| 93 | + - no |
| 94 | + |
| 95 | + * - ``--output``, ``-o`` |
| 96 | + - string |
| 97 | + - .. include:: /includes/extracts/fact-basic-options-output.rst |
| 98 | + - no |
| 99 | + |
| 100 | + * - ``--page`` |
| 101 | + - integer |
| 102 | + - Starting chunk of projects to return from the result set. The |
| 103 | + ``--limit`` flag sets the number of projects per page. |
| 104 | + |
| 105 | + - If omitted, returns the first page. |
| 106 | + - If this value exceeds the number of pages, ``mongocli`` |
| 107 | + returns the last page. |
| 108 | + - no |
| 109 | + |
| 110 | + * - ``--profile``, ``-P`` |
| 111 | + - string |
| 112 | + - Name of the profile that contains the access information. If omitted, |
| 113 | + uses the {+default-profile+}. |
| 114 | + - no |
| 115 | + |
| 116 | + * - ``--projectId`` |
| 117 | + - string |
| 118 | + - Unique identifier of the project for which to retrieve the users. If |
| 119 | + omitted, uses the specified profile to access the MongoDB service |
| 120 | + project. |
| 121 | + - no |
| 122 | + |
| 123 | +.. _mcli-iam-project-user-list-output: |
| 124 | + |
| 125 | +Output |
| 126 | +------ |
| 127 | + |
| 128 | +The command prints following output to the terminal if the command |
| 129 | +succeeds. If the command returns errors, see :ref:`Troubleshooting |
| 130 | +<troubleshooting>` for recommended solutions. |
| 131 | + |
| 132 | +.. code-block:: text |
| 133 | + :copyable: false |
| 134 | + |
| 135 | + ID FIRST NAME LAST NAME USERNAME |
| 136 | + <user-ID> <first-name> <last-name> <username> |
| 137 | + |
| 138 | +The above default output is a subset of the fields returned by this command. |
| 139 | +For the complete list of |json| fields returned by the command, see the |api| |
| 140 | +reference for your MongoDB service: |
| 141 | + |
| 142 | +- :atlas:`Atlas </reference/api/user-get-all/#response>` |
| 143 | +- :cloudmgr:`Cloud Manager |
| 144 | + </reference/api/groups/get-all-users-in-one-group/#response>` |
| 145 | +- :opsmgr:`Ops Manager |
| 146 | + </reference/api/groups/get-all-users-in-one-group/#response>` |
| 147 | + |
| 148 | +.. _mcli-iam-project-user-list-examples: |
| 149 | + |
| 150 | +Example |
| 151 | +------- |
| 152 | + |
| 153 | +.. tabs:: |
| 154 | + |
| 155 | + .. tab:: Default |
| 156 | + :tabid: default |
| 157 | + |
| 158 | + The following command lists users in the specified |cloud-short| |
| 159 | + project. It uses a profile named ``cmProfile`` for accessing |
| 160 | + |cloud-short|. |
| 161 | + |
| 162 | + .. code-block:: text |
| 163 | + |
| 164 | + mongocli iam projects users list --projectId 5e84b94c003f2d6370004f4e --profile cmProfile |
| 165 | + |
| 166 | + The previous command prints the following in the default format to |
| 167 | + the terminal. For more information on these fields, see |
| 168 | + :ref:`Output <mcli-iam-project-user-list-output>`. |
| 169 | + |
| 170 | + .. code-block:: json |
| 171 | + :copyable: false |
| 172 | + |
| 173 | + ID FIRST NAME LAST NAME USERNAME |
| 174 | + 5dd559c17a3e5a1f363ba8ea John Doe [email protected] |
| 175 | + |
| 176 | + .. tab:: JSON |
| 177 | + :tabid: json |
| 178 | + |
| 179 | + The following command lists users in an |service| project. It uses the |
| 180 | + {+default-profile+} for accessing |service|. |
| 181 | + |
| 182 | + .. code-block:: text |
| 183 | + |
| 184 | + mongocli iam projects users list --output json |
| 185 | + |
| 186 | + The previous command prints the following in the default format to |
| 187 | + the terminal. For more information on these fields, see |
| 188 | + :ref:`Output <mcli-iam-project-user-list-output>`. |
| 189 | + |
| 190 | + .. code-block:: json |
| 191 | + :copyable: false |
| 192 | + |
| 193 | + [ |
| 194 | + { |
| 195 | + "id": "5f6e2c02a2dcef512bf0f169", |
| 196 | + "emailAddress": " [email protected]", |
| 197 | + "firstName": "John", |
| 198 | + "lastName": "Doe", |
| 199 | + "links": [ |
| 200 | + { |
| 201 | + "rel": "self", |
| 202 | + "href": "http://example.mongodb.com/api/atlas/v1.0/users/5f6e2c02a2dcef512bf0f169" |
| 203 | + } |
| 204 | + ], |
| 205 | + "roles": [ |
| 206 | + { |
| 207 | + "roleName": "GROUP_OWNER", |
| 208 | + "groupId": "5f6e2c04a2dcef512bf0f171" |
| 209 | + }, |
| 210 | + { |
| 211 | + "roleName": "GROUP_OWNER", |
| 212 | + "groupId": "5f6e2ebba2dcef512bf0f82d" |
| 213 | + } |
| 214 | + ], |
| 215 | + |
| 216 | + } |
| 217 | + ] |
0 commit comments