Sha256: a3fa8464faed67194ba2bf0c7e0a50692242c5c77717f3cebd81d313d3a5e4e5

Contents?: true

Size: 696 Bytes

Versions: 6

Compression:

Stored size: 696 Bytes

Contents

require 'rbvmomi'

module Vmesh
  class CustomSpec
    attr_accessor :ip_address, :spec
    def initialize(spec)
      @spec = spec
    end

    def self.get(custom_spec_manager, name)
      Vmesh::logger.debug "Looking for spec #{name}"
      spec = custom_spec_manager.GetCustomizationSpec(:name => name).spec or raise "unable to find the custom spec #{name}."
      CustomSpec.new(spec)
    end

    def destination_ip_address=(ip)
      Vmesh::logger.debug "Setting spec ip address to #{ip}"
      @spec.nicSettingMap.first.adapter.ip = RbVmomi::VIM::CustomizationFixedIp("ipAddress" => ip)
    end

    def destination_ip_address
      @spec.nicSettingMap.first.adapter.ip
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vmesh-0.1.11 lib/vmesh/custom_spec.rb
vmesh-0.1.7 lib/vmesh/custom_spec.rb
vmesh-0.1.6 lib/vmesh/custom_spec.rb
vmesh-0.1.5 lib/vmesh/custom_spec.rb
vmesh-0.1.4 lib/vmesh/custom_spec.rb
vmesh-0.1.3 lib/vmesh/custom_spec.rb