Sha256: cadde8ba450b3539781688200a0f95c6efcde468fb9b8720fa8e726c3601f0b4
Contents?: true
Size: 1.01 KB
Versions: 23
Compression:
Stored size: 1.01 KB
Contents
module Fog module Vsphere class Compute class Real def list_processes(vm_id, opts) vm = get_vm_ref(vm_id) auth = RbVmomi::VIM::NamePasswordAuthentication( username: opts[:user], password: opts[:password], interactiveSession: false ) p_manager = connection.serviceContent.guestOperationsManager.processManager processes = p_manager.ListProcessesInGuest(vm: vm, auth: auth) processes.map do |pi| Process.new( cmd_line: pi.cmdLine, end_time: pi.endTime, exit_code: pi.exitCode, name: pi.name, owner: pi.owner, pid: pi.pid, start_time: pi.startTime ) end end end class Mock def list_processes(_vm_id, _opts = {}) [ Process.new(name: 'winlogon'), Process.new(name: 'init') ] end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems