Content-type: text/html
cimcli is available for all platforms that support the Pegasus CIM Server.
cimcli is a command line test tool for executing CIM client operations. It implements all of the DMTF CIM operations except for the modify and create class/instance operations and includes several other operations that are useful in testing CIM Servers including getting all namespaces and enumerating all instances in a namespace.
Each execution of cimcli invokes one or more CIM Operations with the command parameters equivalent to the CIM Operations defined in the CIM Operations over HTTP specification.
In addition to the basic CIM Operations defined in the DMTF specification (DMTF DSP 0200), cimcli implements a number of other operations that support testing and querying CIM servers (ex. an operation to query for namespaces and another to get all instances in a namespace) which require multiple CIM Operations. The additional operations include:
NOTE: This operation may be CIMServer type specific since not all CIMServers implement the statistics functions.
The format of the cimcli command is generally:
Note that options may be interspersed with the [OperationTarget] parameter but that a) the ordering of [Operation] [OperationTarget] is fixed and any [value parameters] MUST occur after the [OperationTarget] parameter.
The format for instance name is defined as the model path in the CIM Specification and has the form:
<classname>.<keyPropertyName1>= <value1>[,<keypropertyNamex>=<valuex>]* <valuex> is either a numeric value or a string value (enveloped in quotes). The quote marks surrounding string values are required.However, to make inputting command line object names, cimcli offers a second option for inputting the object name as [OperationTarget]. In this second case, the [OperationTarget] Object is simply the class name and value parameters are used to define the keypropertyName/value pairs. In this case, the quotation marks around string property values are optional and are required only in the case where quotation marks would be required to define a value such as a string that includes quotation marks.
Thus, as an example, the input for a getInstance might be:
cimcli gi TennisPlayer.first="Patrick",last="Rafter"
or
cimcli gi TennisPlayer first=Patrick last=Rafter
In the second case, cimcli gets the class from the CIM Server and uses the parameters to form a correct CIMObjectPath. In the first case, generally cimcli uses the input path directly without getting the class from the server.
Any extra parameter entities on the command line that occur after the [Operation] and [Operation Target] and are not proceeded by "-" to indicate an option are considered value parameters. These are used in some of the operations to provide additional information required or optionally desired by the operation. See each operation definition to determine if extra parameters are required or allowed. These may be either keyname/value pairs in some cases or simply strings depending on the operation.
NOTE: cimcli does not protect the user against inputting extra options or parameters. Since the options are heavily dependent on the operation to be executed, it simply ignores those options that are not used with a particular operation. Thus, entering the -r option (role) with a getClass operation is syntactically allowed but cimcli ignores the parameter.
There is a set of options which are general to all of the CIM Operations and most of the compound operations and which provide parameters for the initiation or execution of the operations (ie. identify the target server and set connection security parameters.. These include:
NOTE: Since SSL is considerd a compilable option with cimcli, these options may not even exist in a Pegasus environment that was compiled with the SSL capabilities disabled.
There is a set of options that modifies the manner in which the command is executed or the display of information on response including the following:
Example:
cimcli en CIM_ManagedElement -count 100 If the count of instances returned is not equal to 100, cimcli exits with error code 60 and the Failed count test ... error message.
There is a set of options that define request parameters for specific cimcli Operation requests. These are typically optional parameters on the CIM operation request that modify the behavior of the server to the request. This includes things like requesting localonly, deep inheritance, etc. Note that the actual behavior may be dependent on the particular operation request type. The full definition of these options is below here and their use with each specific cimcli operation is defined with the operations.
The syntax of propertylist is:
<propertyName>[,<propertyName>]* | ""
Examples:
cimcli gc CIM_ManagedElement -pl Caption
cimcli gc CIM_ManagedElement -pl Caption,Description
cimcli gc CIM_ManagedElement -pl ""
[propertyName]=value where value may be either a scalar for scalar properties or an array for array properties. The detailed form for the input is defined in section TBD.If the propertyName parameter is provided with no value, the default value or NULL if there is no default value is inserted.
Note that string property values are a special case because there are actually two concepts that must be covered when there is no value, 1) Empty String or 2. NULL/default value.
Thus when a property that requires an empty string is to be input, the user will specify it with no value after the = sign. If, a NULL or default value is desired, the = sign terminator is replaced with the ! (exclamation mark).
The operation first accesses the CIMServer for the class definition and uses this information to build the proper value types and values for the instance.
This command builds the instance with all of the properties for which name/value pairs representing the properties of the class are input. It does not include any properties that are not defined on the command line.
To create an instance with less than the full set of properties, supply only those properties that are to be submitted to the CIM Server.
Scalar property values - The String form of the property similar to MOF input of constant values is used to input scalar values.
Array property values - Array properties are defined by defining a value of the form:
{ scalarvalue1[,scalarvaluex]*}
Note that the array MUST NOT include any spaces between the scalarvalue entities.
[FUTURE]The capability exists to create "incorrect" properties as an additional test capability. Generally this means properties with an incorrect type or with names that are not part of the class for which the instance is being built.
[FUTURE]If a property value definition is supplied with the form
"("PropertyType")"[propertyName]=value
where property type is one of the CIM property types (i.e. boolean, String, Uint8, etc.) the property will be recreated or added to the instance with that type and name. Thus, a property can be added with an incorrect name or with an incorrect type overriding the definition in the class.
The command will be rejected if the class does not exist in the namespace.
Examples:
cimcli ci CIM_xxxx name=abc size=zyx cimcli ci CIM_xxxx name=abc anotherproperty=32 create an instance of CIM_xxxx with name property value = abc, a property added named another property with type uint32 and value of 32. cimcli ci CIM_xxxx name=abc arrayParam={abc,def,ghi,"jkl mno" numericArray=1,2,3,4Returns the object path of the created instance if the call to the CIM server was executed successfully. Otherwise it returns the exception received.
In addition to the property definitions, this command allows the property list options (-pl) that defines a property list to be supplied to the target server with the modifyInstance CIM Operation.
Example:
cimcli mi CIM_xxxx name=abc size=zyx cimcli mi CIM_xxxx name=abc arrayParam={abc,def,ghi,"jkl mno" numericArray=1,2,3,4
The syntax for this operation is:
where classname is not required. If it is omitted, cimcli inserts an empty classname into the CIM operation which tells the CIM Server to start at the top of the class inheritance tree. The possible options that represent the parameters of the enumerateClasses operation are:
-niq Boolean (not_include_Qualifiers) that sets the operation parameter for include_qualifiers to false.
-nlo Boolean that defines whether properties from superclasses are included in the response. the -nlo option turns this parameter off
-ic Boolean parameter sets the operation parameter includeClassOrigin in the operation request. the CIMServer is expected to return classOrigin
information as part of the response.
-pl [propertyList] Optional property list for the operation.
Example:
cimcli ec CIM_ManagedElement -di -nlo
The syntax for this operation is:
cimcli nc [<classname>] [options]
The classname parameter optional and the default it is not provided is to return the class names of the top level classes.
The options specific to this operation include;
-di set the operation deepInheritance parameter = true not localOnly
Examples:
cimcli nc CIM_door Issue getClass CIM Operation for the class CIM_Door.
Where:
classname - classname for which instance names are to be enumerated.
It displays the instances names that were returned by the CIM server in response to the enumerateInstances CIM operation with the defined input parameters. If the --sum option is set it returns only the count of names returned.
Examples:
cimcli ni CIM_ManagedElement -p password -n name -n root/PG_Interop --sort Execute the enumerateInstanceNames operation on CIM_ManagedElement class in the root/PG_Interop namespace. Sort the returned list of instance paths. cimcli ni CIM_Door --sum Execute the enumerateInstanceNames operation on the class CIM_Door and return the count of instance paths returned.
This operation requests instances from the CIMServer and displays the returned instances in a user selected format.
The following options represent specific parameters for this operation
-nlo not local only operation parameter to false. Note that this negative form for the option is used because the default for local only parameter is true. Thus, not including this parameter means that the parameter is not set.
-iq Boolean (include_Qualifiers) that sets the operation parameter for include_qualifiers to true,
-ic Boolean to set include class origin operation parameter to true.
-di
Set deep inheritance operation parameter to true.
-o [xml|mof|table]
Set the output format for the instances to display the returns as mof
-pl [propertyList]
optional property list for the operation
It returns the instances found either as MOF,XML or a table of property
values with each property a column in the table depending on the
output options parameter.
Examples:
cimcli ei CIM_ComputerSystem -niq -di This example enumerates CIM_ComputerSystem in the namespace root/CIMV2 (default) requesting without qualifiers (-niq) with deepInheritance (-di).
The syntax for this operation is:
where the options include any of the universal options (ex. namespace, location, etc.)
Examples:
cimcli niall -n test/testproviders Returns all instancenames in the namespace test/testproviders by executing enumerateinstancenames on each class in the namespace.
The syntax for this operation is:
which causes execution of the CIM getinstance operation. OR
which presents a list of possible instances to the user from which one can be selected for the getinstance. In this case, the command actually executes an enumerateInstanceNames to get the list of instances that is presented to the user for selection of a single instance. The getInstance is executed after the user makes a selection.
This command requires the [objectname] parameter. If the parameter is an instance with keys defined (a CIMObjectPath), the a getInstance CIM operation is executed and the return from the CIM Server presented (in either xml or mof depending on the output option). If the input is a class name, a enumerateinstanceNames CIM Operation is executed and if any instance names are returned the result is presented to the console for the user to select one of the instances to be deleted.
If there are no instances, the return from this command is normally an exception as defined in the DMTF CIM Operations specification..
The possible options specific to this operation are:
-iq include qualifiers. The default for getInstance is includQualifiers=false so use of this parameter is required if the user wants qualifiers returned. NOTE: The use of the parameter in CIM/XML has been deprecated so the provider may not return qualifiers even if requested.
-nlo localonly
-pl [propertyList] optional property list for the operation
Examples:
cimcli gi cim_ManagedElement This is an interactive request that returns a list of CIMObjectPaths from an enumerateInstance of CIM_ManagedElement from which the user can select one path which cimcli will uses as the [objectname] to execute a getInstance operation returning the instance.
cimcli di [objectname] [options]
This command requires the [objectname] parameter. If this parameter is a full instance name with className and key bindings, the deleteInstance CIM Operation is executed directly. If it is a class name with no keybindings, the enumerateInstances CIM Operation is executed and the list of returned instance paths presented to the console for the user to select one to delete. cimcli then executes CIM deleteInstance operation with the selected [objectname] and returns the response.
The response to this operation is either an empty response if the instance was successfully deleted or an exception return if there were any errors.
Examples:
cimcli di President."name=fred" -n test/testnamespace Attempt to delete the instance of President with the key property name - fred from the test/testnamespace namespace. cimcli di President -n test/testnamespace cimcli requests instance paths for the President class in the test/testnamespace and puts the complete list on the console for the user to select one instance to delete.
cimcli gq [qualifier name] [options]
Examples:
cimcli gq abstract - returns the mof or XML for the abstract qualifier.
There are no special options for this operation.
cimcli dq [qualifier_name] [options]
NOTE: This operation should be used with great caution as it removes qualifier declarations that may be used by other components of the model.
Note that the objectname may be either a classname or an instancename. If classname is supplied, the return is a set of classes that match the objectname supplied unless the -i (interactive) parameter is used. If objectname is used, the response is instances of the association that matches the classname.
The options provide the various operation parameters including;
-ac [assocatonClassName] association Class parameter
-rc [resultClassName] resultClass parameter
-r [role] String defining the role parameter for the CIM Operation
-rr [resultrole] resultrole parameter
-ic includeClassOrigin The -ic parameter
-pl [properytlist] Optional PropertyList
-i Interactive request - If this parameter is supplied and the objectname is a classname, the environment performs an enumerateInstances on the objectname and presents the list of possible instances for user selection
cimcli an [objectname] [options]
where objectname can be either a class name or an instance name.
The following options provide the various operation parameters;
-ac [assocatonClassName] association Class parameter
-rc [resultClassName] resultClass parameter
-r [role] String defining the role parameter for the CIM Operation
-rr [resultrole] resultrole parameter
-i Interactive request - If this parameter is supplied and the objectname is a classname, the environment performs an enumerateinstances on the objectname and presents the list of possible instances for user selection
Note that the objectname may be either a class name or an instance name. If a class name is supplied, the return is a set of classes that of the association. If the -i (interactive) parameter is used with a class name input, the user is queried for the objectname parameter. If objectname is used, the response is instances of the associations that match the classname
The options specifically used by this operation are:
-r [role] role parameter for the CIM Operation.
-rc [resultClassName] resultClass parameter for the CIM Operation
-iq includeQualifiers (The default is false)
-ic Boolean to set include class origin operation parameter to true.
-pl [propertyList] optional property list for the operation
-i Interactive request - This option is used only with commands that will accept either classname or object name as input (reference, referencenames, associatiors, associatornames). It allows the interactive mode where the user picks an instance from a list returned by cimcli (similar to gi where if only the classname is supplied, cimcli knows that the user wants to pick from a list) with these commands. If this parameter is supplied and the objectname is a classname, the environment performs an enumerateinstances on the objectname and presents the list of possible instances for user selection. Thus, the user can execute interactive reference, etc. operations
Examples:
cimcli a CIM_ManagedElement would return classs that associate with CIM_ManagedElement cimcli a CIM_ManagedElement -i executes an enumerateInstanceNames on CIM_ManagedElement and presents the user with a list of instances names so that the user can pick an instance name that will be used for the associator request.
The syntax for this operation is:
Note that the objectname may be either a class name or a specific instance name. If classname is supplied, the return is a set of classnames that are references of the objectname supplied. If the -i parameter is used with a class name as objectname, the user is queried to select an instance name for the objectname input. If objectname is used, the response is instance names of the associations that matches the classname.
The options specifically used by this operation are:
-r [role] role parameter for the CIM Operation
-rc [resultClassName] resultClass parameter for the CIM Operation
-i Interactive request - If this parameter is supplied and the objectname is a classname, the environment performs an enumerateinstances on the objectname and presents the list of possible instances for user selection
The form of the command is:
Note that there are two required parameters to this command, the [objectname] and the [methodname].
Parameters are input in the form:
parameterName=<value> <value> defines may be any of the value forms defined for CIM value including string, integer, etc. NOTE: Earlier versions of cimcli allowed only String values.The completed operations displays the return code from the command and any returned parameters that are qualified as OUT parameters.
Example:
cimcli PG_WBEMSLPTemplate register -n root/PG_Interop cimcli PG_XXX dosomething input1=true input2=1111 --- input1 is boolean parameter and input2 is Uint32 parameter
DEPRECATED to be replaced by at some time in the future
The syntax of the operation is:
DEPRECATED
The syntax of the operation is:
RETURN - It returns a list of the namespace names returned by the CIM Server.
The syntax for this operation is:
Note that since this operation enumerates namespaces, the namespace option (-n) is not used.
Examples
cimcli ns
Examples
cimcli -hc
The following is an alphabetic list of the options:
Example:
-ac CIM_ManagedElement
p1=v1,p2=v2,..,pn=vn (without spaces) . Default()
NOTE: since SSL is considered a compilable option with cimcli, these options may not even exist in a Pegasus environment that was compiled with the SSL capabilities disabled.
Execute an enumerateinstancenames CIM operation for the
pg_computersystem Class
cimcli enumerateinstancenames pg_computersystem -- enumerateinstances
of class
or
cimcli ei pg_computersystem -- Same as above
Enumerate the class names from the default namespace "root/cimv2"
cimcli enumerateclassnames -- Enumerate classnames from root/cimv2.
Enumerate class names from the namespace "root"
cimcli ec /n root -- Enumerate classnames from namespace root.
cimcli ec -o xml -- Enumerate classes with XML output starting at root.
cimcli enumerateclasses CIM_ComputerSystem -di
-- Enumerate classes starting at CIM_ComputerSystem and the
remainder of the class hiearchy (-di) with mof output of the
classes.
cimcli getclass CIM_door -a -u guest -p guest
-- Get class with authentication set and user = guest, password = guest.
cimcli rn TST_Person.name=@MIKE@ -n root/sampleprovider -rc TST_Lineage.
cimcli ec -o XML -- enumerate classes and output XML rather than MOF.
cimcli getqualifiers -- Get the qualifiers in mof output format
cimcli returns a significant number of error codes as follows:
0 Successful execution of the operation.
1-49 A CIM Operation executed as part of the cimcli operation returned a CIM Exception as defined in the DMTF CIM Operations over HTTP specification. The status code of the error is returned. While today only not all of the numbers from 1 to 49 are used for CIM Status errors, cimcli has reserved this set of numbers with the expectation that this list will expand in the future.
cimcli will not return any error codes in this range that are not specifically defined by DMTF error status codes and generated by the CIM Operation calls.
50 Pegasus Exception encountered during execution of Pegasus Functions
51 CIMCLI general error not covered by other errors
52 Unknown exception occurred during execution of the operation
53 Command line or configuration file input parsing error.
54 Connection to server failed error.
60 cimcli failed a compare with one of the test operations such as testInstance. The returned entity did not match the properties of the object defined by the input parameters.
Karl Schopmeyer k.schopmeyer@opengroup.org