Class: VagrantPlugins::Skytap::Connection::Execution
- Defined in:
- lib/vagrant-skytap/connection.rb
Overview
An Execution implements a strategy for establishing a connection to the guest VM using a given resource. A resource may have more than one strategy, depending on the initial state of the connection. (When the guest VM is first created, no connection will exist.)
Direct Known Subclasses
PublicIpChoice::PublicIpAttachmentExecution, PublishedServiceChoice::PublishedServiceExecution, TunnelChoice::TunnelExecution, VpnChoice::VPNAttachmentExecution
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#iface ⇒ Object
readonly
Returns the value of attribute iface.
Instance Method Summary collapse
-
#execute ⇒ Object
Performs the API calls which establish the connection for communicating with the guest VM.
-
#initialize(*args) ⇒ Execution
constructor
A new instance of Execution.
-
#make(*args) ⇒ Connection::Execution
Creates an execution object which will perform the correct actions to establish a connection via a specific connectable resource.
-
#message ⇒ String
The description of the actions to be taken when this choice is executed, e.g.
-
#verb ⇒ String
The name of the action(s) performed by this execution subclass, e.g.
Constructor Details
#initialize(*args) ⇒ Execution
Returns a new instance of Execution.
81 82 83 |
# File 'lib/vagrant-skytap/connection.rb', line 81 def initialize(*args) @env, @iface, _ = args end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
79 80 81 |
# File 'lib/vagrant-skytap/connection.rb', line 79 def env @env end |
#iface ⇒ Object (readonly)
Returns the value of attribute iface.
79 80 81 |
# File 'lib/vagrant-skytap/connection.rb', line 79 def iface @iface end |
Instance Method Details
#execute ⇒ Object
Performs the API calls which establish the connection for communicating with the guest VM. If the connection is already established, as in the case of a guest VM which already exists, this may be a no-op.
101 102 103 |
# File 'lib/vagrant-skytap/connection.rb', line 101 def execute raise NotImplementedError.new('Must override') end |
#make(*args) ⇒ Connection::Execution
Creates an execution object which will perform the correct actions to establish a connection via a specific connectable resource. This method should be overridden to return an object of the correct execution subclass given the resource’s initial state. For example, if the guest’s network is already attached to this VPN, but disconnected, this method would return a ConnectAndUseExecution.
93 94 95 |
# File 'lib/vagrant-skytap/connection.rb', line 93 def make(*args) raise NotImplementedError.new('Must override') end |
#message ⇒ String
The description of the actions to be taken when this choice is executed, e.g. “Connect to and use VPN 1”.
117 118 119 |
# File 'lib/vagrant-skytap/connection.rb', line 117 def verb end |
#verb ⇒ String
The name of the action(s) performed by this execution subclass, e.g. “Connect and use”.
109 110 111 |
# File 'lib/vagrant-skytap/connection.rb', line 109 def verb raise NotImplementedError.new('Must override') end |