Execute the client ExecQuery function. The parameters are:
namespace, queryLanguage, and the query string
*/
-int executeQuery(Options& opts)
+int execQuery(Options& opts)
{
if (opts.verboseTest)
{
int PEGASUS_CLI_LINKAGE invokeMethod(Options& opts);
-int PEGASUS_CLI_LINKAGE executeQuery(Options& opts);
+int PEGASUS_CLI_LINKAGE execQuery(Options& opts);
int PEGASUS_CLI_LINKAGE enumerateNamespaceNames(Options& opts);
break;
case ID_ExecQuery:
+ if (argc <= 2 && opts.query.size() == 0)
+ {
+ cerr << "ERROR: ExecQuery requires a query"
+ "filter definition\n"
+ " - supplied directly as a parameter\n"
+ " - OR supplied with the -f option\n"
+ " The filterLanguage may be supplied\n"
+ " - as the second argument\n"
+ " - OR as the -ql option\n"
+ << endl;
+ }
opts.query = argv[2];
if (argc==4)
{
opts.queryLanguage = argv[3];
}
- opts.termCondition = executeQuery(opts);
+ opts.termCondition = execQuery(opts);
break;
case ID_StatisticsOn:
{ID_ExecQuery, "execQuery", 2 , "xq",
"Clients.cimcli.CIMCLIClient.XQ_COMMAND_HELP",
- " Execute Query <query-expresssion> [<query-language>]"},
+ " ExecQuery <query-expresssion> [<query-language>]"},
{ID_EnumerateNamespaces, "enumerateNamespaces",2 , "ns",
"Clients.cimcli.CIMCLIClient.NS_COMMAND_HELP",
"Clients.cimcli.CIMCLIClient.FILTER_OPTION_HELP",
"Defines a filter to use for query. Single String input"},
+ {"queryLanguage", "WQL", false, Option::STRING, 0, 0, "ql",
+ "Clients.cimcli.CIMCLIClient.QUERYLANGUAGE_OPTION_HELP",
+ "Defines a Query Language to be used with a query filter.\n"},
+
// KS change the output formats to use the enum options function
// Deprecate this function.
{"outputformats", "mof", false, Option::STRING, 0,NUM_OUTPUTFORMATS,
opts.setRtnHostNames,
opts.rtnHostSubstituteName);
+ lookupStringOption(opts, om, "filter", opts.query);
+
+ lookupStringOption(opts, om, "queryLanguage", opts.queryLanguage);
+
// Test for existence of input parameter option. If found, put out
// warning and exit with syntax error message. This parameter was
// deprecated and removed in favor of direct input of name/value pairs
The detailed form for value input is defined as follows:
.B 1.
-Scalar property values - The tring form of the property similar
+Scalar property values - The string form of the property similar
to MOF input of constant values is used to input scalar values.
The scalarvalue input includes all CIM Types. Numeric values may
be input in hex, octal, decimal or binary in the same form as
Clients.cimcli.CIMCLIClient.FILTER_OPTION_HELP:string {
"-f filter. Defines a filter to use for query. Single String input. Default()\n"}
+ Clients.cimcli.CIMCLIClient.QUERYLANGUAGE_OPTION_HELP:string {
+ "-ql queryLanguage. Defines a Query Language to be used with a query filter. Default(WQL)\n"}
+
Clients.cimcli.CIMCLIClient.OUTPUTFORMATS_OPTION_HELP:string {
"-o outputformats. Output in xml, mof, txt. Default(mof)\n"}
@$(ECHO) 22. +++++ Test enumerateClasses
+## Test executeQuery Operation. This test should
+## return a single instance. We just test the response count to avoid
+## the issue of variable information in the result file
+testExecQuery:
+ @$(ECHO) 23. +++++ Test For execQuery
+ @$(ECHO) 23. +++++ Test For execQuery >> $(RESULTFILE)
+ifdef PEGASUS_ENABLE_EXECQUERY
+ @cimcli xq "Select scaleBool from Test_CLITestProviderClass" \
+ -n "$(PROVIDERNS)" -count 1
+endif
+
+ @$(ECHO) 23. +++++ Test enumerateClasses
+
### Execute the set of test targets defined below
poststarttests:
## Remove existing master files
$(MAKE) objectcountertests
$(MAKE) SortInstancesTest
$(MAKE) enumerateClasses
+ $(MAKE) testExecQuery
@$(ECHO) +++++ Compare Result files
## diffsort used because there is at least one instance where
the same name/value pair syntax as properties in create
and modify instance.. Default()
-f filter. Defines a filter to use for query. Single String input. Default()
+ -ql queryLanguage. Defines a Query Language to be used with a query filter.
+. Default(WQL)
-o outputformats. Output in xml, mof, txt, table. Default(mof)
-x xmlOutput. Output objects in xml format. Default(false)
--version version. Displays software Version. Default(false)
<instancename>
im invokeMethod Invoke Method for <object> <method>
{<inputParams>}
-xq execQuery Execute Query <query-expresssion>
+xq execQuery ExecQuery <query-expresssion>
[<query-language>]
ns enumerateNamespaces Enumerate all namespaces on the server.
son Turn On Statistics Turn on CIM Server Statistics Gathering
<instancename>
im invokeMethod Invoke Method for <object> <method>
{<inputParams>}
-xq execQuery Execute Query <query-expresssion>
+xq execQuery ExecQuery <query-expresssion>
[<query-language>]
ns enumerateNamespaces Enumerate all namespaces on the server.
son Turn On Statistics Turn on CIM Server Statistics Gathering
the same name/value pair syntax as properties in create
and modify instance.. Default()
-f filter. Defines a filter to use for query. Single String input. Default()
+ -ql queryLanguage. Defines a Query Language to be used with a query filter.
+. Default(WQL)
-o outputformats. Output in xml, mof, txt, table. Default(mof)
-x xmlOutput. Output objects in xml format. Default(false)
--version version. Displays software Version. Default(false)
the same name/value pair syntax as properties in create
and modify instance.. Default()
-f filter. Defines a filter to use for query. Single String input. Default()
+ -ql queryLanguage. Defines a Query Language to be used with a query filter.
+. Default(WQL)
-o outputformats. Output in xml, mof, txt, table. Default(mof)
-x xmlOutput. Output objects in xml format. Default(false)
--version version. Displays software Version. Default(false)
<instancename>
im invokeMethod Invoke Method for <object> <method>
{<inputParams>}
-xq execQuery Execute Query <query-expresssion>
+xq execQuery ExecQuery <query-expresssion>
[<query-language>]
ns enumerateNamespaces Enumerate all namespaces on the server.
son Turn On Statistics Turn on CIM Server Statistics Gathering
<instancename>
im invokeMethod Invoke Method for <object> <method>
{<inputParams>}
-xq execQuery Execute Query <query-expresssion>
+xq execQuery ExecQuery <query-expresssion>
[<query-language>]
ns enumerateNamespaces Enumerate all namespaces on the server.
son Turn On Statistics Turn on CIM Server Statistics Gathering
the same name/value pair syntax as properties in create
and modify instance.. Default()
-f filter. Defines a filter to use for query. Single String input. Default()
+ -ql queryLanguage. Defines a Query Language to be used with a query filter.
+. Default(WQL)
-o outputformats. Output in xml, mof, txt, table. Default(mof)
-x xmlOutput. Output objects in xml format. Default(false)
--version version. Displays software Version. Default(false)
WET_SettingContext
WET_Statistics
WET_Synchronized
+23. +++++ Test For execQuery