Skip to content

Commit 80c1448

Browse files
authored
DOCSP-12060: [mongocli] iam team commands (#236)
1 parent fea0fb9 commit 80c1448

9 files changed

+826
-0
lines changed

source/reference/access.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
:ref:`project apikey <mcli-reference-iam-project-apikeys>`
3131
Manage |api| keys in your project.
3232

33+
:ref:`team <mcli-reference-iam-team>`
34+
Manage teams in your project.
35+
3336
.. class:: hidden
3437

3538
.. toctree::
@@ -41,3 +44,5 @@
4144
Organization API Keys </reference/iam/organization-apikey-commands>
4245
Projects </reference/iam/project-commands>
4346
Project API Keys </reference/iam/project-apikey-commands>
47+
Teams </reference/iam/team-commands>
48+
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
.. _iam-team-create:
2+
3+
========================
4+
mongocli iam team create
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 team create`` command creates a team
16+
in the specified organization using the specified profile.
17+
18+
You must have the ``Organization Owner`` role to run this
19+
command.
20+
21+
.. _mcli-iam-team-create-syntax:
22+
23+
Syntax
24+
------
25+
26+
.. code-block:: text
27+
28+
mongocli iam team create <team-name>
29+
--username <list-of-usernames>
30+
--orgId <organization-ID>
31+
[ --output|-o <output-format> ]
32+
[ --profile|-P <profile-name> ]
33+
34+
.. include:: /includes/fact-command-line-help.rst
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+
* - ``<team-name>``
49+
- string
50+
- Name of the team you want to create.
51+
- yes
52+
53+
.. _mcli-iam-team-create-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+
* - ``--username``
68+
- list of strings
69+
- Comma-separated list of usernames to add to the new team. Usernames
70+
must be valid organization users. A new team must have at least one
71+
user.
72+
73+
.. note::
74+
75+
New users must accept the invitation to join an organization
76+
before they can be added to a team.
77+
- yes
78+
79+
* - ``--orgId``
80+
- string
81+
- Unique identifier of the organization that contains the new
82+
team. If omitted, you must have an organization ID defined in
83+
your profile.
84+
- yes
85+
86+
* - ``--output``, ``-o``
87+
- string
88+
- .. include:: /includes/extracts/fact-basic-options-output.rst
89+
- no
90+
91+
* - ``--profile``, ``-P``
92+
- string
93+
- Name of the profile that contains the access information. If
94+
omitted, uses the {+default-profile+}.
95+
- no
96+
97+
.. _mcli-iam-team-create-output:
98+
99+
Output
100+
------
101+
102+
The command prints following output in the specified format to the
103+
terminal if the command succeeds. If the command returns errors,
104+
see :ref:`Troubleshooting <troubleshooting>` for recommended
105+
solutions.
106+
107+
.. tabs::
108+
109+
.. tab:: Default
110+
:tabid: default
111+
112+
.. code-block:: none
113+
114+
Team '<team-name>' created.
115+
116+
.. tab:: JSON
117+
:tabid: json
118+
119+
120+
.. list-table::
121+
:widths: 20 80
122+
:header-rows: 1
123+
124+
* - Field
125+
- Description
126+
127+
* - ``id``
128+
- The unique identifier of the new team.
129+
130+
* - ``name``
131+
- The name of the new team.
132+
133+
* - ``usernames``
134+
- A list of the usernames belonging to the new team.
135+
136+
.. _mcli-iam-team-create-examples:
137+
138+
Example
139+
-------
140+
141+
The following command creates a team called ``myTeam`` in an
142+
|service| organization. It uses the {+default-profile+} for
143+
accessing |service|.
144+
145+
.. code-block:: text
146+
147+
mongocli iam team create myTeam --username [email protected],[email protected] \
148+
--orgId 5df27c15f10fab55fc6c1234 -o json
149+
150+
The previous command prints the following in the specified format to
151+
the terminal. For more information on these fields, see
152+
:ref:`Output <mcli-iam-team-create-output>`.
153+
154+
.. code-block:: json
155+
:copyable: false
156+
157+
{
158+
"id": "5e44445ef10fab20b49c0f31",
159+
"name": "myTeam",
160+
"usernames": [
161+
162+
163+
]
164+
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
.. _iam-team-delete:
2+
3+
========================
4+
mongocli iam team 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 team delete`` command deletes a team in the specified
16+
organization using the specified profile.
17+
18+
.. _mcli-iam-team-delete-syntax:
19+
20+
Syntax
21+
------
22+
23+
.. code-block:: text
24+
25+
mongocli iam team delete <team-id>
26+
--orgId <organization-ID>
27+
[ --force ]
28+
[ --profile|-P <profile-name> ]
29+
30+
.. include:: /includes/fact-command-line-help.rst
31+
32+
Arguments
33+
---------
34+
35+
.. list-table::
36+
:header-rows: 1
37+
:widths: 20 10 60 10
38+
39+
* - Argument
40+
- Type
41+
- Description
42+
- Required?
43+
44+
* - ``<team-id>``
45+
- string
46+
- Unique identifier of the team you want to delete.
47+
- yes
48+
49+
.. _mcli-iam-team-delete-options:
50+
51+
Options
52+
-------
53+
54+
.. list-table::
55+
:header-rows: 1
56+
:widths: 20 10 60 10
57+
58+
* - Option
59+
- Type
60+
- Description
61+
- Required?
62+
63+
* - ``--orgId``
64+
- string
65+
- Unique identifier of the organization that contains the team you
66+
want to delete.
67+
- yes
68+
69+
* - ``--force``
70+
-
71+
- Flag that indicates that the team can be deleted without
72+
requiring confirmation.
73+
- no
74+
75+
* - ``--profile``, ``-P``
76+
- string
77+
- Name of the profile that contains the access information. If
78+
omitted, uses the {+default-profile+}.
79+
- no
80+
81+
.. _mcli-iam-team-delete-output:
82+
83+
Output
84+
------
85+
86+
The command prints following output to the terminal if the command succeeds.
87+
If the command returns errors, see :ref:`Troubleshooting <troubleshooting>`
88+
for recommended solutions.
89+
90+
.. code-block:: none
91+
92+
Team '<team-id>' deleted
93+
94+
.. _mcli-iam-team-delete-examples:
95+
96+
Example
97+
-------
98+
99+
The following command deletes a team with ID ``5e44445ef10fab20b49c0f31``
100+
in an |service| organization. It uses the {+default-profile+} for accessing
101+
|service|.
102+
103+
.. code-block:: text
104+
105+
mongocli iam team delete 5e44445ef10fab20b49c0f31 \
106+
--orgId 5df27c15f10fab55fc6c1234 --force
107+
108+
The previous command prints the following to the terminal.
109+
110+
.. code-block:: none
111+
:copyable: false
112+
113+
Team '5e44445ef10fab20b49c0f31' deleted

0 commit comments

Comments
 (0)