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 including getting all namespaces and enumerating all instances in a namespace.
Each execution of cimcli invokes a CIM Operation with the corresponding 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 specification, this tool implements a number of other specific operations that support testing and querying CIM servers including a command to query for namespaces and to get all instances in a namespace.
The format of this command is generally:
Any extra parameters entities on the command line that occur after the [Operation] and are not preceeded by "-" to indicate an option are considered extra paramters. 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 syntatically 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 command. These include:
In addition 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:
[propertyName]=value
If the propertyName parameter is provided with no value, the default is inserted. Note that the CIM operation is issued even if the property name is illegal since this is considered to be a test program.
The command actually reads the CIM_Class, inserts the properties that have been defined on the command line using the value type from the class.
The command will be rejected if the class does not exist in the namespace.
Example:
cimcli ci CIM_door name=abc size=zyx
Returns the object path of the created instance if the call to the cim server was executed. Otherwise it returns the exception received.
The format 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_quailifers to false.
-nlo Boolean that defines whether properties from superclasses are included in the response. the -nlo option turns this parameter off
-cl Boolean parameter sets the operation parameter classOrigin 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.
Examples
TBD
cimcli[ <classname> ] [options] where the used options are:
The options specific to this operation include;
-niq do not include qualifiers
-nlo not localOnly
-cl class origin
-pl [propertyList] optional property list for the operation.
On this operation the classname parameter is optional similar to the way the CIM operation is defined.
Examples
TBD
This operation takes as input options specific to this command the following:
object - classname for which instancenames 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 -s option is set it returns only the count of names returned.
In order to provide all of the options allowed for the CIM operation EnumerateInstances it uses the following options specific to the command:
-B -nlo not local only operation parameter to false. Note that this negative form for the option is used becaused the default for local only parameter is true. Thus, not including this parameter means that the parameter is not set.
Example:
cimcli ni CIM_ManagedElement -p password -n name -n root/PG_Interop
Execute the enumerateInstanceNames operation on CIM_ManagedElement class in the root/PG_Interop
namespace.
In order to provide all of the options allowed for the CIM operation EnumerateInstances it uses the following options specific to the command
-nlo not local only operation parameter to false. Note that this negative form for the option is used becaused the default for local only parameter is true. Thus, not including this parameter means that the parameter is not set.
-niq Boolean (not_include_Qualifiers) that sets the operation parameter for include_quailifers to false, Note that this negative form is used because the default for this parameter is true.
-ic Boolean to set include class origin operation parameter to true.
-di
Set deep inheritance operation parameter to true.
-o [xml|mof]
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 or XML depending on the output options parameter.
Example
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 format is:
where the options include any of the universal options (ex. namespace, location, etc.)
Example
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 opration is:
cimcligi[objectname][options]
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. The getInstance is executed after the user makes a selection.
This command requieres 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 ouput 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 command are:
-iq include qualifiers
-nlo localonly
-pl [propertyList] optional property list for the operation
Example:
cimcli gi cim_managedElement
This is an interactive request that returns a list of instances from an enumerateinstance of CIM_ManagedElement from which the user can select one which cimcli will return as a complete 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 command is executed and the list of returned instances presented to the console for the user to select one to delete. cimcli then executes deleteInstance with the selected instance name and returns the response,
return - there is an empty response if the instance was successfully deleted or an exception return if there were any errors.
cimcli di [object] [options]
Examples:
cimcli gq [qualifier name] [options]
Example:
cimcli gq abstract - returns the mof or xml for the abstract qualifier.
cimcli eq [options]
There are no special options for this operation.
cimcli dq [qualifier_name] [options]
NOTE: This should be used with great caution.
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 [associationClass] association Class parameter
-rc [resultClass] 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 options provide the various operation parameters including;
-ac [associationClass] association Class parameter
-rc [resultClass] 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
cimcli r [objectname] [options]
Note that the objectname may be either a classname or aninstancename. If classname is supplied, the return is a set of classes that match the objectname supplier unless the -i (interactive) parameter is used. If objectname is used, the response is instances of the association that matches the classname
Where the options specifically used by this operation are:
-r [role] role parameter for the CIM Operation.
-rc [resultClass] resultClass parameter for the CIM Operation
-iq includQualifiers (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 - 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
Examples
TBD
Note that the objectname may be either a classname or a specific instancename. If classname is supplied, the return is a set of classnames that match the objectname supplier unless the -i parameter is used. If objectname is used, the response is instance namess of the associations that matches the classname
Where the options specifically used by this operation are:
-r role parameter for the CIM Operation
-rc 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
Note that there there are two required parameters to this command, the objectname and the [methodname].
Parametere are input in the form:
The completed operations displays the return code from the command and any parameters that are qualified as OUT parameters.
Example:
cimcli PG_WBEMSLPTemplate register -n root/PG_Interop
The parameters are supplied as name=value pairs. In the current version, all parameters are treated as strings.
The syntax of the operation is:
RETURN - It returns a list of the namespace names returned by the CIM Server.
The format of the operation is:
Note that since this operation enumerates namespaces, the namespace option (-n) is not valid.
Examples
cimcli ns
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 -o xml
-- Enumerate classes in MOF starting with CIM_Computersystem
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 rn TST_Person.name=@MIKE@ ...
is equivalent to
cimcli rn TST_Person.name-"MIKE" ...
In this version there is no way to turn this character mapping off which means that the @ character is lost.
cimcli returns the following codes:
0 - Successfull execution of the operation.
1 - Execution error for the operation.
Karl Schopmeyer k.schopmeyer@opengroup.org