summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2008-03-03 19:50:31 +0000
committerAnas Nashif <nashif@intel.com>2008-03-03 19:50:31 +0000
commit6a0fa43a4e637718e923a8e4b3f1b2fe9f5338ce (patch)
tree8bcf998e897592b328543d76bbe8f1f06a6b4d51 /src
parent49996770e4878592a3ceca9c48736a4d9774b873 (diff)
downloadwsmancli-6a0fa43a4e637718e923a8e4b3f1b2fe9f5338ce.tar.gz
wsmancli-6a0fa43a4e637718e923a8e4b3f1b2fe9f5338ce.tar.xz
wsmancli-6a0fa43a4e637718e923a8e4b3f1b2fe9f5338ce.zip
update with new API support complex filters
Diffstat (limited to 'src')
-rw-r--r--src/wseventmgr.c8
-rw-r--r--src/wsman.c18
2 files changed, 15 insertions, 11 deletions
diff --git a/src/wseventmgr.c b/src/wseventmgr.c
index eb6d920..60dac93 100644
--- a/src/wseventmgr.c
+++ b/src/wseventmgr.c
@@ -411,6 +411,7 @@ int main(int argc, char **argv)
char *event_mode, *delivery_uri;
char *resource_uri = NULL;
char subscontext[512];
+ filter_t *filter = NULL;
if (!wsman_parse_options(argc, argv)) {
exit(EXIT_FAILURE);
}
@@ -485,14 +486,13 @@ int main(int argc, char **argv)
wsmc_set_action_option(options, FLAG_DUMP_REQUEST);
}
if (wsm_filter) {
- options->filter = filter_create_simple(wsm_dialect, wsm_filter );
+ filter = filter_create_simple(wsm_dialect, wsm_filter );
}
options->cim_ns = cim_namespace;
switch (op) {
case WSMAN_ACTION_PULL:
- doc =
- wsmc_action_pull(cl, resource_uri, options,
+ doc = wsmc_action_pull(cl, resource_uri, options, filter,
enum_context);
wsman_output(cl, doc);
if (doc) {
@@ -526,7 +526,7 @@ int main(int argc, char **argv)
*/
if(event_reference_properties)
options->reference = event_reference_properties;
- rqstDoc = wsmc_action_subscribe(cl, resource_uri, options);
+ rqstDoc = wsmc_action_subscribe(cl, resource_uri, options, filter);
wsman_output(cl, rqstDoc);
if (rqstDoc) {
ws_xml_destroy_doc(rqstDoc);
diff --git a/src/wsman.c b/src/wsman.c
index 5ad0d5c..f67350c 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -548,7 +548,12 @@ int main(int argc, char **argv)
char *event_mode, *delivery_uri;
char *resource_uri = NULL;
char subscontext[512];
+ filter_t *filter = NULL;
+
+
filename = (char *) config_file;
+
+
if (filename) {
ini = iniparser_new(filename);
if (ini == NULL) {
@@ -727,9 +732,7 @@ int main(int argc, char **argv)
}
break;
case WSMAN_ACTION_PULL:
- doc =
- wsmc_action_pull(cl, resource_uri, options,
- enum_context);
+ doc = wsmc_action_pull(cl, resource_uri, options, filter, enum_context);
wsman_output(cl, doc);
if (doc) {
ws_xml_destroy_doc(doc);
@@ -754,7 +757,7 @@ int main(int argc, char **argv)
epr_add_selector_text(epr, CIM_NAMESPACE_SELECTOR, options->cim_ns);
}
if (epr) {
- options->filter = filter_create_assoc(epr, (op == WSMAN_ACTION_REFERENCES )?0:1, NULL, NULL, NULL, NULL, NULL, 0 );
+ filter = filter_create_assoc(epr, (op == WSMAN_ACTION_REFERENCES )?0:1, NULL, NULL, NULL, NULL, NULL, 0 );
}
} else {
error("Filter Requied");
@@ -798,7 +801,7 @@ int main(int argc, char **argv)
wsmc_set_action_option(options,
FLAG_ENUMERATION_COUNT_ESTIMATION);
}
- enum_response = wsmc_action_enumerate(cl, resource_uri, options);
+ enum_response = wsmc_action_enumerate(cl, resource_uri, options, filter);
wsman_output(cl, enum_response);
if (enum_response) {
if (!(wsmc_get_response_code(cl) == 200 ||
@@ -817,7 +820,7 @@ int main(int argc, char **argv)
break;
while (enumContext != NULL && enumContext[0] != 0) {
- doc = wsmc_action_pull(cl, resource_uri, options,
+ doc = wsmc_action_pull(cl, resource_uri, options, filter,
enumContext);
wsman_output(cl, doc);
@@ -862,7 +865,7 @@ int main(int argc, char **argv)
*/
if(event_reference_properties)
options->reference = event_reference_properties;
- rqstDoc = wsmc_action_subscribe(cl, resource_uri, options);
+ rqstDoc = wsmc_action_subscribe(cl, resource_uri, options, filter);
wsman_output(cl, rqstDoc);
if (rqstDoc) {
ws_xml_destroy_doc(rqstDoc);
@@ -905,6 +908,7 @@ int main(int argc, char **argv)
}
}
wsmc_options_destroy(options);
+ filter_destroy(filter);
wsmc_transport_fini(cl);
wsmc_release(cl);
if (ini) {