从你的软层虚拟服务器制作图像,无痛
snaplayer的Python项目详细描述
快照层
snaplayer是一个简单的python命令行工具 并将您的软层虚拟服务器捕获到相应的映像中 不管怎么努力。
快速启动
# First of all, you need to install pip3 install snaplayer # Create a criteria configuration file cat << EOF > my_config.yml hourly: false tags: - cool - cooler domain: cool.io EOF # It's best to list your instances first snaplayer --list my_config.yml # Capture your instances into images! snaplayer --capture my_config.yml
安装
snaplayer的安装可以直接从源代码通过pip或 easy_install,随便你喜欢。
选项1:pip
$ pip install snaplayer
选项2:来源
$ git clone git@github.com:axltxl/snaplayer.git $ cd snaplayer $ python3 setup.py install
基本用法
正常执行
$ snaplayer --capture /path/to/my/custom/snaplayer.yaml
列出实例
$ snaplayer --list /path/to/my/custom/snaplayer.yaml
静音输出
$ snaplayer -q
干运行
$ snaplayer -d
配置文件
Snaplayer列出并告诉Softlayer基于 从'criteria file'中提取的条件信息 只不过是一个死了的简单yaml文件,有几个键值对, 喜欢这样:
--- # Example criteria YAML file domain: mydomain.com tags: [mydomain, production] hourly: false monthly: true cpus: 2
配置选项对应于SoftLayer.vs.list_instances
选项
snaplayer [options] (--list | --capture) <config_file>
- --capture捕获实例并从中创建图像
- --list仅列出实例 显示版本号并退出< > >
- -d | --dry-run实际上什么都不做
- -q | --quiet安静输出
- --ll | --log-level=[num]设置日志输出级别
- -l LOG_FILE | --log-file LOG_FILE set log file
贡献
有很多方法可以帮助SnapLayer。 代码补丁只是其中一件事,你可以提交以帮助项目。 我们也欢迎反馈、错误报告、功能请求、文档改进, 广告和测试。
反馈贡献
这是迄今为止最简单的贡献方式。 如果您使用Snaplayer是为了您自己的利益,请不要犹豫分享。 请随意submit issues and enhancement requests.
代码贡献
代码贡献(补丁、新特性)是帮助项目开发的最明显的方法。 由于这是如此普遍,我们要求您遵循我们的工作流程,以最有效地与我们合作。 对于代码贡献,我们遵循“fork-and-pull”git工作流。
一。fork,然后在github上克隆您的repo
git clone git@github.com:your-username/snaplayer.git git add origin upstream https://github.com/axltxl/snaplayer.git
如果你已经创建了回购协议,那么一定要合并 在发出拉取请求之前“上游”的最新更改。
git pull upstream
2.在本地回购中创建新的功能分支
git checkout -b my_feature_branch
三。进行更改,然后确保测试通过
pyvenv snaplayer-pyve && source snaplayer-pyve/bin/activate python3 setup.py test
四。完成后提交更改
git commit -a -m "My commit message" git push origin my_feature_branch
- 提交一个pull request,其中包含您的更改的功能分支。
版权和许可
版权所有(c)Alejandro Ricoveri
特此免费向任何获得 本软件和相关文档文件的副本 “软件”),无限制地处理软件,包括 但不限于使用、复制、修改、合并、发布, 分发、再授权和/或出售软件副本,以及 允许向其提供软件的人员这样做,但须遵守 以下条件:
上述版权公告及本许可公告须包括在内 在软件的所有副本或大部分中。
本软件按“原样”提供,不作任何保证。任何孩子,快车 或默示的,包括但不限于 市场稳定性、特定用途的适用性和非侵权性。 在任何情况下,作者或版权持有人均不对任何 索赔、损害赔偿或其他责任,无论是在诉讼或合同中, 侵权行为或其他,由 软件或软件的使用或其他交易