Skip to main content

Make images out of your Softlayer virtual servers, painlessly

Project description

snaplayer

snaplayer is a minimalist python command line tool for easily list and capture your Softlayer virtual servers into corresponding images with no effort whatsoever.

Quick start

# 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

Requirements

Installation

Installation of snaplayer can be made directly from source, via pip or easy_install, whichever you prefer.

Option # 1: pip

$ pip install snaplayer

Option # 2: from source

$ git clone git@github.com:axltxl/snaplayer.git
$ cd snaplayer
$ python3 setup.py install

Option # 3: easy_install

$ easy_install snaplayer

From this point you can edit your configuration file

$ vi /etc/snaplayer/snaplayer.yaml

Basic Usage

Normal execution

$ snaplayer --capture /path/to/my/custom/snaplayer.yaml

List instances

$ snaplayer --list /path/to/my/custom/snaplayer.yaml

Quiet output

$ snaplayer -q

Dry run

$ snaplayer -d

Configuration file

snaplayer lists and tells Softlayer to capture images based on criteria information extracted from a ‘criteria file’ which is no more than a dead-simple YAML file with a handful key-value pairs, like so:

---
# Example criteria YAML file
domain: mydomain.com
tags: [mydomain, production]
hourly: false
monthly: true
cpus: 2

Configuration options are correspondent to those of SoftLayer.vs.list_instances

Options

snaplayer [options] (--list | --capture) <config_file>
  • --capture Capture instances and create images from them

  • --list List instances only

  • --version show version number and exit

  • --list only list matching instances and exit

  • -h | --help show a help message and exit

  • -d | --dry-run don’t actually do anything

  • -q | --quiet quiet output

  • --ll | --log-level=[num] set logging output level

  • -l LOG_FILE | --log-file LOG_FILE set log file

Contributing

There are many ways in which you can contribute to snaplayer. Code patches are just one thing amongst others that you can submit to help the project. We also welcome feedback, bug reports, feature requests, documentation improvements, advertisement and testing.

Feedback contributions

This is by far the easiest way to contribute something. If you’re using snaplayer for your own benefit, don’t hesitate sharing. Feel free to submit issues and enhancement requests.

Code contributions

Code contributions (patches, new features) are the most obvious way to help with the project’s development. Since this is so common we ask you to follow our workflow to most efficiently work with us. For code contributions, we follow the “fork-and-pull” Git workflow.

1. Fork, then clone your repo on GitHub

git clone git@github.com:your-username/snaplayer.git
git add origin upstream https://github.com/axltxl/snaplayer.git

If you already forked the repo, then be sure to merge the most recent changes from “upstream” before making a pull request.

git pull upstream

2. Create a new feature branch in your local repo

git checkout -b my_feature_branch

3. Make your changes, then make sure the tests passes

pyvenv snaplayer-pyve && source snaplayer-pyve/bin/activate
python3 setup.py test

4. Commit your changes once done

git commit -a -m "My commit message"
git push origin my_feature_branch
  1. Submit a pull request with your feature branch containing your changes.

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

snaplayer-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file snaplayer-0.1.1.tar.gz.

File metadata

  • Download URL: snaplayer-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for snaplayer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1c76719909b93655bfdb7403132def8e75318563bcd913e4b39a18077811cdc2
MD5 d84997cc2e010586d034e7e5ec375f79
BLAKE2b-256 16629aae9723a3319c91fba50d3bcff41cc12b32029b3c0bdf6c60ef977fe0d5

See more details on using hashes here.

Supported by

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