A CLI tool for batch management of Volcano Engine ECS instances
Project description
ECSBatchCLI - 火山引擎ECS批量管理CLI工具
ECSBatchCLI是一款基于Python的命令行工具,用于高效、自动化地批量创建和销毁火山引擎云主机(ECS实例)。通过读取用户定义的YAML配置文件和接收命令行参数,简化操作流程,减少人工干预,满足特定业务场景下对资源快速响应和成本控制的需求。
主要功能
- 批量创建云主机:通过简单的命令行参数,批量创建符合特定配置的云主机
- 批量销毁云主机:安全、精确地批量销毁特定范围内的云主机
- 配置管理:通过YAML配置文件管理常用的云主机配置模板
- 结果反馈:清晰展示每次批量操作的执行结果和潜在问题
安装
要求
- Python 3.6+
- 火山引擎账号和访问凭证(AK/SK)
- 火山引擎SDK(volcengine-python-sdk>=1.0.0)
安装火山引擎SDK
详细安装方法请参考火山引擎SDK安装指南。
简要步骤:
# 安装火山引擎Python SDK
pip install volcengine-python-sdk>=1.0.0
通过pip安装
pip install ecsbatchcli
从源码安装
git clone https://github.com/volcengine/ecsbatchcli.git
cd ecsbatchcli
pip install -e .
注意:从源码安装时,您仍需要单独安装火山引擎SDK。
快速开始
1. 创建配置文件
在当前目录下创建config.yaml文件,或使用--config参数指定配置文件路径。配置文件示例:
credentials:
access_key_id: "your_access_key_id"
secret_access_key: "your_secret_access_key"
profiles:
- name: "test-profile"
region_id: "cn-beijing"
availability_zone_id: "cn-beijing-a"
image_id: "image-xxxxxxxxx"
security_group_id: "sg-xxxxxxxxx"
vpc_id: "vpc-xxxxxxxxx"
subnet_id: "subnet-xxxxxxxxx"
default_instance_type: "ecs.g1ie.large"
system_disk_type: "ESSD_PL0"
system_disk_size_gb: 40
hostname_prefix: "test-server"
project_id: "project-xxxxxxxxx"
2. 批量创建云主机
ecsbatchcli create --config-group test-profile --instance-type ecs.g1ie.large --count 5
3. 批量销毁云主机
ecsbatchcli delete --config-group test-profile --count 3
详细文档
更多详细用法和配置选项,请参考完整文档。
许可证
本项目采用MIT许可证。详见LICENSE文件。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecsbatchcli-0.1.3.tar.gz.
File metadata
- Download URL: ecsbatchcli-0.1.3.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd244349e923d46e9475174090654c25422ab3b669d531fbc0fe2a05d0f64317
|
|
| MD5 |
ae23cbce45590e6b6c7cb2afdb3a8258
|
|
| BLAKE2b-256 |
abc750efc61005bc1ca5e9ed1d9fbd230627d98ac85f97a29522ead3732d4864
|
File details
Details for the file ecsbatchcli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ecsbatchcli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2009f4bc23bcaa43886bfc0730535a6fe13762c42155cb95dbbb09de33f0d5d9
|
|
| MD5 |
5ce9beefdf4a652d3cc2b4470e77fb3f
|
|
| BLAKE2b-256 |
88cf4cad6848edb759031b0529168e111e9fbc93718d927daa4e0062919f8762
|