class WinRM::WSMV::CleanupCommand
WSMV
message to execute a command inside a remote shell
Public Class Methods
Source
# File lib/winrm/wsmv/cleanup_command.rb, line 21 def initialize(session_opts, opts) raise 'opts[:shell_id] is required' unless opts[:shell_id] raise 'opts[:command_id] is required' unless opts[:command_id] @session_opts = session_opts @shell_id = opts[:shell_id] @command_id = opts[:command_id] @shell_uri = opts[:shell_uri] || RESOURCE_URI_CMD end
Protected Instance Methods
Source
# File lib/winrm/wsmv/cleanup_command.rb, line 37 def create_body(body) body.tag!("#{NS_WIN_SHELL}:Signal", 'CommandId' => @command_id) do |cl| cl << Gyoku.xml(cleanup_body) end end
Source
# File lib/winrm/wsmv/cleanup_command.rb, line 33 def create_header(header) header << Gyoku.xml(cleanup_header) end
Private Instance Methods
Source
# File lib/winrm/wsmv/cleanup_command.rb, line 52 def cleanup_body { "#{NS_WIN_SHELL}:Code" => 'http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate' } end
Source
# File lib/winrm/wsmv/cleanup_command.rb, line 45 def cleanup_header merge_headers(shared_headers(@session_opts), resource_uri_shell(@shell_uri), action_signal, selector_shell_id(@shell_id)) end