mongocli iam project team update
The mongocli iam project team update
command updates the roles of a
team with access to a specified project.
You must have the Project Owner
role to run this
command.
Syntax
mongocli iam project team update <team-ID> --role <role> [ --projectId <project-ID> ] [ --output|-o <output-format> ] [ --profile|-P <profile-name> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Arguments
Argument | Type | Description | Required? |
---|---|---|---|
<team-ID> | string | The unique identifier of the team to update. You can retrieve a list of team IDs for your project with the iam project team list command. | yes |
Options
Option | Type | Description | Required? |
---|---|---|---|
--role | string | Role or roles to assign to the members of the team for the
specified project. To assign more than one role, you can specify
each role with a The roles you provide to | yes |
--projectId | string | Unique identifier of the project to which to add the team.
If omitted, uses the project ID in
the profile or environment variable. | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile that contains the access information. If
omitted, uses the default profile. | no |
Output
The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.
Team's roles updated.
The JSON response returns an array of teams with access to the specified project, with the following details about each team:
Field | Description |
---|---|
roleNames | Array of roles granted to users on the team for this
project. |
teamId | The unique identifier of the team. |
Example
The following command updates a team in an Atlas project to have
only the GROUP_READ_ONLY
and GROUP_CLUSTER_MANAGER
roles.
It uses the default profile for accessing Atlas.
mongocli iam project team update 5dd58c647a3e5a6c5bce46c7 --role GROUP_READ_ONLY --role GROUP_CLUSTER_MANAGER -o json
The previous command prints the following in the specified format to the terminal. For more information on these fields, see Output.
[ { "links": [...], "roleNames": [ "GROUP_CLUSTER_MANAGER", "GROUP_READ_ONLY" ], "teamId": "5f76335aec870a73dd591699" } ]