|
| 1 | +.. _iam-user-describe: |
| 2 | + |
| 3 | +========================== |
| 4 | +mongocli iam user describe |
| 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 user describe`` command retrieves information about a |
| 16 | +user specified by username or ID. You can also retrieve details about a |
| 17 | +user using the |api| for your MongoDB service: |
| 18 | + |
| 19 | +- |service| :atlas:`Get a User by ID API </reference/api/user-get-by-id/>` and |
| 20 | + :atlas:`Get a User by Name API </reference/api/user-get-one-by-name/>` |
| 21 | +- |cloud-short| :cloudmgr:`Get a User by ID API |
| 22 | + </reference/api/user-get-by-id/>` and :cloudmgr:`Get a User by Name API |
| 23 | + </reference/api/user-get-by-name/>` |
| 24 | +- |onprem| :opsmgr:`Get a User by ID API </reference/api/user-get-by-id/>` and |
| 25 | + :opsmgr:`Get a User by Name API </reference/api/user-get-by-name/>` |
| 26 | + |
| 27 | +.. _mcli-iam-user-describe-syntax: |
| 28 | + |
| 29 | +Syntax |
| 30 | +------ |
| 31 | + |
| 32 | +.. code-block:: text |
| 33 | + |
| 34 | + mongocli iam user describe |
| 35 | + --id <user-id> |
| 36 | + [ --output|-o <output-format> ] |
| 37 | + [ --profile|-P <profile-name> ] |
| 38 | + --username <username-of-user> |
| 39 | + |
| 40 | +.. include:: /includes/fact-command-line-help.rst |
| 41 | + |
| 42 | +.. _mcli-iam-user-describe-options: |
| 43 | + |
| 44 | +Options |
| 45 | +------- |
| 46 | + |
| 47 | +.. list-table:: |
| 48 | + :header-rows: 1 |
| 49 | + :widths: 20 10 60 10 |
| 50 | + |
| 51 | + * - Option |
| 52 | + - Type |
| 53 | + - Description |
| 54 | + - Required? |
| 55 | + |
| 56 | + * - ``--id`` |
| 57 | + - string |
| 58 | + - Unique identifier of the user. Either ``id`` or ``username`` |
| 59 | + is required. |
| 60 | + - conditional |
| 61 | + |
| 62 | + * - ``--output``, ``-o`` |
| 63 | + - string |
| 64 | + - .. include:: /includes/extracts/fact-basic-options-output.rst |
| 65 | + - no |
| 66 | + |
| 67 | + * - ``--profile``, ``-P`` |
| 68 | + - string |
| 69 | + - Name of the profile that contains the access information. If |
| 70 | + omitted, uses the {+default-profile+}. |
| 71 | + - no |
| 72 | + |
| 73 | + * - ``--username`` |
| 74 | + - string |
| 75 | + - Username of the user. Either ``username`` or ``id`` is |
| 76 | + required. |
| 77 | + - conditional |
| 78 | + |
| 79 | +.. _mcli-iam-user-describe-output: |
| 80 | + |
| 81 | +Output |
| 82 | +------ |
| 83 | + |
| 84 | +The command prints the following output to the terminal if the command |
| 85 | +succeeds. If the command returns errors, see :ref:`Troubleshooting |
| 86 | +<troubleshooting>` for recommended solutions. |
| 87 | + |
| 88 | +.. code-block:: none |
| 89 | + |
| 90 | + ID FIRST NAME LAST NAME USERNAME EMAIL |
| 91 | + <user-email> <first-name> <last-name> <username> <email-address> |
| 92 | + |
| 93 | +The above default output is a subset of the fields returned by this command. |
| 94 | +For the complete list of |json| fields returned by the command, see the API |
| 95 | +reference for your MongoDB service: |
| 96 | + |
| 97 | +- |service| :atlas:`Get a User by ID API Response |
| 98 | + </reference/api/user-get-by-id/#response>` and :atlas:`Get a User by Name |
| 99 | + API Response </reference/api/user-get-one-by-name/#response>` |
| 100 | +- |cloud-short| :cloudmgr:`Get a User by ID API Response |
| 101 | + </reference/api/user-get-by-id/#response>` and :cloudmgr:`Get a User by Name |
| 102 | + API Response </reference/api/user-get-by-name/#response>` |
| 103 | +- |onprem| :opsmgr:`Get a User by ID API Response |
| 104 | + </reference/api/user-get-by-id/#response>` and :opsmgr:`Get a User by Name |
| 105 | + API Response </reference/api/user-get-by-name/#response>` |
| 106 | + |
| 107 | +.. _mcli-iam-user-describe-examples: |
| 108 | + |
| 109 | +Example |
| 110 | +------- |
| 111 | + |
| 112 | +.. tabs:: |
| 113 | + |
| 114 | + .. tab:: Default Output |
| 115 | + :tabid: default |
| 116 | + |
| 117 | + The following command returns information in the default format about a |
| 118 | + user whose ID is ``5dd56c847a3e5a1f363d424d`` in a |cloud-short| |
| 119 | + organization. It uses the {+default-profile+} for accessing |
| 120 | + |cloud-short|. |
| 121 | + |
| 122 | + .. code-block:: text |
| 123 | + |
| 124 | + mongocli iam user describe --id 5dd56c847a3e5a1f363d424d |
| 125 | + |
| 126 | + The previous command prints the following to the terminal: |
| 127 | + |
| 128 | + .. code-block:: text |
| 129 | + :copyable: false |
| 130 | + |
| 131 | + ID FIRST NAME LAST NAME USERNAME EMAIL |
| 132 | + 5dd56c847a3e5a1f363d424d John Doe [email protected] [email protected] |
| 133 | + |
| 134 | + .. tab:: JSON Output |
| 135 | + :tabid: json |
| 136 | + |
| 137 | + The following command returns information in |json| format about a |
| 138 | + user whose username is `` [email protected]`` in an |service| |
| 139 | + organization. It uses the {+default-profile+} for accessing |service|. |
| 140 | + |
| 141 | + .. code-block:: text |
| 142 | + |
| 143 | + mongocli iam user describe --username " [email protected]" -o json |
| 144 | + |
| 145 | + The previous command prints the following in the specified format to |
| 146 | + the terminal. For more information on these fields, see |
| 147 | + :ref:`Output <mcli-iam-user-describe-output>`. |
| 148 | + |
| 149 | + .. code-block:: json |
| 150 | + :copyable: false |
| 151 | + |
| 152 | + { |
| 153 | + "emailAddress": " [email protected]", |
| 154 | + "firstName": "John", |
| 155 | + "id": "5dd56c847a3e5a1f363d424d", |
| 156 | + "lastName": "Doe", |
| 157 | + "roles": [ |
| 158 | + { |
| 159 | + "groupId": "5f455b39749bea5fb575dccc", |
| 160 | + "roleName": "GROUP_OWNER" |
| 161 | + }, |
| 162 | + { |
| 163 | + "orgId": "5e2f05fef10fab66c7d408b3", |
| 164 | + "roleName": "ORG_OWNER" |
| 165 | + } |
| 166 | + ], |
| 167 | + |
| 168 | + "mobileNumber": "", |
| 169 | + "password": "", |
| 170 | + "country": "US" |
| 171 | + } |
0 commit comments