|
| 1 | +.. _mcli-iam-organization-delete: |
| 2 | + |
| 3 | +================================ |
| 4 | +mongocli iam organization delete |
| 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 organization delete`` command deletes an organization |
| 16 | +in your |onprem| instance. |
| 17 | + |
| 18 | +To run this command you must have the following permissions based on your |api| Key type: |
| 19 | + |
| 20 | +.. list-table:: |
| 21 | + :widths: 50 50 |
| 22 | + :header-rows: 1 |
| 23 | + |
| 24 | + * - API Key Type |
| 25 | + - Role |
| 26 | + |
| 27 | + * - Global API Keys |
| 28 | + - ``Global Owner`` |
| 29 | + |
| 30 | + * - Personal API Keys |
| 31 | + - ``Organization Owner`` |
| 32 | + |
| 33 | +.. _mcli-iam-organization-delete-syntax: |
| 34 | + |
| 35 | +Syntax |
| 36 | +------ |
| 37 | + |
| 38 | +.. code-block:: text |
| 39 | + |
| 40 | + mongocli iam organization|organizations|org|orgs delete|rm <organization-id> |
| 41 | + [ --force ] |
| 42 | + [ --profile|-P <profile-name> ] |
| 43 | + |
| 44 | +.. include:: /includes/fact-command-line-help.rst |
| 45 | + |
| 46 | +.. _mcli-iam-organization-delete-options: |
| 47 | + |
| 48 | +Options |
| 49 | +------- |
| 50 | + |
| 51 | +.. list-table:: |
| 52 | + :header-rows: 1 |
| 53 | + :widths: 20 10 60 10 |
| 54 | + |
| 55 | + * - Option |
| 56 | + - Type |
| 57 | + - Description |
| 58 | + - Required? |
| 59 | + |
| 60 | + * - ``--force`` |
| 61 | + - |
| 62 | + - Flag that indicates that the organization can be deleted without |
| 63 | + requiring confirmation. |
| 64 | + - no |
| 65 | + |
| 66 | + * - ``<organization-ID>`` |
| 67 | + - string |
| 68 | + - Unique identifier of the organization you want to delete. |
| 69 | + - yes |
| 70 | + |
| 71 | + * - ``--profile``, ``-P`` |
| 72 | + - string |
| 73 | + - Name of the profile where your credentials are saved. |
| 74 | + |
| 75 | + Your credentials can either be a :opsmgr:`Global API key pair |
| 76 | + </reference/api/global-api-keys/index.html#global-programmatic-api-keys>` or |
| 77 | + a :opsmgr:`Personal API key |
| 78 | + </tutorial/configure-public-api-access/#personal-api-keys-deprecated>`. |
| 79 | + |
| 80 | + If omitted, uses the {+default-profile+}. To learn more about |
| 81 | + creating a profile, see :ref:`mcli-configure`. |
| 82 | + |
| 83 | + - no |
| 84 | + |
| 85 | +.. _mcli-iam-organization-delete-output: |
| 86 | + |
| 87 | +Output |
| 88 | +------ |
| 89 | + |
| 90 | +The command prints following fields in |json| format to the |
| 91 | +terminal if the command succeeds. If the command returns errors, |
| 92 | +see :ref:`Troubleshooting <troubleshooting>` for recommended |
| 93 | +solutions. |
| 94 | + |
| 95 | +.. code-block:: text |
| 96 | + :copyable: false |
| 97 | + |
| 98 | + Organization '<organization-id>' deleted |
| 99 | + |
| 100 | +.. _mcli-iam-organization-delete-examples: |
| 101 | + |
| 102 | +Examples |
| 103 | +-------- |
| 104 | + |
| 105 | +Delete an Organization with Confirmation |
| 106 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 107 | + |
| 108 | +The following command deletes an organization with the ID |
| 109 | +``5e33545ef10fab20b49c0f3b`` in an |onprem| instance. The command |
| 110 | +uses the {+default-profile+}, which contains |api| keys that have the |
| 111 | +``Global Owner`` role. |
| 112 | + |
| 113 | +.. code-block:: text |
| 114 | + |
| 115 | + mongocli iam organization delete 5e33545ef10fab20b49c0f3b |
| 116 | + |
| 117 | +The previous command prints the following to |
| 118 | +the terminal. For more information on these fields, see |
| 119 | +:ref:`Output <mcli-iam-project-list-output>`. |
| 120 | + |
| 121 | +.. code-block:: text |
| 122 | + :copyable: false |
| 123 | + |
| 124 | + ? Are you sure you want to delete: 5e33545ef10fab20b49c0f3b Yes |
| 125 | + Organization '5e33545ef10fab20b49c0f3b' deleted |
| 126 | + |
| 127 | +Delete an Organization without Confirmation |
| 128 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 129 | + |
| 130 | +The following command deletes an organization without requiring |
| 131 | +confirmation. The command uses the {+default-profile+}, which contains |
| 132 | +|api| keys that have the ``Global Owner`` role. |
| 133 | + |
| 134 | +.. code-block:: text |
| 135 | + |
| 136 | + mongocli iam organization delete 9dj3545ef10fab20b49c0f3b --force |
| 137 | + |
| 138 | +The previous command prints the following to the terminal: |
| 139 | + |
| 140 | +.. code-block:: text |
| 141 | + :copyable: false |
| 142 | + |
| 143 | + Organization '9dj3545ef10fab20b49c0f3b' deleted |
0 commit comments