Skip to content

Update docs #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ FIXME

## Reviewers

@puppetlabs/dio
@highb
@briancain
6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set Puppet's DIO team as the default code owner
* @puppetlabs/dio

# External code owners
* @briancain
* @highb
119 changes: 77 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
vmfloaty
========
# vmfloaty

[![Gem Version](https://badge.fury.io/rb/vmfloaty.svg)](https://badge.fury.io/rb/vmfloaty) [![Build Status](https://travis-ci.org/briancain/vmfloaty.svg?branch=master)](https://travis-ci.org/briancain/vmfloaty)
[![Gem Version](https://badge.fury.io/rb/vmfloaty.svg)](https://badge.fury.io/rb/vmfloaty) [![Build Status](https://travis-ci.com/puppetlabs/vmfloaty.svg?branch=master)](https://travis-ci.com/puppetlabs/vmfloaty)

A CLI helper tool for [Puppet Labs vmpooler](https://github.com/puppetlabs/vmpooler) to help you stay afloat.
A CLI helper tool for [Puppet's vmpooler](https://github.com/puppetlabs/vmpooler) to help you stay afloat.

<img src="http://i.imgur.com/xGcGwuH.jpg" width=200 height=200>
![float image](float.jpg)

- [Install](#install)
- [Usage](#usage)
- [Example workflow](#example-workflow)
- [vmfloaty dotfile](#vmfloaty-dotfile)
- [Basic configuration](#basic-configuration)
- [Default to Puppet's ABS instead of vmpooler](#default-to-puppets-abs-instead-of-vmpooler)
- [Configuring multiple services](#configuring-multiple-services)
- [Using a Nonstandard Pooler service](#using-a-nonstandard-pooler-service)
- [Valid config keys](#valid-config-keys)
- [Tab Completion](#tab-completion)
- [vmpooler API](#vmpooler-api)
- [Using the Pooler class](#using-the-pooler-class)
- [Example Projects](#example-projects)
- [Special thanks](#special-thanks)

## Install

Grab the latest from ruby gems...

```
$ gem install vmfloaty
...
...
$ floaty --help
```bash
gem install vmfloaty
```

## Usage

```
delete Schedules the deletion of a host or hosts
get Gets a vm or vms based on the os argument
help Display global or [command] help documentation
list Shows a list of available vms from the pooler or vms obtained with a token
modify Modify a vms tags, time to live, and disk space
query Get information about a given vm
revert Reverts a vm to a specified snapshot
snapshot Takes a snapshot of a given vm
ssh Grabs a single vm and sshs into it
status Prints the status of pools in vmpooler
summary Prints a summary of vmpooler
token Retrieves or deletes a token or checks token status
```plain
$ floaty --help
NAME:

floaty

DESCRIPTION:

A CLI helper tool for Puppet's vmpooler to help you stay afloat

COMMANDS:

completion Outputs path to completion script
delete Schedules the deletion of a host or hosts
get Gets a vm or vms based on the os argument
help Display global or [command] help documentation
list Shows a list of available vms from the pooler or vms obtained with a token
modify Modify a VM's tags, time to live, disk space, or reservation reason
query Get information about a given vm
revert Reverts a vm to a specified snapshot
snapshot Takes a snapshot of a given vm
ssh Grabs a single vm and sshs into it
status Prints the status of pools in the pooler service
summary Prints a summary of a pooler service
token Retrieves or deletes a token or checks token status

GLOBAL OPTIONS:

Expand All @@ -50,15 +73,15 @@ $ floaty --help

Grabbing a token for authenticated pooler requests:

```
```bash
floaty token get --user username --url https://vmpooler.example.net/api/v1
```

This command will then ask you to log in. If successful, it will return a token that you can save either in a dotfile or use with other cli commands.

Grabbing vms:

```
```bash
floaty get centos-7-x86_64=2 debian-7-x86_64 windows-10=3 --token mytokenstring --url https://vmpooler.example.net/api/v1
```

Expand All @@ -69,14 +92,24 @@ If you do not wish to continually specify various config options with the cli, y
#### Basic configuration

```yaml
# file at /Users/me/.vmfloaty.yml
# file at ~/.vmfloaty.yml
url: 'https://vmpooler.example.net/api/v1'
user: 'brian'
token: 'tokenstring'
```

Now vmfloaty will use those config files if no flag was specified.

#### Default to Puppet's ABS instead of vmpooler

```yaml
# file at ~/.vmfloaty.yml
url: 'https://abs.example.net'
user: 'brian'
token: 'tokenstring'
type: 'abs'
```

#### Configuring multiple services

Most commands allow you to specify a `--service <servicename>` option to allow the use of multiple vmpooler instances. This can be useful when you'd rather not specify a `--url` or `--token` by hand for alternate services.
Expand All @@ -103,14 +136,16 @@ services:
Examples using the above configuration:

List available vm types from our main vmpooler instance:
```sh

```bash
floaty list --service main
# or, since the first configured service is used by default:
floaty list
```

List available vm types from our alternate vmpooler instance:
```sh

```bash
floaty list --service alternate
```

Expand Down Expand Up @@ -138,28 +173,24 @@ services:

With this configuration, you could list available OS types from nspooler like this:

```sh
```bash
floaty list --service ns
```

#### Valid config keys

Here are the keys that vmfloaty currently supports:

- verbose
+ Boolean
- token
+ String
- user
+ String
- url
+ String
- services
+ Map
- verbose (Boolean)
- token (String)
- user (String)
- url (String)
- services (String)
- type (String)

### Tab Completion

There is a basic completion script for Bash (and possibly other shells) included with the gem in the [extras/completions](https://github.com/briancain/vmfloaty/blob/master/extras/completions) folder. To activate, that file simply needs to be sourced somehow in your shell profile.
There is a basic completion script for Bash (and possibly other shells) included with the gem in the [extras/completions](https://github.com/puppetlabs/vmfloaty/blob/master/extras/completions) folder. To activate, that file simply needs to be sourced somehow in your shell profile.

For convenience, the path to the completion script for the currently active version of the gem can be found with the `floaty completion` subcommand. This makes it easy to add the completion script to your profile like so:

Expand All @@ -184,6 +215,10 @@ vmfloaty providers a `Pooler` class that gives users the ability to make request
### Example Projects

- [John McCabe: vmpooler-bitbar](https://github.com/johnmccabe/vmpooler-bitbar/)
+ vmpooler status and management in your menubar with bitbar
- vmpooler status and management in your menubar with bitbar
- [Brian Cain: vagrant-vmpooler](https://github.com/briancain/vagrant-vmpooler)
+ Use Vagrant to manage your vmpooler instances
- Use Vagrant to manage your vmpooler instances

## Special thanks

Special thanks to [Brian Cain](https://github.com/briancain) as he is the original author of vmfloaty! Vast amounts of this code exist thanks to his efforts.
Binary file added float.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/vmfloaty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Vmfloaty

def run # rubocop:disable Metrics/AbcSize
program :version, Vmfloaty::VERSION
program :description, 'A CLI helper tool for Puppet Labs VM poolers to help you stay afloat'
program :description, "A CLI helper tool for Puppet's vmpooler to help you stay afloat"

config = Conf.read_config

Expand Down
12 changes: 9 additions & 3 deletions vmfloaty.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ require 'vmfloaty/version'
Gem::Specification.new do |s|
s.name = 'vmfloaty'
s.version = Vmfloaty::VERSION
s.authors = ['Brian Cain']
s.email = ['[email protected]']
s.authors = [
'Brian Cain',
'Puppet',
]
s.email = [
'[email protected]',
'[email protected]',
]
s.license = 'Apache-2.0'
s.homepage = 'https://github.com/briancain/vmfloaty'
s.homepage = 'https://github.com/puppetlabs/vmfloaty'
s.description = 'A helper tool for vmpooler to help you stay afloat'
s.summary = 'CLI application to interface with vmpooler'

Expand Down