module Openwsman
About openwsman¶ ↑
Openwsman
(www.openwsman.org) is a project intended to provide an open-source implementation of the Web Services Management specification (WS-Management) and to expose system management information on the Linux operating system using the WS-Management protocol. WS-Management is based on a suite of web services specifications and usage requirements that exposes a set of operations focused on and covers all system management aspects.
Using the bindings¶ ↑
The bindings provide access to the client-side API of openwsman. You start by creating a Client instance and set up ClientOptions to control the communication.
The Client instance now provides the WS-Management operations, like enumerate, get, invoke, etc.
All client operations return a XmlDoc representing the SOAP response from the system. # You can then use XmlDoc methods to extract SOAP elements from the response and dig down through its XmlNode and XmlAttr objects.
Public Class Methods
return endpoint-reference (EPR) prefix for given classname and namespace
-
classname
- classname (using the <schema>_<name> format) -
namespace
- optional namespace, required for Windows WMI which embeds the namespace in the EPR
Examples¶ ↑
prefix = Openwsman.epr_prefix_for "CIM_Managed_Element" => "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2" prefix = Openwsman.epr_prefix_for "Win32_Foo", "root/cimv2" => "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2"
# File openwsman/openwsman.rb, line 81 def self.epr_prefix_for classname, namespace = nil prefix = Openwsman::uri_prefix classname prefix += "/#{namespace}" if namespace && !namespace.empty? prefix end
create full endpoint reference URI for namespace and classname
-
classname
- classname (using the <schema>_<name> format) -
namespace
- optional namespace, required for Windows WMI which embeds the namespace in the EPR
Examples¶ ↑
Openwsman.epr_uri_for "root/cimv2", "Win32_Foo" => "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Foo"
# File openwsman/openwsman.rb, line 95 def self.epr_uri_for namespace, classname raise "Namespace must not be nil" unless namespace raise "Classname must not be nil" unless classname epr = epr_prefix_for(classname,namespace) + "/#{classname}" end