Class: Mccloud::Provider::Script::Provider
- Inherits:
-
Core::Provider
- Object
- Core::Provider
- Mccloud::Provider::Script::Provider
- Defined in:
- lib/mccloud/provider/script/provider.rb
Instance Attribute Summary collapse
-
#flavor ⇒ Object
Returns the value of attribute flavor.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#script_dir ⇒ Object
Returns the value of attribute script_dir.
-
#variables ⇒ Object
Returns the value of attribute variables.
-
#vms ⇒ Object
Returns the value of attribute vms.
Attributes inherited from Core::Provider
Instance Method Summary collapse
- #bootstrap(selection, script, options) ⇒ Object
- #destroy(selection, options) ⇒ Object
- #halt(selection, options) ⇒ Object
-
#initialize(name, options, env) ⇒ Provider
constructor
A new instance of Provider.
- #provision(selection, options) ⇒ Object
- #ssh(selection, command, options) ⇒ Object
- #status(selection, options) ⇒ Object
- #up(selection, options) ⇒ Object
Methods inherited from Core::Provider
#check_gem_availability, #filter, #get_component, #hosts, #method_missing, #on_selected_components
Constructor Details
#initialize(name, options, env) ⇒ Provider
Returns a new instance of Provider.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mccloud/provider/script/provider.rb', line 23 def initialize(name,,env) super(name,,env) @vms=Hash.new @variables=Hash.new @options= @flavor=self.class.to_s.split("::")[-2] @name=name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mccloud::Provider::Core::Provider
Instance Attribute Details
#flavor ⇒ Object
Returns the value of attribute flavor.
11 12 13 |
# File 'lib/mccloud/provider/script/provider.rb', line 11 def flavor @flavor end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/mccloud/provider/script/provider.rb', line 10 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
13 14 15 |
# File 'lib/mccloud/provider/script/provider.rb', line 13 def @options end |
#script_dir ⇒ Object
Returns the value of attribute script_dir.
17 18 19 |
# File 'lib/mccloud/provider/script/provider.rb', line 17 def script_dir @script_dir end |
#variables ⇒ Object
Returns the value of attribute variables.
18 19 20 |
# File 'lib/mccloud/provider/script/provider.rb', line 18 def variables @variables end |
#vms ⇒ Object
Returns the value of attribute vms.
15 16 17 |
# File 'lib/mccloud/provider/script/provider.rb', line 15 def vms @vms end |
Instance Method Details
#bootstrap(selection, script, options) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/mccloud/provider/script/provider.rb', line 51 def bootstrap(selection,script,) on_selected_components("vm",selection) do |id,vm| script_exec("bootstrap.sh",vm,) end end |
#destroy(selection, options) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/mccloud/provider/script/provider.rb', line 58 def destroy(selection,) on_selected_components("vm",selection) do |id,vm| script_exec("destroy.sh",vm,) end end |
#halt(selection, options) ⇒ Object
82 83 84 85 86 87 |
# File 'lib/mccloud/provider/script/provider.rb', line 82 def halt(selection,) on_selected_components("vm",selection) do |id,vm| script_exec("halt.sh",vm,) end end |
#provision(selection, options) ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/mccloud/provider/script/provider.rb', line 74 def provision(selection,) on_selected_components("vm",selection) do |id,vm| script_exec("provision.sh",vm,) end end |
#ssh(selection, command, options) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/mccloud/provider/script/provider.rb', line 66 def ssh(selection,command,) on_selected_components("vm",selection) do |id,vm| script_exec("ssh.sh",vm,) end end |
#status(selection, options) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/mccloud/provider/script/provider.rb', line 41 def status(selection,) unless selection.nil? on_selected_components("vm",selection) do |id,vm| script_exec("status.sh",vm,) end else script_exec("status.sh",nil,) end end |
#up(selection, options) ⇒ Object
35 36 37 38 39 |
# File 'lib/mccloud/provider/script/provider.rb', line 35 def up(selection,) on_selected_components("vm",selection) do |id,vm| script_exec("up.sh",vm,) end end |