Class: VagrantPlugins::VSphere::Action::GetState

Inherits:
Object
  • Object
show all
Includes:
Util::VimHelpers, Util::VmHelpers
Defined in:
lib/vSphere/action/get_state.rb

Instance Method Summary collapse

Methods included from Util::VmHelpers

#get_vm_state, #power_off_vm, #power_on_vm, #powered_off?, #powered_on?, #suspended?

Methods included from Util::VimHelpers

#find_clustercompute_or_compute_resource, #get_compute_resource, #get_customization_spec_info_by_name, #get_datacenter, #get_datastore, #get_network_by_name, #get_resource_pool, #get_vm_by_uuid

Constructor Details

#initialize(app, _env) ⇒ GetState

Returns a new instance of GetState.



12
13
14
# File 'lib/vSphere/action/get_state.rb', line 12

def initialize(app, _env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
# File 'lib/vSphere/action/get_state.rb', line 16

def call(env)
  env[:machine_state_id] = get_state(env[:vSphere_connection], env[:machine])

  @app.call env
end