Class: RbVmomi::VIM::EsxcliCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/HostSystem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ns, type_info) ⇒ EsxcliCommand

Returns a new instance of EsxcliCommand.



152
153
154
155
156
# File 'lib/rbvmomi/vim/HostSystem.rb', line 152

def initialize ns, type_info
  @ns = ns
  @type_info = type_info
  @cached_cli_info = nil
end

Instance Attribute Details

#cli_infoObject (readonly)

Returns the value of attribute cli_info.



150
151
152
# File 'lib/rbvmomi/vim/HostSystem.rb', line 150

def cli_info
  @cli_info
end

#nsObject (readonly)

Returns the value of attribute ns.



150
151
152
# File 'lib/rbvmomi/vim/HostSystem.rb', line 150

def ns
  @ns
end

#type_infoObject (readonly)

Returns the value of attribute type_info.



150
151
152
# File 'lib/rbvmomi/vim/HostSystem.rb', line 150

def type_info
  @type_info
end

Instance Method Details

#call(args = {}) ⇒ Object



166
167
168
169
170
171
172
173
174
# File 'lib/rbvmomi/vim/HostSystem.rb', line 166

def call args={}
  if @ns.host.direct?
    @ns.obj._call @type_info.wsdlName, args
  else
    real_args = Set.new(type_info.paramTypeInfo.map(&:name))
    args = args.reject { |k,v| !real_args.member?(k.to_s) }
    @ns.host.mme.execute(@ns.obj._ref, "#{@ns.type_name}.#{@type_info.name}", args)
  end
end

#nameObject



158
159
160
# File 'lib/rbvmomi/vim/HostSystem.rb', line 158

def name
  @type_info.name
end