diff options
Diffstat (limited to 'examples/cpp')
-rw-r--r-- | examples/cpp/GetInstance.cpp | 16 | ||||
-rw-r--r-- | examples/cpp/Makefile.am | 7 |
2 files changed, 21 insertions, 2 deletions
diff --git a/examples/cpp/GetInstance.cpp b/examples/cpp/GetInstance.cpp new file mode 100644 index 0000000..965fccc --- /dev/null +++ b/examples/cpp/GetInstance.cpp @@ -0,0 +1,16 @@ +#include <iostream> +#include <cpp/WsmanClient.h> + +using std::cout; + +using namespace WsmanClientNamespace; +int main(int argc, char* argv[]) +{ + WsmanClient client = WsmanClient("http://wsman:secret@192.168.1.41:8889/wsman"); + NameValuePairs selectors = NameValuePairs(); + selectors["CreationClassName"] = "CWS_Instance"; + selectors["Id"] = "Instance #1"; + string r = client.Get("http:///cws.sblim.sf.net/wbem/wscim/1/cim-schema/2/CWS_Instance", &selectors ); + cout << "resource: \n" << r << "\n"; + return 0; +} diff --git a/examples/cpp/Makefile.am b/examples/cpp/Makefile.am index 2f97ba3..10ad9f8 100644 --- a/examples/cpp/Makefile.am +++ b/examples/cpp/Makefile.am @@ -2,13 +2,16 @@ LDADD = \ -lwsman_clientpp -EnumInstance_CXXFLAGS = \ +CXXFLAGS = \ $(OPENWSMAN_CFLAGS) EnumInstance_SOURCES = \ EnumInstance.cpp +GetInstance_SOURCES = \ + GetInstance.cpp noinst_PROGRAMS = \ - EnumInstance + EnumInstance \ + GetInstance |