Module: VCloudTransitionHelper

Included in:
ScriptExecutionState
Defined in:
lib/help/v_cloud_transition_helper.rb

Overview

Contains methods that are used by the scripts in the state-machines. Since they are reused by different scripts, they are factored into this module

Instance Method Summary collapse

Instance Method Details

#retrieve_ip_servicesObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/help/v_cloud_transition_helper.rb', line 7

def retrieve_ip_services
  @context[:vcloud_internet_services] = []
  vcloud_api_handler.
  vcloud_api_handler.org
  vcloud_api_handler.vdc
  res = vcloud_api_handler.internet_services
  puts "retrieved: #{res.inspect}"
  res['InternetService'].each() {|is|
    port = is['Port'].first.to_i
    ip = is['PublicIpAddress'].first['Name'].first #TODO: several IPs may be defined here?
    id = is['PublicIpAddress'].first['Id'].first
    @context[:vcloud_internet_services] << {:port => port, :ip => ip, :id => id}
  }
end