Class: WinRM::WSMV::WqlPull

Inherits:
Base
  • Object
show all
Defined in:
lib/winrm/wsmv/wql_pull.rb

Overview

WSMV message to 'pull' rest of enumeration results from Windows via WQL

Constant Summary

Constants included from Header

Header::RESOURCE_URI_CMD, Header::RESOURCE_URI_POWERSHELL

Constants included from SOAP

SOAP::NS_ADDRESSING, SOAP::NS_CIMBINDING, SOAP::NS_ENUM, SOAP::NS_SCHEMA_INST, SOAP::NS_SOAP_ENV, SOAP::NS_TRANSFER, SOAP::NS_WIN_SHELL, SOAP::NS_WSMAN_CONF, SOAP::NS_WSMAN_DMTF, SOAP::NS_WSMAN_FAULT, SOAP::NS_WSMAN_MSFT

Instance Method Summary collapse

Methods inherited from Base

#build

Methods included from Header

#action_command, #action_delete, #action_enumerate, #action_enumerate_pull, #action_get, #action_receive, #action_send, #action_signal, #merge_headers, #resource_uri_cmd, #resource_uri_shell, #resource_uri_wmi, #selector_shell_id, #shared_headers

Methods included from SOAP

#namespaces

Constructor Details

#initialize(session_opts, namespace, enumeration_context) ⇒ WqlPull

Returns a new instance of WqlPull.


8
9
10
11
12
# File 'lib/winrm/wsmv/wql_pull.rb', line 8

def initialize(session_opts, namespace, enumeration_context)
  @session_opts = session_opts
  @namespace = namespace
  @enumeration_context = enumeration_context
end

Instance Method Details

#process_response(response) ⇒ Object


14
15
16
17
18
19
20
21
22
# File 'lib/winrm/wsmv/wql_pull.rb', line 14

def process_response(response)
  parser = Nori.new(
    parser: :rexml,
    advanced_typecasting: false,
    convert_tags_to: ->(tag) { tag.snakecase.to_sym },
    strip_namespaces: true
  )
  parser.parse(response.to_s)[:envelope][:body]
end