Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecsbatchcli-0.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecsbatchcli-0.1.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file ecsbatchcli-0.1.0.tar.gz.

File metadata

  • Download URL: ecsbatchcli-0.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.17

File hashes

Hashes for ecsbatchcli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e68a95af6b5be7186556aabc5662f4983cf791c81b2261ac012cb10512d2048d
MD5 f8a7c109d494d655cab7da6e548abf38
BLAKE2b-256 15ac9744bc769b32fc3ba62d4ba0909949cc242767bbb7c6a5978628c5dab542

See more details on using hashes here.

File details

Details for the file ecsbatchcli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ecsbatchcli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.17

File hashes

Hashes for ecsbatchcli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7caa3df6589fc9b7cd861459ceefc1c952cb75e7a535014fe580021404ebe6
MD5 9eebb479ab217e2042af816901fe3774
BLAKE2b-256 465ee1c7e60ee189e66febcb2bdc37b327df1d341fdbe6764fe0d256aa8e238b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page