Skip to content

Commit 9f712ef

Browse files
authored
(DOCSP-12067, DOCSP-12067, DOCSP-12078, DOCSP-12083) mongocli iam project team (#253)
* (DOCSP-12067) (DOCSP-12067) (DOCSP-12078) (DOCSP-12083) mongocli iam project team add | list | update | delete
1 parent 6c80898 commit 9f712ef

File tree

6 files changed

+602
-1
lines changed

6 files changed

+602
-1
lines changed

source/reference/access.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
Manage |api| keys in your project.
3232

3333
:ref:`team <mcli-reference-iam-team>`
34-
Manage teams in your project.
34+
Manage teams in your organization.
35+
36+
:ref:`project team <mcli-reference-iam-team>`
37+
Manage teams for your project.
3538

3639
:ref:`user <mcli-reference-iam-user>`
3740
Manage users in your MongoDB service.
@@ -48,5 +51,6 @@
4851
Projects </reference/iam/project-commands>
4952
Project API Keys </reference/iam/project-apikey-commands>
5053
Teams </reference/iam/team-commands>
54+
Project Teams </reference/iam/project-team-commands>
5155
Users </reference/iam/user-commands>
5256

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
.. _iam-project-team-add:
2+
3+
=============================
4+
mongocli iam project team add
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 project team add`` command adds a team
16+
to the specified project with the specified roles.
17+
18+
You must have the ``Project Owner`` role to run this command.
19+
20+
.. _mcli-iam-project-team-add-syntax:
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: text
26+
27+
mongocli iam project|s team|s add <team-ID>
28+
--role <role>
29+
[ --projectId <projectId> ]
30+
[ --output|-o <output-format> ]
31+
[ --profile|-P <profile-name> ]
32+
33+
.. include:: /includes/fact-command-line-help.rst
34+
35+
Arguments
36+
---------
37+
38+
.. list-table::
39+
:header-rows: 1
40+
:widths: 20 10 60 10
41+
42+
* - Argument
43+
- Type
44+
- Description
45+
- Required?
46+
47+
* - ``<team-ID>``
48+
- string
49+
- The unique identifier of the team to add to a project.
50+
51+
You can retrieve a list of team IDs for an
52+
organization with the :ref:`iam team list <iam-team-list>`
53+
command.
54+
- yes
55+
56+
.. _mcli-iam-project-team-add-options:
57+
58+
Options
59+
-------
60+
61+
.. list-table::
62+
:header-rows: 1
63+
:widths: 20 10 60 10
64+
65+
* - Option
66+
- Type
67+
- Description
68+
- Required?
69+
70+
* - ``--role``
71+
- string
72+
- Role or roles to assign to the members of the team for the
73+
specified project. To assign more than one role, you can specify
74+
each role with a ``--role`` flag or specify the roles in a
75+
comma-separated list with one ``--role`` flag.
76+
77+
- yes
78+
79+
* - ``--projectId``
80+
- string
81+
- Unique identifier of the project to which to add the team.
82+
If omitted, uses the project ID in
83+
the profile or :ref:`environment variable <mcli-env-var>`.
84+
- no
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-add-user-output:
98+
99+
Output
100+
------
101+
102+
.. include:: /includes/command-output-intro.rst
103+
104+
.. tabs::
105+
106+
.. tab:: Default
107+
:tabid: default
108+
109+
.. code-block:: none
110+
111+
Team added to the project.
112+
113+
.. tab:: JSON
114+
:tabid: json
115+
116+
The JSON response returns an array of teams with access to the
117+
specified project, with the following details about each team:
118+
119+
.. list-table::
120+
:widths: 20 80
121+
:header-rows: 1
122+
123+
* - Field
124+
- Description
125+
126+
* - ``roleNames``
127+
- Array of roles granted to users on the team for this
128+
project.
129+
130+
* - ``teamId``
131+
- The unique identifier of the team.
132+
133+
.. _mcli-iam-user-add-examples:
134+
135+
Example
136+
-------
137+
138+
The following command adds an organization team to an |service| project
139+
with two |service| project roles. It uses the {+default-profile+} for
140+
accessing |service|.
141+
142+
.. code-block:: text
143+
144+
mongocli iam project team add 5dd58c647a3e5a6c5bce46c7 --role GROUP_READ_ONLY --role GROUP_CLUSTER_MANAGER
145+
146+
The previous command prints the following in the default format to
147+
the terminal.
148+
149+
.. code-block:: none
150+
:copyable: false
151+
152+
Team added to the project.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
.. _iam-project-team-delete:
2+
3+
================================
4+
mongocli iam project 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 project team delete`` command removes a team from
16+
the specified project using the specified profile. The team still
17+
exists in the organization in which it was created after being deleted
18+
from a project.
19+
20+
You must have the ``Project Owner`` role to run this
21+
command.
22+
23+
.. _mcli-iam-project-team-delete-syntax:
24+
25+
Syntax
26+
------
27+
28+
.. code-block:: text
29+
30+
mongocli iam project|s team|s delete|rm <team-ID>
31+
[ --projectID <project-id> ]
32+
[ --force ]
33+
[ --profile|-P <profile-name> ]
34+
35+
.. include:: /includes/fact-command-line-help.rst
36+
37+
Arguments
38+
---------
39+
40+
.. list-table::
41+
:header-rows: 1
42+
:widths: 20 10 60 10
43+
44+
* - Argument
45+
- Type
46+
- Description
47+
- Required?
48+
49+
* - ``<team-ID>``
50+
- string
51+
- Unique identifier of the team you want to delete from the
52+
specified project.
53+
54+
You can retrieve a list of team IDs for your project
55+
with the :ref:`iam project team list <iam-project-team-list>`
56+
command.
57+
- yes
58+
59+
.. _mcli-iam-project-team-delete-options:
60+
61+
Options
62+
-------
63+
64+
.. list-table::
65+
:header-rows: 1
66+
:widths: 20 10 60 10
67+
68+
* - Option
69+
- Type
70+
- Description
71+
- Required?
72+
73+
* - ``--projectId``
74+
- string
75+
- Unique identifier of the project for that contains the team you
76+
want to delete. If omitted, uses the project ID in
77+
your profile or :ref:`environment variable <mcli-env-var>`.
78+
- no
79+
80+
* - ``--force``
81+
-
82+
- Flag that indicates that the team can be deleted without
83+
requiring confirmation.
84+
- no
85+
86+
* - ``--profile``, ``-P``
87+
- string
88+
- Name of the profile that contains the access information. If
89+
omitted, uses the {+default-profile+}.
90+
- no
91+
92+
.. _mcli-iam-project-team-delete-output:
93+
94+
Output
95+
------
96+
97+
.. include:: /includes/command-output-intro.rst
98+
99+
.. code-block:: none
100+
101+
Team '<team-ID>' deleted
102+
103+
.. _mcli-iam-project-team-delete-examples:
104+
105+
Example
106+
-------
107+
108+
The following command deletes a team with ID
109+
``5e44445ef10fab20b49c0f31``
110+
in an |service| project. It uses the {+default-profile+} for
111+
accessing |service|.
112+
113+
.. code-block:: text
114+
115+
mongocli iam project team delete 5e44445ef10fab20b49c0f31 --projectId 5dd6faab74979f10f39ffb78 --force
116+
117+
The previous command prints the following to the terminal.
118+
119+
.. code-block:: none
120+
:copyable: false
121+
122+
Team '5e44445ef10fab20b49c0f31' deleted

0 commit comments

Comments
 (0)