Class: DevLXC::CLI::Cluster
- Inherits:
-
Thor
- Object
- Thor
- DevLXC::CLI::Cluster
- Defined in:
- lib/dev-lxc/cli.rb
Instance Method Summary collapse
- #abspath(rootfs_path) ⇒ Object
- #chef_repo ⇒ Object
- #destroy ⇒ Object
- #init(topology = nil) ⇒ Object
- #run_command(command) ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Instance Method Details
#abspath(rootfs_path) ⇒ Object
37 38 39 |
# File 'lib/dev-lxc/cli.rb', line 37 def abspath(rootfs_path) puts get_cluster([:config]).abspath(rootfs_path).join(" ") end |
#chef_repo ⇒ Object
43 44 45 |
# File 'lib/dev-lxc/cli.rb', line 43 def chef_repo get_cluster([:config]).chef_repo end |
#destroy ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/dev-lxc/cli.rb', line 70 def destroy cluster = get_cluster([:config]) cluster.destroy cluster.destroy_container(:unique) if [:unique] cluster.destroy_container(:shared) if [:shared] cluster.destroy_container(:platform) if [:platform] end |
#init(topology = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dev-lxc/cli.rb', line 18 def init(topology=nil) topologies = %w(open-source standalone tier) if topology.nil? || ! topologies.include?(topology) topologies_with_index = topologies.map.with_index{ |a, i| [i+1, *a]} print_table topologies_with_index selection = ask("Which cluster topology do you want to use?", :limited_to => topologies_with_index.map{|c| c[0].to_s}) topology = topologies[selection.to_i - 1] end puts IO.read("#{File.dirname(__FILE__)}/../../files/configs/#{topology}.yml") end |
#run_command(command) ⇒ Object
49 50 51 |
# File 'lib/dev-lxc/cli.rb', line 49 def run_command(command) get_cluster([:config]).run_command(command) end |
#start ⇒ Object
55 56 57 |
# File 'lib/dev-lxc/cli.rb', line 55 def start get_cluster([:config]).start end |
#status ⇒ Object
31 32 33 |
# File 'lib/dev-lxc/cli.rb', line 31 def status get_cluster([:config]).status end |
#stop ⇒ Object
61 62 63 |
# File 'lib/dev-lxc/cli.rb', line 61 def stop get_cluster([:config]).stop end |