Docs 菜单
Docs 主页
/ /
Atlas CLI
/ /

Atlas 用户邀请

在此页面上

  • 语法
  • 选项
  • 继承选项
  • 输出
  • 举例

Atlas user为您的MongoDB Atlas 应用程序创建一个 ,并邀请该Atlas user 加入您的组织和项目。

Atlas 用户帐户仅授予对 MongoDB Atlas 应用程序的访问权限。要授予数据库访问权限,请使用 atlas dbusers create 创建数据库用户。

命令语法
atlas users invite [options]
名称
类型
必需
说明
--country
字符串
true
ISO 3166-1 用户地理位置的 alpha 双字母国家/地区代码。 Atlas CLI 需要此选项。
--email
字符串
true
用户的电子邮件地址。
--firstName
字符串
true
用户的名字。
-h,--help
false
邀请帮助
--lastName
字符串
true
用户的姓氏。
--mobile
字符串
false
用户的手机号码。
--orgRole
字符串
false
唯一的 24 位字符串,用于标识组织、冒号以及用户在组织中的角色。 将此值指定为 orgID:ROLE。 角色的有效值包括 ORG_OWNER、ORG_MEMBER、ORG_GROUP_CREATOR、ORG_BILLING_ADMIN 和 ORG_READ_ONLY。
-o, --output
字符串
false
输出格式。 有效值为 json、json-path、go-template 或 go-template-file。 要查看完整输出,请使用 -o json 选项。
--password
字符串
false
用户的密码。
--projectRole
字符串
false
唯一的 24 位字符串,用于标识项目、冒号和用户在项目中的角色。 将此值指定为 projectID:ROLE。 ROLE 的有效值包括 GROUP_CLUSTER_MANAGER、GROUP_DATA_ACCESS_ADMIN、GROUP_DATA_ACCESS_READ_ONLY、GROUP_DATA_ACCESS_READ_WRITE、GROUP_OWNER 和 GROUP_READ_ONLY。
--username
字符串
true
标识用户的名称。 您必须指定有效的电子邮件地址。
名称
类型
必需
说明
-P, --profile
字符串
false
要从配置文件中使用的配置文件的名称。 要了解 Atlas CLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings。

如果命令成功,CLI 将返回类似于以下示例的输出。 括号中的值代表您的价值观。

The user '<Username>' has been invited.
Invited users do not have access to the project until they accept the invitation.
# Create the Atlas user with the username user@example.com and invite them to the organization with the ID 5dd56c847a3e5a1f363d424d with ORG_OWNER access:
atlas users invite --email user@example.com --username user@example.com --orgRole 5dd56c847a3e5a1f363d424d:ORG_OWNER --firstName Example --lastName User --country US --output json
# Create the Atlas user with the username user@example.com and invite them to the project with the ID 5f71e5255afec75a3d0f96dc with GROUP_READ_ONLY access:
atlas users invite --email user@example.com --username user@example.com --projectRole 5f71e5255afec75a3d0f96dc:GROUP_READ_ONLY --firstName Example --lastName User --country US --output json

后退

描述