Skip to content

Commit 51a36eb

Browse files
(DOCSP-11558, 11552, 11551, 11554, 11563): mongocli iam org apikey create, list, describe, assign, delete (#192)
* (DOCSP-11558): mongocli iam org apikey create * (DOCSP-11552): mongocli iam org apikey list * (DOCSP-11551): mongocli iam org apikey describe * (DOCSP-11554): mongoci iam org apikey assign * (DOCSP-11563): mongocli iam org apikey delete * Reorganize TOC for better usability * fixes * tech review * KS copy review * copy review
1 parent f8d59c5 commit 51a36eb

19 files changed

+945
-24
lines changed

config/redirects

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ symlink: stable -> v1.4.0
66

77
raw: mongocli/ -> ${base}/stable
88

9+
# For v1.4 and later
10+
[v1.4-*]: /${version}/reference/iam-organization-create -> ${base}/${version}/reference/iam/iam-organization-create
11+
[v1.4-*]: /${version}/reference/iam-organization-delete -> ${base}/${version}/reference/iam/iam-organization-delete
12+
[v1.4-*]: /${version}/reference/iam-organization-describe -> ${base}/${version}/reference/iam/iam-organization-describe
13+
[v1.4-*]: /${version}/reference/iam-organization-list -> ${base}/${version}/reference/iam/iam-organization-list
14+
[v1.4-*]: /${version}/reference/iam-project-create -> ${base}/${version}/reference/iam/iam-project-create
15+
[v1.4-*]: /${version}/reference/iam-project-delete -> ${base}/${version}/reference/iam/iam-project-delete
16+
[v1.4-*]: /${version}/reference/iam-project-describe -> ${base}/${version}/reference/iam/iam-project-describe
17+
[v1.4-*]: /${version}/reference/iam-project-list -> ${base}/${version}/reference/iam/iam-project-list
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The default output is a subset of the fields returned by this command.
2+
For the complete list of |json| fields returned by the command, see the
3+
Public |api| reference for your MongoDB service:

source/reference/access.txt

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _mcli-reference-access:
22

3-
=======================================
4-
``mongocli`` Access Management Commands
5-
=======================================
3+
===========================================
4+
``mongocli iam`` Access Management Commands
5+
===========================================
66

77
.. default-domain:: mongodb
88

@@ -12,32 +12,20 @@
1212
:depth: 1
1313
:class: singlecol
1414

15-
``iam``
16-
-------
15+
:ref:`organization <mcli-reference-iam-organization>`
16+
Manage organizations in your |com| instance.
1717

18-
You can use the mongocli ``iam`` command to manage projects in your
19-
|service| instance, or manage organizations and projects in your |com|
20-
instance.
18+
:ref:`organization apikey <mcli-reference-iam-organization-apikeys>`
19+
Manage |api| keys in your organization.
2120

22-
- :ref:`Create an organization <mcli-iam-organization-create>`
23-
- :ref:`List an organization <mcli-iam-organization-list>`
24-
- :ref:`Describe an organization <mcli-iam-organization-describe>`
25-
- :ref:`Delete an organization <mcli-iam-organization-delete>`
26-
- :ref:`Create a project <mcli-iam-project-create>`
27-
- :ref:`List projects <mcli-iam-project-list>`
28-
- :ref:`Describe a project <mcli-iam-project-describe>`
29-
- :ref:`Delete a project <mcli-iam-project-delete>`
21+
:ref:`project <mcli-reference-iam-project>`
22+
Manage projects in your |service|, |com| instance.
3023

3124
.. class:: hidden
3225

3326
.. toctree::
3427
:titlesonly:
3528

36-
Create an Organization </reference/iam-organization-create>
37-
List an Organization </reference/iam-organization-list>
38-
Describe an Organization </reference/iam-organization-describe>
39-
Delete an Organization </reference/iam-organization-delete>
40-
Create a Project </reference/iam-project-create>
41-
List Projects </reference/iam-project-list>
42-
Describe a Project </reference/iam-project-describe>
43-
Delete a Project </reference/iam-project-delete>
29+
Organizations </reference/iam/organization-commands>
30+
Organization API Keys </reference/iam/organization-apikey-commands>
31+
Projects </reference/iam/project-commands>
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
.. _mcli-iam-organization-apikey-assign:
2+
3+
=======================================
4+
mongocli iam organization apikey assign
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 ``iam organization apikey assign`` command updates the description
16+
or roles of the specified organization |api| key.
17+
18+
.. _mcli-iam-organization-apikey-assign-syntax:
19+
20+
Syntax
21+
------
22+
23+
.. code-block:: text
24+
25+
mongocli iam organization|organizations|org|orgs apiKey|apiKeys|apikeys assign|updates <api-key-id>
26+
[ --desc "<description-of-key>" ]
27+
[ --orgId <organization-id> ]
28+
[ --output|-o <output-format> ]
29+
[ --profile|-P <profile-name> ]
30+
[ --role <list-of-roles> ]
31+
32+
.. include:: /includes/fact-command-line-help.rst
33+
34+
.. _mcli-iam-organization-apikey-assign-arguments:
35+
36+
Arguments
37+
---------
38+
39+
.. list-table::
40+
:header-rows: 1
41+
:widths: 20 10 60 10
42+
43+
* - Argument
44+
- Type
45+
- Description
46+
- Required?
47+
48+
* - ``<api-key-id>``
49+
- string
50+
- Unique identifier for this organization API key.
51+
- yes
52+
53+
.. _mcli-iam-organization-apikey-assign-options:
54+
55+
Options
56+
-------
57+
58+
.. list-table::
59+
:header-rows: 1
60+
:widths: 20 10 60 10
61+
62+
* - Option
63+
- Type
64+
- Description
65+
- Required?
66+
67+
* - ``--desc``
68+
- string
69+
- Description of the |api| key to update.
70+
- no
71+
72+
* - ``--orgId``
73+
- string
74+
- Unique identifier of the organization of the |api| key you want
75+
to update.
76+
77+
If specified, this value overrides any organization ID
78+
stored in your :ref:`profile <mcli-profiles>` or
79+
:ref:`environment variable <mcli-env-var>`.
80+
81+
If omitted, your profile must contain the
82+
organization ID.
83+
- no
84+
85+
* - ``--output``, ``-o``
86+
- string
87+
- .. include:: /includes/extracts/fact-basic-options-output.rst
88+
- no
89+
90+
* - ``--profile``, ``-P``
91+
- string
92+
- Name of the profile where your credentials are saved.
93+
94+
If omitted, uses the {+default-profile+}. To learn more about
95+
creating a profile, see :ref:`mcli-configure`.
96+
- no
97+
98+
* - ``--role``
99+
- string
100+
- Role or roles to assign to the |api| key. To assign more than
101+
one role, you can specify each role with a ``--role`` flag or
102+
specify the roles in a comma-separated list with one ``--role``
103+
flag.
104+
- no
105+
106+
.. _mcli-iam-organization-apikey-assign-output:
107+
108+
Output
109+
------
110+
111+
If the command succeeds, it returns the following output in the default
112+
format. If the command returns errors, see :ref:`Troubleshooting
113+
<troubleshooting>` for recommended solutions.
114+
115+
.. code-block:: sh
116+
:copyable: false
117+
118+
API Key '<api-key-id>' successfully updated.
119+
120+
.. include:: /includes/fact-default-output.rst
121+
122+
- :atlas:`Atlas API </reference/api/apiKeys-orgs-update-one/#response>`
123+
- :cloudmgr:`Cloud Manager API </reference/api/api-keys/org/update-one-org-api-key/#response>`
124+
- :opsmgr:`Ops Manager API </reference/api/api-keys/org/update-one-org-api-key/#response>`
125+
126+
.. _mcli-iam-organization-apikey-assign-examples:
127+
128+
Examples
129+
--------
130+
131+
.. tabs::
132+
133+
.. tab:: Default Output
134+
:tabid: default-output
135+
136+
The following command updates the description and role of an
137+
organization |api| key using the {+default-profile+}, which
138+
contains credentials and the organization ID. The output is
139+
returned in the default format.
140+
141+
.. code-block:: sh
142+
143+
mongocli iam org apikey assign 5f3d8790c9022019903c1234 --role ORG_MEMBER --desc "User1 Member Key"
144+
145+
The previous command prints the following to the terminal.
146+
147+
.. code-block:: json
148+
:copyable: false
149+
150+
API Key '5f3d8790c9022019903c1234' successfully updated.
151+
152+
.. tab:: JSON Output
153+
:tabid: json-output
154+
155+
The following command updates the role and description of an
156+
|api| key using the ``myOM`` profile, which contains credentials.
157+
The output is returned in |json| format.
158+
159+
.. code-block:: sh
160+
161+
mongocli iam organization apikey assign 5f3d8790c9022019903c1234 --role ORG_MEMBER --desc "User1 Member Key" --orgId 5a1b39eec902201990f12345 -P myOM --output json
162+
163+
The previous command updates the |api| key and
164+
prints the following to the terminal in |json| format.
165+
166+
.. code-block:: json
167+
:copyable: false
168+
169+
[
170+
{
171+
"id": "5f3d8790c9022019903c1234",
172+
"desc": "User1 Member Key",
173+
"roles": [
174+
{
175+
"orgId": "5e429f2e12345c6eac4d59c9",
176+
"roleName": "ORG_MEMBER"
177+
}
178+
],
179+
"privateKey": "********-****-****-123468e0b5be",
180+
"publicKey": "abcdefgh"
181+
}
182+
]

0 commit comments

Comments
 (0)