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


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

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


147
148
149
# File 'lib/rbvmomi/vim/HostSystem.rb', line 147

def cli_info
  @cli_info
end

#nsObject (readonly)

Returns the value of attribute ns


147
148
149
# File 'lib/rbvmomi/vim/HostSystem.rb', line 147

def ns
  @ns
end

#type_infoObject (readonly)

Returns the value of attribute type_info


147
148
149
# File 'lib/rbvmomi/vim/HostSystem.rb', line 147

def type_info
  @type_info
end

Instance Method Details

#call(args = {}) ⇒ Object


163
164
165
166
167
168
169
170
171
# File 'lib/rbvmomi/vim/HostSystem.rb', line 163

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


155
156
157
# File 'lib/rbvmomi/vim/HostSystem.rb', line 155

def name
  @type_info.name
end