Skip to content

Commit 2de284f

Browse files
authored
Merge pull request #69 from puppetlabs/docs-update
Update docs
2 parents b7a210a + 28fb929 commit 2de284f

File tree

6 files changed

+94
-46
lines changed

6 files changed

+94
-46
lines changed

.github/PULL_REQUEST_TEMPLATE

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ FIXME
1717

1818
## Reviewers
1919

20+
@puppetlabs/dio
2021
@highb
2122
@briancain

CODEOWNERS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Set Puppet's DIO team as the default code owner
2+
* @puppetlabs/dio
3+
4+
# External code owners
5+
* @briancain
6+
* @highb

README.md

+77-42
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,61 @@
1-
vmfloaty
2-
========
1+
# vmfloaty
32

4-
[![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)
3+
[![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)
54

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

8-
<img src="http://i.imgur.com/xGcGwuH.jpg" width=200 height=200>
7+
![float image](float.jpg)
8+
9+
- [Install](#install)
10+
- [Usage](#usage)
11+
- [Example workflow](#example-workflow)
12+
- [vmfloaty dotfile](#vmfloaty-dotfile)
13+
- [Basic configuration](#basic-configuration)
14+
- [Default to Puppet's ABS instead of vmpooler](#default-to-puppets-abs-instead-of-vmpooler)
15+
- [Configuring multiple services](#configuring-multiple-services)
16+
- [Using a Nonstandard Pooler service](#using-a-nonstandard-pooler-service)
17+
- [Valid config keys](#valid-config-keys)
18+
- [Tab Completion](#tab-completion)
19+
- [vmpooler API](#vmpooler-api)
20+
- [Using the Pooler class](#using-the-pooler-class)
21+
- [Example Projects](#example-projects)
22+
- [Special thanks](#special-thanks)
923

1024
## Install
1125

1226
Grab the latest from ruby gems...
1327

14-
```
15-
$ gem install vmfloaty
16-
...
17-
...
18-
$ floaty --help
28+
```bash
29+
gem install vmfloaty
1930
```
2031

2132
## Usage
2233

23-
```
24-
delete Schedules the deletion of a host or hosts
25-
get Gets a vm or vms based on the os argument
26-
help Display global or [command] help documentation
27-
list Shows a list of available vms from the pooler or vms obtained with a token
28-
modify Modify a vms tags, time to live, and disk space
29-
query Get information about a given vm
30-
revert Reverts a vm to a specified snapshot
31-
snapshot Takes a snapshot of a given vm
32-
ssh Grabs a single vm and sshs into it
33-
status Prints the status of pools in vmpooler
34-
summary Prints a summary of vmpooler
35-
token Retrieves or deletes a token or checks token status
34+
```plain
35+
$ floaty --help
36+
NAME:
37+
38+
floaty
39+
40+
DESCRIPTION:
41+
42+
A CLI helper tool for Puppet's vmpooler to help you stay afloat
43+
44+
COMMANDS:
45+
46+
completion Outputs path to completion script
47+
delete Schedules the deletion of a host or hosts
48+
get Gets a vm or vms based on the os argument
49+
help Display global or [command] help documentation
50+
list Shows a list of available vms from the pooler or vms obtained with a token
51+
modify Modify a VM's tags, time to live, disk space, or reservation reason
52+
query Get information about a given vm
53+
revert Reverts a vm to a specified snapshot
54+
snapshot Takes a snapshot of a given vm
55+
ssh Grabs a single vm and sshs into it
56+
status Prints the status of pools in the pooler service
57+
summary Prints a summary of a pooler service
58+
token Retrieves or deletes a token or checks token status
3659
3760
GLOBAL OPTIONS:
3861
@@ -50,15 +73,15 @@ $ floaty --help
5073

5174
Grabbing a token for authenticated pooler requests:
5275

53-
```
76+
```bash
5477
floaty token get --user username --url https://vmpooler.example.net/api/v1
5578
```
5679

5780
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.
5881

5982
Grabbing vms:
6083

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

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

7194
```yaml
72-
# file at /Users/me/.vmfloaty.yml
95+
# file at ~/.vmfloaty.yml
7396
url: 'https://vmpooler.example.net/api/v1'
7497
user: 'brian'
7598
token: 'tokenstring'
7699
```
77100
78101
Now vmfloaty will use those config files if no flag was specified.
79102
103+
#### Default to Puppet's ABS instead of vmpooler
104+
105+
```yaml
106+
# file at ~/.vmfloaty.yml
107+
url: 'https://abs.example.net'
108+
user: 'brian'
109+
token: 'tokenstring'
110+
type: 'abs'
111+
```
112+
80113
#### Configuring multiple services
81114
82115
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.
@@ -103,14 +136,16 @@ services:
103136
Examples using the above configuration:
104137

105138
List available vm types from our main vmpooler instance:
106-
```sh
139+
140+
```bash
107141
floaty list --service main
108142
# or, since the first configured service is used by default:
109143
floaty list
110144
```
111145

112146
List available vm types from our alternate vmpooler instance:
113-
```sh
147+
148+
```bash
114149
floaty list --service alternate
115150
```
116151

@@ -138,28 +173,24 @@ services:
138173

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

141-
```sh
176+
```bash
142177
floaty list --service ns
143178
```
144179

145180
#### Valid config keys
146181

147182
Here are the keys that vmfloaty currently supports:
148183

149-
- verbose
150-
+ Boolean
151-
- token
152-
+ String
153-
- user
154-
+ String
155-
- url
156-
+ String
157-
- services
158-
+ Map
184+
- verbose (Boolean)
185+
- token (String)
186+
- user (String)
187+
- url (String)
188+
- services (String)
189+
- type (String)
159190

160191
### Tab Completion
161192

162-
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.
193+
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.
163194

164195
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:
165196

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

186217
- [John McCabe: vmpooler-bitbar](https://github.com/johnmccabe/vmpooler-bitbar/)
187-
+ vmpooler status and management in your menubar with bitbar
218+
- vmpooler status and management in your menubar with bitbar
188219
- [Brian Cain: vagrant-vmpooler](https://github.com/briancain/vagrant-vmpooler)
189-
+ Use Vagrant to manage your vmpooler instances
220+
- Use Vagrant to manage your vmpooler instances
221+
222+
## Special thanks
223+
224+
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.

float.jpg

11.1 KB
Loading

lib/vmfloaty.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Vmfloaty
1919

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

2424
config = Conf.read_config
2525

vmfloaty.gemspec

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ require 'vmfloaty/version'
66
Gem::Specification.new do |s|
77
s.name = 'vmfloaty'
88
s.version = Vmfloaty::VERSION
9-
s.authors = ['Brian Cain']
10-
s.email = ['[email protected]']
9+
s.authors = [
10+
'Brian Cain',
11+
'Puppet',
12+
]
13+
s.email = [
14+
15+
16+
]
1117
s.license = 'Apache-2.0'
12-
s.homepage = 'https://github.com/briancain/vmfloaty'
18+
s.homepage = 'https://github.com/puppetlabs/vmfloaty'
1319
s.description = 'A helper tool for vmpooler to help you stay afloat'
1420
s.summary = 'CLI application to interface with vmpooler'
1521

0 commit comments

Comments
 (0)