Skip to main content

A lightweight Python wrapper for the SolusVM client API.

Project description

https://img.shields.io/pypi/status/beam.svg https://img.shields.io/pypi/v/beam.svg https://img.shields.io/pypi/pyversions/beam.svg https://travis-ci.org/gebn/beam.svg?branch=master https://coveralls.io/repos/github/gebn/beam/badge.svg?branch=master

A lightweight Python wrapper for the SolusVM client API.

Features

  • Query a host’s memory, bandwidth, IP addresses and storage usage.

  • Configurable to work with any SolusVM provider.

Demo

import beam

# get a list of hosts using above 90% of their memory
hosts = [host for host in beam.hosts()
         if host.memory.used_percentage > .9]

# get a list of hosts with less than 10 GiB of storage left
hosts = [host for host in beam.hosts()
         if host.storage.free_bytes < 1024 ** 3 * 10]

Setup

  1. Run pip install beam to download the module.

  2. Create your .beam.ini inventory file.

Inventory

The inventory file holds information about your hosting provider(s) and host(s), so beam knows how to contact the relevant API endpoints and what credentials to use. Here’s a sample file:

[special:vendors]
ramnode = https://vpscp.ramnode.com
fliphost = https://solus.fliphost.net
default = ramnode

[nyc-1]
key = nyc-1_host_key
hash = nyc-1_host_hash

[ams-1]
key = ams-1_host_key
hash = ams-1_host_hash
vendor = fliphost

This file defines two hosts, nyc-1, hosted with RamNode, and ams-1, hosted with FlipHost. At the top are the vendor names in a special vendors section (all other sections are assumed to represent hosts). The format maps a vendor name to their base endpoint for the SolusVM API. The default directive indicates the implicit vendor of every host, and must be specified if more than one vendor is defined.

Each host has its own section. The correct key and hash values can be optained from the SolusVM control panel used by your vendor. If a host is not provided by the default vendor, a vendor directive specifies the correct one.

Roadmap

  • Implement .boot(), .reboot() and .shutdown() for hosts.

Etymology

Although “solus” means alone, that’s a tad depressing. Solus also conjures up images of the sun for me. The sun beams down - and the name was available on PyPI - so beam it was.

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

beam-0.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

beam-0.1.0-py2-none-any.whl (16.0 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: beam-0.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for beam-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d0fe6d189afc25fcf04eaf071cf10802a2dd675a5056068a50f1a161b46648e
MD5 b4249f6872c7a1e87199c331be553624
BLAKE2b-256 79cd3fe6ac518197397ffeff3f4e53da9f4505ec79e33be84321e3c1471cc51e

See more details on using hashes here.

File details

Details for the file beam-0.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for beam-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 0618e7af2efa923ebdcfd959622e0a9381f5e96ec2a5d029ea0c0b041f169855
MD5 ae5c86e6fbe88b114fcfaf81b719bc6d
BLAKE2b-256 035f5f7ab69ae9573bc747cab1938ef44fead60503c0f5dce7e86e44a7c30a82

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