|
| 1 | +.. _mcli-atlas-dbuser-describe-command: |
| 2 | + |
| 3 | +============================== |
| 4 | +mongocli atlas dbuser 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 ``dbuser describe`` command retrieves one MongoDB database user |
| 16 | +on the specified |service| cluster. You can also retrieve a MongoDB |
| 17 | +database user through the |service| :atlas:`API |
| 18 | +</reference/api/database-users-get-single-user/>`. |
| 19 | + |
| 20 | +Syntax |
| 21 | +------ |
| 22 | + |
| 23 | +.. code-block:: text |
| 24 | + |
| 25 | + mongocli atlas dbuser describe <username> |
| 26 | + [ --authDB <auth-db> ] |
| 27 | + [ --profile|-P <profile-name> ] |
| 28 | + [ --projectId <project-ID> ] |
| 29 | + |
| 30 | +.. include:: /includes/fact-command-line-help.rst |
| 31 | + |
| 32 | +.. _dbuser-atlas-describe-options: |
| 33 | + |
| 34 | +Options |
| 35 | +------- |
| 36 | + |
| 37 | +.. list-table:: |
| 38 | + :header-rows: 1 |
| 39 | + :widths: 25 10 45 20 |
| 40 | + |
| 41 | + * - Option |
| 42 | + - Type |
| 43 | + - Description |
| 44 | + - Required? |
| 45 | + |
| 46 | + * - ``<username>`` |
| 47 | + - string |
| 48 | + - Username of the database user to retrieve. |
| 49 | + - yes |
| 50 | + |
| 51 | + * - ``--authDB <auth-db>`` |
| 52 | + - string |
| 53 | + - Authentication database to use. Defaults to ``admin``. |
| 54 | + |
| 55 | + Acceptable values are: |
| 56 | + |
| 57 | + - ``admin`` for users who use :atlas:`password authentication |
| 58 | + </security-add-mongodb-users/#database-user-authentication>`. |
| 59 | + - ``$external`` for users who authenticate with :atlas:`X.509 |
| 60 | + certificates </security-add-mongodb-users/#database-user-authentication>`, |
| 61 | + :atlas:`LDAP </security-ldaps/>`, or :atlas:`AWS IAM |
| 62 | + </security-add-mongodb-users/#database-user-authentication>`. |
| 63 | + - no |
| 64 | + |
| 65 | + * - ``--profile``, ``-P`` |
| 66 | + - string |
| 67 | + - Name of the profile where the public and private |
| 68 | + keys for the project are saved. If omitted, uses the |
| 69 | + {+default-profile+}. To learn more about creating a |
| 70 | + profile, see :ref:`mcli-configure`. |
| 71 | + - no |
| 72 | + |
| 73 | + * - ``--projectId`` |
| 74 | + - string |
| 75 | + - Unique identifier of the project that contains the |
| 76 | + cluster to update. If omitted, uses the project ID in |
| 77 | + the profile or :ref:`environment variable <mcli-env-var>`. |
| 78 | + - no |
| 79 | + |
| 80 | +.. _dbuser-atlas-describe-command-output: |
| 81 | + |
| 82 | +Output |
| 83 | +------ |
| 84 | + |
| 85 | +.. include:: /includes/command-output-intro.rst |
| 86 | + |
| 87 | +.. include:: /includes/atlas-dbuser-output-fields.rst |
| 88 | + |
| 89 | +Examples |
| 90 | +-------- |
| 91 | + |
| 92 | +.. tabs:: |
| 93 | + |
| 94 | + tabs: |
| 95 | + - id: scram |
| 96 | + name: Password Authentication |
| 97 | + content: | |
| 98 | + The following example uses the ``mongocli atlas dbuser describe`` command to |
| 99 | + retrieve a MongoDB database user named ``myDbUser`` on an |service| cluster. |
| 100 | + The command uses the {+default-profile+}, which contains the |svc-api-key|\s |
| 101 | + and the project ID. |
| 102 | + |
| 103 | + .. code-block:: sh |
| 104 | + :copyable: false |
| 105 | + |
| 106 | + mongocli atlas dbuser describe myDbUser --authDB admin |
| 107 | + |
| 108 | + The previous command prints the following fields to the terminal. To |
| 109 | + learn more about these fields, see :ref:`Output |
| 110 | + <dbuser-atlas-describe-command-output>`. |
| 111 | + |
| 112 | + .. code-block:: json |
| 113 | + :copyable: false |
| 114 | + |
| 115 | + { |
| 116 | + "databaseName": "admin", |
| 117 | + "ldapAuthType": "NONE", |
| 118 | + "x509Type": "NONE", |
| 119 | + "awsIAMType": "NONE", |
| 120 | + "groupId": "5dd5a6b6f10fab1d71a58495", |
| 121 | + "roles": [ |
| 122 | + { |
| 123 | + "roleName": "atlasAdmin", |
| 124 | + "databaseName": "admin" |
| 125 | + } |
| 126 | + ], |
| 127 | + "username": "myDbUser" |
| 128 | + } |
| 129 | + |
| 130 | + - id: x509 |
| 131 | + name: X.509 Certificates |
| 132 | + content: | |
| 133 | + The following example uses the ``mongocli atlas dbuser describe`` command to |
| 134 | + retrieve a MongoDB database user with ``X.509`` authentication on an |service| |
| 135 | + cluster. The command uses the {+default-profile+}, which contains the |
| 136 | + |svc-api-key|\s and the project ID. |
| 137 | + |
| 138 | + .. note:: |
| 139 | + |
| 140 | + When passing ``$external`` as a command line option, prepend it with |
| 141 | + a ``\`` character to escape the special-use ``$`` character. |
| 142 | + |
| 143 | + .. code-block:: sh |
| 144 | + :copyable: false |
| 145 | + |
| 146 | + mongocli atlas dbuser describe [email protected],OU=users,DC=example,DC=com --authDB \$external |
| 147 | + |
| 148 | + The previous command prints the following fields to the terminal. To |
| 149 | + learn more about these fields, see :ref:`Output |
| 150 | + <dbuser-atlas-describe-command-output>`. |
| 151 | + |
| 152 | + .. code-block:: json |
| 153 | + :copyable: false |
| 154 | + |
| 155 | + { |
| 156 | + "databaseName": "admin", |
| 157 | + "ldapAuthType": "NONE", |
| 158 | + "x509Type": "USER", |
| 159 | + "awsIAMType": "NONE", |
| 160 | + "groupId": "5dd5a6b6f10fab1d71a58495", |
| 161 | + "roles": [ |
| 162 | + { |
| 163 | + "roleName": "atlasAdmin", |
| 164 | + "databaseName": "admin" |
| 165 | + } |
| 166 | + ], |
| 167 | + "username": " [email protected],OU=users,DC=example,DC=com" |
| 168 | + } |
| 169 | + |
| 170 | + - id: aws-iam |
| 171 | + name: AWS IAM Authentication |
| 172 | + content: | |
| 173 | + |
| 174 | + The following example uses the ``mongocli atlas dbuser describe`` command to |
| 175 | + retrieve a MongoDB database user with ``AWS IAM`` authentication on an |service| |
| 176 | + cluster. The command uses the {+default-profile+}, which contains the |
| 177 | + |svc-api-key|\s and the project ID. |
| 178 | + |
| 179 | + .. note:: |
| 180 | + |
| 181 | + When passing ``$external`` as a command line option, prepend it with |
| 182 | + a ``\`` character to escape the special-use ``$`` character. |
| 183 | + |
| 184 | + .. code-block:: sh |
| 185 | + :copyable: false |
| 186 | + |
| 187 | + mongocli atlas dbuser describe arn:aws:iam::772401394250:user/my-test-user --authDB \$external |
| 188 | + |
| 189 | + The previous command prints the following fields to the terminal. To |
| 190 | + learn more about these fields, see :ref:`Output |
| 191 | + <dbuser-atlas-describe-command-output>`. |
| 192 | + |
| 193 | + .. code-block:: json |
| 194 | + :copyable: false |
| 195 | + |
| 196 | + { |
| 197 | + "databaseName": "admin", |
| 198 | + "ldapAuthType": "NONE", |
| 199 | + "x509Type": "NONE", |
| 200 | + "awsIAMType": "USER", |
| 201 | + "groupId": "5dd5a6b6f10fab1d71a58495", |
| 202 | + "roles": [ |
| 203 | + { |
| 204 | + "roleName": "atlasAdmin", |
| 205 | + "databaseName": "admin" |
| 206 | + } |
| 207 | + ], |
| 208 | + "username": "arn:aws:iam::772401394250:user/my-test-user" |
| 209 | + } |
0 commit comments