summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2007-03-30 13:43:01 +0000
committerAnas Nashif <nashif@intel.com>2007-03-30 13:43:01 +0000
commit75e83aa60952a2be3fb25b4ee7a1a0d239f30346 (patch)
tree58ba46358fe5adf065b3121d8deefde556a193b3 /src
parente1733517e5958b3850d3f0353ed43699712b9398 (diff)
downloadwsmancli-75e83aa60952a2be3fb25b4ee7a1a0d239f30346.tar.gz
wsmancli-75e83aa60952a2be3fb25b4ee7a1a0d239f30346.tar.xz
wsmancli-75e83aa60952a2be3fb25b4ee7a1a0d239f30346.zip
reference improvements
Diffstat (limited to 'src')
-rw-r--r--src/wsman-client-options.c9
-rw-r--r--src/wsman-client-options.h1
-rw-r--r--src/wsman.c44
3 files changed, 14 insertions, 40 deletions
diff --git a/src/wsman-client-options.c b/src/wsman-client-options.c
index c8ddebf..7afe82a 100644
--- a/src/wsman-client-options.c
+++ b/src/wsman-client-options.c
@@ -84,6 +84,7 @@ char dump_request = 0;
char step = 0;
char request_only = 0;
char cim_extensions = 0;
+char cim_references = 0;
static char *enum_mode = NULL;
static char *binding_enum_mode = NULL;
static char *enum_context = NULL;
@@ -112,7 +113,6 @@ WsActions action_data[] = {
{"create", WSMAN_ACTION_TRANSFER_CREATE},
{"delete", WSMAN_ACTION_TRANSFER_DELETE},
{"enumerate", WSMAN_ACTION_ENUMERATION},
- { "references", WSMAN_ACTION_ENUMERATE_REFERENCE_INSTANCES},
{"pull", WSMAN_ACTION_PULL},
{"release", WSMAN_ACTION_RELEASE},
{"invoke", WSMAN_ACTION_CUSTOM},
@@ -208,7 +208,8 @@ char wsman_parse_options(int argc, char **argv)
"CIM binding Enumeration Mode", "none|include|exclude"},
{"cim-extensions", 'T', U_OPTION_ARG_NONE, &cim_extensions,
"Show CIM Extensions", NULL},
-
+ {"references", 'W', U_OPTION_ARG_NONE, &cim_references,
+ "CIM References", NULL},
{NULL}
};
@@ -426,6 +427,10 @@ char wsman_options_get_optimize_enum(void)
return enum_optimize;
}
+char wsman_options_get_cim_ref(void)
+{
+ return cim_references;
+}
char wsman_options_get_cim_ext(void)
{
diff --git a/src/wsman-client-options.h b/src/wsman-client-options.h
index d14fedd..4218d2d 100644
--- a/src/wsman-client-options.h
+++ b/src/wsman-client-options.h
@@ -38,6 +38,7 @@ extern char wsman_options_get_step_request(void);
extern char wsman_options_get_estimate_enum(void);
extern char *wsman_options_get_fragment(void);
extern char *wsman_options_get_filter(void);
+extern char wsman_options_get_cim_ref(void);
extern char *wsman_options_get_dialect(void);
extern const char *wsman_options_get_config_file(void);
diff --git a/src/wsman.c b/src/wsman.c
index 69c4e5a..7361f9f 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -103,7 +103,6 @@ int main(int argc, char **argv)
WsXmlDocH rqstDoc;
actionOptions *options;
WsXmlDocH enum_response;
- WsXmlDocH reference_response;
WsXmlDocH resource;
char *enumeration_mode, *binding_enumeration_mode,
*resource_uri_with_selectors;
@@ -293,7 +292,7 @@ int main(int argc, char **argv)
if (strcmp(enumeration_mode, "epr") == 0)
wsman_set_action_option(options,
FLAG_ENUMERATION_ENUM_EPR);
- else
+ else if (strcmp(enumeration_mode, "objepr") == 0)
wsman_set_action_option(options,
FLAG_ENUMERATION_ENUM_OBJ_AND_EPR);
}
@@ -312,6 +311,10 @@ int main(int argc, char **argv)
wsman_set_action_option(options,
FLAG_POLYMORPHISM_NONE);
}
+ if (wsman_options_get_cim_ref()) {
+ wsman_set_action_option(options,
+ FLAG_CIM_REFERENCES);
+ }
if (wsman_options_get_optimize_enum()) {
wsman_set_action_option(options,
FLAG_ENUMERATION_OPTIMIZATION);
@@ -322,8 +325,7 @@ int main(int argc, char **argv)
wsman_set_action_option(options,
FLAG_ENUMERATION_COUNT_ESTIMATION);
}
- enum_response = wsenum_enumerate(cl,
- resource_uri, options);
+ enum_response = wsenum_enumerate(cl, resource_uri, options);
wsman_output(cl, enum_response);
if (enum_response) {
if (!(wsman_client_get_response_code(cl) == 200 ||
@@ -358,40 +360,6 @@ int main(int argc, char **argv)
}
u_free(enumContext);
break;
- case WSMAN_ACTION_ENUMERATE_REFERENCE_INSTANCES:
- fprintf(stderr, "Enumerate Reference Instances. resource_uri: %s\n", resource_uri);
- reference_response = wsenum_reference_instances(cl, resource_uri, options);
- wsman_output(cl, reference_response);
- if (reference_response) {
- if (!(wsman_client_get_response_code(cl) == 200 ||
- wsman_client_get_response_code(cl) == 400 ||
- wsman_client_get_response_code(cl) == 500)) {
- break;
- }
- enumContext = wsenum_get_enum_context(reference_response);
- ws_xml_destroy_doc(reference_response);
- } else {
- break;
- }
-
- if (!wsman_options_get_step_request()) {
- while (enumContext != NULL && enumContext[0] != 0) {
-
- doc = wsenum_pull(cl, resource_uri, options, enumContext);
- wsman_output(cl, doc);
-
- if (wsman_client_get_response_code(cl) != 200 &&
- wsman_client_get_response_code(cl) != 400 &&
- wsman_client_get_response_code(cl) != 500) {
- break;
- }
- enumContext = wsenum_get_enum_context(doc);
- if (doc) {
- ws_xml_destroy_doc(doc);
- }
- }
- }
- break;
default:
fprintf(stderr, "Action not supported\n");
retVal = 1;