Module: Openwsman

Defined in:
lib/openwsman/version.rb,
lib/openwsman/xmldoc.rb,
lib/openwsman/xmlnode.rb,
lib/openwsman/openwsman.rb

Overview

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.

Defined Under Namespace

Classes: ClientOptions, EndPointReference, Fault, Transport, XmlDoc, XmlNode

Constant Summary collapse

OPENWSMAN_RUBY_VERSION =
"2.2"
SYSTEM_RUBY_VERSION =
"#{RbConfig::CONFIG['MAJOR']}.#{RbConfig::CONFIG['MINOR']}"

Class Method Summary collapse

Class Method Details

.epr_prefix_for(classname, namespace = nil) ⇒ Object

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"


81
82
83
84
85
# File 'lib/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

.epr_uri_for(namespace, classname) ⇒ Object

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"


95
96
97
98
99
# File 'lib/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