mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-25 21:28:40 -05:00
Update CLI options
This commit is contained in:
parent
99b03e2994
commit
51193ab4a6
4 changed files with 55 additions and 14 deletions
14
README.md
14
README.md
|
|
@ -1,2 +1,16 @@
|
|||
vmfloaty
|
||||
========
|
||||
|
||||
A CLI helper tool for Puppet Labs vmpooler to help you stay afloat.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
gem install vmfloaty
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
TODO
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
||||
|
||||
require 'vmfloaty/cli'
|
||||
require 'vmfloaty'
|
||||
|
||||
Vmfloaty.new(ENV).start
|
||||
|
|
|
|||
|
|
@ -1 +1,16 @@
|
|||
require 'vmfloaty/cli'
|
||||
|
||||
class Vmfloaty
|
||||
|
||||
def initialize(env)
|
||||
@vmpooler_url = env['VMPOOLER_URL']
|
||||
|
||||
unless @vmpooler_url
|
||||
@vmpooler_url = 'http://vcloud.delivery.puppetlabs.net/vm'
|
||||
end
|
||||
end
|
||||
|
||||
def start
|
||||
CLI.start(ARGV)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,25 +1,35 @@
|
|||
require 'thor'
|
||||
require 'net/http'
|
||||
|
||||
class CLI < Thor
|
||||
desc "get", "Gets a vm"
|
||||
def get
|
||||
say 'Get a vm here'
|
||||
desc "get [operating system,...] [--withpe]", "Gets a VM"
|
||||
option :withpe
|
||||
def get(os)
|
||||
say "vmpooler: #{@vmpooler_url}"
|
||||
if options[:withpe]
|
||||
say "Get a #{os} VM here and provision with PE verison #{options[:withpe]}"
|
||||
else
|
||||
say "Get a #{os} VM here"
|
||||
end
|
||||
end
|
||||
|
||||
desc "modify", "Modify a vm"
|
||||
def modify
|
||||
desc "modify [hostname]", "Modify a VM"
|
||||
def modify(hostname)
|
||||
say 'Modify a vm'
|
||||
end
|
||||
|
||||
desc "list", "List all active vms"
|
||||
desc "status", "List status of all active VMs"
|
||||
def status
|
||||
say 'List of active VMs'
|
||||
end
|
||||
|
||||
desc "list", "List all open VMs"
|
||||
def list
|
||||
say 'Listing your vms'
|
||||
say 'Listing open vms on vmpooler'
|
||||
end
|
||||
|
||||
desc "release", "Schedules a vm for deletion"
|
||||
def release
|
||||
say 'Releases a vm'
|
||||
desc "release [hostname]", "Schedules a VM for deletion"
|
||||
def release(hostname)
|
||||
say 'Releases a VM'
|
||||
end
|
||||
end
|
||||
|
||||
CLI.start(ARGV)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue