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.2.tar.gz (29.8 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.2-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecsbatchcli-0.1.2.tar.gz
  • Upload date:
  • Size: 29.8 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.2.tar.gz
Algorithm Hash digest
SHA256 f0b187fb101b3721d50ec117fb826db95e619caf126ca9981da4e46a2d9cf9a8
MD5 33f46d47ca6ac61e2339bad361c1f195
BLAKE2b-256 f96ba085c52191b1c61559b818ac458cc8d4e110a50424a80b85100bb2e2bc6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ecsbatchcli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2785477ef6b009f7edbb7c13c6eae97ce73410589658dea28270882024022aa
MD5 b294b7b004b390de42fe4a7b7f6692e3
BLAKE2b-256 e92a8748821ad25dd6993beb24d919f84637e0127d25921cc4a0d5d6590fe324

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