mongocli iam users invite
为您的MongoDB应用程序创建MongoDB用户,并邀请MongoDB用户加入您的组织和项目。
MongoDB用户账户仅授予对MongoDB应用程序的访问权限。要授予数据库访问权限,请使用mongocli [ops-manager|cloud-manager] dbusers create创建数据库用户。
语法
命令语法
mongocli iam users invite [options]
选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
--country | 字符串 | false | ISO 3166-1 alpha两位字母的国家代码,表示用户的地理位置。Atlas CLI需要此选项。 |
--email | 字符串 | true | 用户的电子邮件地址。 |
--firstName | 字符串 | true | 用户的第一个或名字。 |
-h, --help | false | 邀请的帮助 | |
--lastName | 字符串 | true | 用户的姓氏、姓或名字。 |
--mobile | 字符串 | false | 用户的手机号码。 |
--orgRole | 字符串 | false | 唯一24位字符串,用于标识组织、冒号和用户在组织中的角色。指定此值时,请使用orgID:ROLE。要了解MCLI接受的值,请参阅Atlas API规范中的角色枚举项:https://mongodb.ac.cn/docs/atlas/reference/api-resources-spec/#operation/createOrganizationInvitation/。 |
-o, --output | 字符串 | false | 输出格式。有效值是json、json-path、go-template或go-template-file。要查看完整输出,请使用-o json选项。 |
--password | 字符串 | false | 用户的密码。 |
--projectRole | 字符串 | false | 唯一24位字符串,用于标识项目、冒号和用户在项目中的角色。指定此值时,请使用projectID:ROLE。对于角色,有效值包括GROUP_CLUSTER_MANAGER、GROUP_DATA_ACCESS_ADMIN、GROUP_DATA_ACCESS_READ_ONLY、GROUP_DATA_ACCESS_READ_WRITE、GROUP_OWNER、GROUP_READ_ONLY、GROUP_AUTOMATION_ADMIN、GROUP_BACKUP_ADMIN和GROUP_MONITORING_ADMIN。 |
--username | 字符串 | true | 标识用户的名称。您必须指定有效的电子邮件地址。 |
继承选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
-P, --profile | 字符串 | false | 从您的配置文件中使用的配置文件名称。有关MongoCLI配置文件的配置信息,请参阅https://dochub.mongodb.org/core/atlas-cli-configuration-file. |
示例
# Create the MongoDB user with the username user@example.com and invite them to the organization with the ID 5dd56c847a3e5a1f363d424d with ORG_OWNER access: mongocli iam users invite --email user@example.com --username user@example.com --orgRole 5dd56c847a3e5a1f363d424d:ORG_OWNER --firstName Example --lastName User --country US --output json
# Create the MongoDB user with the username user@example.com and invite them to the project with the ID 5f71e5255afec75a3d0f96dc with GROUP_READ_ONLY access: mongocli iam users invite --email user@example.com --username user@example.com --projectRole 5f71e5255afec75a3d0f96dc:GROUP_READ_ONLY --firstName Example --lastName User --country US --output json