skeleton to wrap rwbem
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 19 Nov 2007 08:30:20 +0000 (09:30 +0100)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 19 Nov 2007 08:30:20 +0000 (09:30 +0100)
examples/test-rwbem.rb [new file with mode: 0644]
lib/powercim.rb [new file with mode: 0644]

diff --git a/examples/test-rwbem.rb b/examples/test-rwbem.rb
new file mode 100644 (file)
index 0000000..0a5c187
--- /dev/null
@@ -0,0 +1,51 @@
+require 'rubygems'
+require 'wbem'
+
+require 'pp'
+
+include WBEM
+
+#module WBEM
+#  class CIMClass
+#    def instances
+
+module PowerCIM
+
+  class Factory
+    # initialize a factory
+    def initialize(*args)
+      @conn = WBEM::WBEMConnection.new(args)
+    end
+  end
+
+  class CIMClass
+    def initialize()
+
+    end
+
+  end
+
+end
+
+
+cliconn = WBEM::WBEMConnection.new('http://localhost', 'foo')
+pp cliconn.methods
+
+# classes = cliconn.EnumerateClassNames
+# classes.each do |c|
+#   puts c
+# end
+
+#fileclass = cliconn.GetClass('CIM_UnixFile')
+#pp fileclass.class
+#pp fileclass.methods
+
+#exit
+
+instances = cliconn.EnumerateInstances('CIM_UnixFile')
+instances.each do |instance|
+  #pp instance
+  instance.properties.each do |p|
+    puts p
+  end
+end
diff --git a/lib/powercim.rb b/lib/powercim.rb
new file mode 100644 (file)
index 0000000..88805e6
--- /dev/null
@@ -0,0 +1,13 @@
+require 'wbem'
+
+module PowerCIM
+
+  class Factory
+    # initialize a factory
+    def initialize(*args)
+      @conn = WBEM::WBEMConnection.new(args)
+    end
+
+  end
+
+end
\ No newline at end of file