您可以使用集群配置文件来指定使用Atlas CLI创建集群、更新集群或升级集群时所需的设置。 Atlas CLI接受.json集群配置文件。
可用设置
When you create clusters using a configuration file, you can specify any settings that are listed in Create One Cluster from One Project under Request Body Schema.
When you update clusters using a configuration file, you can specify any settings that are listed in Modify One Cluster from One Project under Request Body Schema.
When you upgrade clusters using a configuration file, you can specify any settings that are listed in Upgrade One Shared-tier Cluster under Request Body Schema.
创建配置文件
创建集群
请按照以下步骤使用配置文件创建集群:
Copy the sample request for Create One Cluster from One Project.
Navigate to the Create One Cluster from One Project section of the Atlas Admin API specification.
在右侧的Request samples下,单击Expand all 。
单击Copy ,复制样本请求。
使用 --file 选项运行Atlas clusters 搜索 nodes create命令。
使用--file标志指定保存的文件的路径。
更新集群
请按照以下步骤使用配置文件更新集群:
复制“从一个项目修改一个集群”的示例请求。
Navigate to the Modify One Cluster from One Project section of the Atlas Admin API specification.
在右侧的Request samples下,单击Expand all 。
单击Copy ,复制样本请求。
使用--file选项运行Atlas clusters 搜索 Nodes 更新命令。
使用--file标志指定保存的文件的路径。
升级集群
请按照以下步骤使用配置文件升级集群:
Copy the sample request for Upgrade One Shared-tier Cluster.
Navigate to the Upgrade One Shared-tier Cluster section of the Atlas Admin API specification.
在右侧的Request samples下,单击Expand all 。
单击Copy ,复制样本请求。
运行带有--file选项的Atlas clusters 升级命令。
使用--file标志指定保存的文件的路径。