mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05: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
|
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
|
#!/usr/bin/env ruby
|
||||||
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
||||||
|
|
||||||
require 'vmfloaty/cli'
|
require 'vmfloaty'
|
||||||
|
|
||||||
|
Vmfloaty.new(ENV).start
|
||||||
|
|
|
||||||
|
|
@ -1 +1,16 @@
|
||||||
require 'vmfloaty/cli'
|
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 'thor'
|
||||||
|
require 'net/http'
|
||||||
|
|
||||||
class CLI < Thor
|
class CLI < Thor
|
||||||
desc "get", "Gets a vm"
|
desc "get [operating system,...] [--withpe]", "Gets a VM"
|
||||||
def get
|
option :withpe
|
||||||
say 'Get a vm here'
|
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
|
end
|
||||||
|
|
||||||
desc "modify", "Modify a vm"
|
desc "modify [hostname]", "Modify a VM"
|
||||||
def modify
|
def modify(hostname)
|
||||||
say 'Modify a vm'
|
say 'Modify a vm'
|
||||||
end
|
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
|
def list
|
||||||
say 'Listing your vms'
|
say 'Listing open vms on vmpooler'
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "release", "Schedules a vm for deletion"
|
desc "release [hostname]", "Schedules a VM for deletion"
|
||||||
def release
|
def release(hostname)
|
||||||
say 'Releases a vm'
|
say 'Releases a VM'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
CLI.start(ARGV)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue