summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDenis Sadykov <sadden@intel.com>2007-02-14 18:24:32 +0000
committerDenis Sadykov <sadden@intel.com>2007-02-14 18:24:32 +0000
commit5cf266550291c76c1844d66a6a7fcb5964f3cc3d (patch)
treeed74b713a0e4529419f17092efb03968e4b6ae81 /examples
parent19dd302f81b94524c77de96b452297614f9ae7fe (diff)
downloadwsmancli-5cf266550291c76c1844d66a6a7fcb5964f3cc3d.tar.gz
wsmancli-5cf266550291c76c1844d66a6a7fcb5964f3cc3d.tar.xz
wsmancli-5cf266550291c76c1844d66a6a7fcb5964f3cc3d.zip
new api example update
Diffstat (limited to 'examples')
-rw-r--r--examples/new_api_example.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/examples/new_api_example.c b/examples/new_api_example.c
index b962288..ca8c505 100644
--- a/examples/new_api_example.c
+++ b/examples/new_api_example.c
@@ -48,6 +48,8 @@ int main(int argc, char** argv)
sid = wsman_session_open(uri->host, uri->port, uri->path, uri->scheme,
uri->user, uri->pwd, 0);
+/* sid = wsman_session_open("localhost", 8889, "/wsman", "http", "den","den", 0);*/
+
if (sid < 0) {
printf("Open session failed\n");
return 0;
@@ -72,12 +74,43 @@ int main(int argc, char** argv)
if (!response) {
printf("******** Pull (%d) failed - %s ********\n\n",
i, wsman_session_error(sid));
- return 0;
+ break;
}
printf("******** Pull response (%d) *******\n%s\n", i, response);
i++;
}
+const char *ruri =
+ "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem?Name=mstrcsd013.ims.intel.com&CreationClassName=OMC_UnitaryComputerSystem";
+
+ response = wsman_session_transfer_get(sid, ruri, 0);
+
+ if (!response) {
+ printf("******** Transfer Get failed - %s ********\n\n",
+ wsman_session_error(sid));
+ }
+
+ printf ("******** Transfer Get (first response) (id %d) ********\n%s\n",
+ sid, response);
+
+ wsman_session_locator_resource_uri(sid, resource_uri);
+ wsman_session_locator_add_selector(sid,
+ "Name",
+ "mstrcsd013.ims.intel.com");
+ wsman_session_locator_add_selector(sid,
+ "CreationClassName",
+ "OpenWBEM_UnitaryComputerSystem");
+
+ response = wsman_session_transfer_get(sid, NULL, 0);
+
+ if (!response) {
+ printf("******** Transfer Get failed - %s ********\n\n",
+ wsman_session_error(sid));
+ }
+
+ printf ("******** Transfer Get (second response) (id %d) ********\n%s\n",
+ sid, response);
+
wsman_session_close(sid);
printf("******** Closed session id %d ********\n\n", sid);