Module: VagrantPlugins::NiftyCloud::Action
- Includes:
- Vagrant::Action::Builtin
- Defined in:
- lib/vagrant-niftycloud/action.rb,
lib/vagrant-niftycloud/action/is_created.rb,
lib/vagrant-niftycloud/action/read_state.rb,
lib/vagrant-niftycloud/action/run_instance.rb,
lib/vagrant-niftycloud/action/sync_folders.rb,
lib/vagrant-niftycloud/action/read_ssh_info.rb,
lib/vagrant-niftycloud/action/resume_instance.rb,
lib/vagrant-niftycloud/action/timed_provision.rb,
lib/vagrant-niftycloud/action/suspend_instance.rb,
lib/vagrant-niftycloud/action/connect_niftycloud.rb,
lib/vagrant-niftycloud/action/terminate_instance.rb,
lib/vagrant-niftycloud/action/message_not_created.rb,
lib/vagrant-niftycloud/action/message_already_created.rb,
lib/vagrant-niftycloud/action/message_will_not_destroy.rb
Defined Under Namespace
Classes: ConnectNiftyCloud, IsCreated, MessageAlreadyCreated, MessageNotCreated, MessageWillNotDestroy, ReadSSHInfo, ReadState, ResumeInstance, RunInstance, SuspendInstance, SyncFolders, TerminateInstance, TimedProvision
Class Method Summary collapse
-
.action_destroy ⇒ Object
This action is called to terminate the remote machine.
-
.action_halt ⇒ Object
This action is called to halt the remote machine.
-
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
-
.action_read_ssh_info ⇒ Object
This action is called to read the SSH info of the machine.
-
.action_read_state ⇒ Object
This action is called to read the state of the machine.
-
.action_resume ⇒ Object
This action is called to resume the remote machine.
-
.action_ssh ⇒ Object
This action is called to SSH into the machine.
- .action_ssh_run ⇒ Object
-
.action_suspend ⇒ Object
This action is called to suspend the remote machine.
-
.action_up ⇒ Object
This action is called to bring the box up from nothing.
Class Method Details
.action_destroy ⇒ Object
This action is called to terminate the remote machine.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant-niftycloud/action.rb', line 12 def self.action_destroy Vagrant::Action::Builder.new.tap do |b| b.use Call, DestroyConfirm do |env, b2| if env[:result] b2.use ConfigValidate b2.use ConnectNiftyCloud b2.use TerminateInstance else b2.use MessageWillNotDestroy end end end end |
.action_halt ⇒ Object
This action is called to halt the remote machine.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/vagrant-niftycloud/action.rb', line 129 def self.action_halt Vagrant::Action::Builder.new.tap do |b| b.use Call, IsCreated do |env, b2| if env[:result] b2.use ConfigValidate b2.use ConnectNiftyCloud b2.use SuspendInstance else b2.use MessageNotCreated next end end end end |
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vagrant-niftycloud/action.rb', line 27 def self.action_provision Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotCreated next end b2.use Provision b2.use SyncFolders end end end |
.action_read_ssh_info ⇒ Object
This action is called to read the SSH info of the machine. The resulting state is expected to be put into the ‘:machine_ssh_info` key.
45 46 47 48 49 50 51 |
# File 'lib/vagrant-niftycloud/action.rb', line 45 def self.action_read_ssh_info Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use ConnectNiftyCloud b.use ReadSSHInfo end end |
.action_read_state ⇒ Object
This action is called to read the state of the machine. The resulting state is expected to be put into the ‘:machine_state_id` key.
56 57 58 59 60 61 62 |
# File 'lib/vagrant-niftycloud/action.rb', line 56 def self.action_read_state Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use ConnectNiftyCloud b.use ReadState end end |
.action_resume ⇒ Object
This action is called to resume the remote machine.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/vagrant-niftycloud/action.rb', line 145 def self.action_resume Vagrant::Action::Builder.new.tap do |b| b.use Call, IsCreated do |env, b2| if env[:result] b2.use ConfigValidate b2.use ConnectNiftyCloud b2.use ResumeInstance else b2.use MessageNotCreated next end end end end |
.action_ssh ⇒ Object
This action is called to SSH into the machine.
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/vagrant-niftycloud/action.rb', line 65 def self.action_ssh Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotCreated next end b2.use SSHExec end end end |
.action_ssh_run ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/vagrant-niftycloud/action.rb', line 79 def self.action_ssh_run Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotCreated next end b2.use SSHRun end end end |
.action_suspend ⇒ Object
This action is called to suspend the remote machine.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/vagrant-niftycloud/action.rb', line 113 def self.action_suspend Vagrant::Action::Builder.new.tap do |b| b.use Call, IsCreated do |env, b2| if env[:result] b2.use ConfigValidate b2.use ConnectNiftyCloud b2.use SuspendInstance else b2.use MessageNotCreated next end end end end |
.action_up ⇒ Object
This action is called to bring the box up from nothing.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/vagrant-niftycloud/action.rb', line 94 def self.action_up Vagrant::Action::Builder.new.tap do |b| b.use HandleBoxUrl b.use ConfigValidate b.use ConnectNiftyCloud b.use Call, IsCreated do |env, b2| if env[:result] b2.use MessageAlreadyCreated next end b2.use TimedProvision b2.use SyncFolders b2.use RunInstance end end end |