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
- #destroy ⇒ Object
- #init(topology = nil) ⇒ Object
- #run_command(command) ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Instance Method Details
#abspath(rootfs_path) ⇒ Object
36 37 38 |
# File 'lib/dev-lxc/cli.rb', line 36 def abspath(rootfs_path) puts get_cluster([:config]).abspath(rootfs_path).join(" ") end |
#destroy ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/dev-lxc/cli.rb', line 63 def destroy cluster = get_cluster([:config]) cluster.destroy cluster.destroy_base_container(:unique) if [:unique] cluster.destroy_base_container(:shared) if [:shared] cluster.destroy_base_container(:platform) if [:platform] end |
#init(topology = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dev-lxc/cli.rb', line 17 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}.yaml") end |
#run_command(command) ⇒ Object
42 43 44 |
# File 'lib/dev-lxc/cli.rb', line 42 def run_command(command) get_cluster([:config]).run_command(command) end |
#start ⇒ Object
48 49 50 |
# File 'lib/dev-lxc/cli.rb', line 48 def start get_cluster([:config]).start end |
#status ⇒ Object
30 31 32 |
# File 'lib/dev-lxc/cli.rb', line 30 def status get_cluster([:config]).status end |
#stop ⇒ Object
54 55 56 |
# File 'lib/dev-lxc/cli.rb', line 54 def stop get_cluster([:config]).stop end |