Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit 622024b88522e2f358c2b1517191eee0b9c6f98c Author: Peter Hatina phatina@redhat.com Date: Wed Oct 9 10:30:41 2013 +0200
update man page
man/lmishell.1 | 87 +++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 67 insertions(+), 20 deletions(-)
diff --git a/man/lmishell.1 b/man/lmishell.1 index 33ca818..7eab8bf 100644 --- a/man/lmishell.1 +++ b/man/lmishell.1 @@ -1,4 +1,4 @@ -.TH lmishell "1" "August 2013" "openlmi-tools v0.7" "User Commands" +.TH lmishell "1" "October 2013" "openlmi-tools v0.7" "User Commands" .SH NAME lmishell - (non)interactive WBEM client and interpreter. .SH SYNOPSIS @@ -98,6 +98,16 @@ are OK, otherwise `None` is returned: > c is None True > +.SS SERVER'S CERTIFICATE VALIDATION +When using https transport protocol, LMIShell tries to validate each server- +side certificate against platform provided CA trust store. It is necessary to +copy the server's certificate from each CIMOM to the platform specific trust +store directory. + +\fBNOTE:\fR It is possible to make LMIShell skip the certificate validation process by passing `-n` or `--noverify` CLI option to lmishell; see following example: + + $ lmishell --noverify + > .SH NAMESPACES Namespaces in CIM and LMIShell provide a natural way, how to organize all available classes. In the shell, they provide a hierarchic access point to @@ -123,6 +133,11 @@ If you want to access any namespace deeper (eg. cimv2), run this:
> cimv2_namespace = c.root.cimv2 > + +or: + + > cimv2_namespace = c.get_namespace("root/cimv2") + > .SS AVAILABLE CLASSES Each namespace object can print its available classes. To print/get the list of the classes, run this: @@ -214,8 +229,8 @@ Both methods `.instances()` or `.instance_names()` can filter returned objects by their keys/values. The filtering is achieved by passing a dictionary of `{property : value`} to the corresponding method. See following example:
- > inst_lst = cls.instances({"FilterProperty" : "FilterValue"}) - > inst_names_lst = cls.instance_names({"FilterProperty" : "FilterValue"}) + > inst_lst = cls.instances({"FilterProperty" : FilterValue}) + > inst_names_lst = cls.instance_names({"FilterProperty" : FilterValue}) > .SS NEW INSTANCE NAME LMIShell is able to create a new wrapped CIMInstanceName, if you know all the @@ -278,16 +293,18 @@ To get a list of methods, run following: To execute a method within an object, run this:
> instance.Method( - ... Param1=value1, - ... Param2=value2, ...) + ... {"Param1" : value1, + ... "Param2" : value2, ...}) LMIReturnValue(rval=ReturnValue, rparams=ReturnParametersDictionary, errorstr="Possible error string") >
+\fBNOTE:\fR Method parameters are passed in a dictionary, as seen in the previous example. + To get the result from a method call, see following:
> (rval, rparams, errorstr) = instance.Method( - ... Param1=value1, - ... Param2=value2, ...) + ... {"Param1" : value1, + ... "Param2" : value2, ...}) >
The tuple in the previous example will contain return value of the method call @@ -310,8 +327,8 @@ then it uses polling method instead. Following example illustrates, how to perform a synchronous method call:
> (rval, rparams, errorstr) = instance.SyncMethod( - ... Param1=value1, - ... Param2=value2, ...) + ... {"Param1" : value1, + ... "Param2" : value2, ...}) >
\fBNOTE:\fR See the prefix `Sync` in front of a `Method` name. @@ -326,12 +343,16 @@ It is possible to force LMIShell to use only polling method, see the next example:
> (rval, rparams, errorstr) = instance.SyncMethod( - ... PreferPolling=True, - ... Param1=value1, - ... Param2=value2, ...) + ... {"Param1" : value1, + ... "Param2" : value2, ...}, + ... PreferPolling=True) > .TP 4 -.B VALUEMAP PARAMETERS +.B SIGNAL HANDLING +LMIShell can properly handle SIGINT and SIGTERM, which instruct the shell to +cancel the synchronous call. When such signal is received, the background job, +for which the LMIShell is waiting, will be asked to terminate, as well. +.SS VALUEMAP PARAMETERS A CIM Method may contain ValueMap parameters (aliases for constant values) in its MOF definition. To access these parameters, which contain constant values, see following code: @@ -387,14 +408,23 @@ To modify a property, execute following:
> instance.Property = NewPropertyValue > instance.push() - LMIReturnValue(rval=0, rparams={}, errorstr='') + LMIReturnValue(rval=0, rparams={}, errorstr="") >
\fBNOTE:\fR If you change an instance object property, you have to execute a `.push()` method to propagate the change to the CIMOM. +.SS OBJECT REFRESHING +Local objects used by LMIShell, which represent CIM objects at CIMOM side, can +get outdated, if such object changes while working with LMIShell's one. To +update object's properties, methods, etc, follow the next example: + + > instance.refresh() + LMIReturnValue(rval=True, rparams={}, errorstr="") + > .SS DELETE AN INSTANCE A single instance can be removed from the CIMOM by executing:
> instance.delete() + True >
\fBNOTE:\fR After executing the `.delete()` method, all the object properties, methods will become inaccessible. @@ -587,9 +617,9 @@ example: ... Name="cpu", ... HandlerCreationClassName="CIM_IndicationHandlerCIMXML", ... HandlerSystemCreationClassName="CIM_ComputerSystem", - ... Destination="http://192.168.122.1:5988" # this is the destination computer, where all the indications will be delivered + ... Destination="http://192.168.122.1:5988" # this is the destination computer, where the indications will be delivered ... ) - LMIReturnValue(rval=True, rparams={}, errorstr='') + LMIReturnValue(rval=True, rparams={}, errorstr="") >
In this state, we have a indication subscription created. @@ -612,7 +642,7 @@ shell quits. If you want to delete the subscriptions sooner, you can use following methods:
> c.unsubscribe_indication(indication_name) - LMIReturnValue(rval=True, rparams={}, errorstr='') + LMIReturnValue(rval=True, rparams={}, errorstr="") > c.unsubscribe_all_indications() > .SS INDICATION HANDLER @@ -706,8 +736,7 @@ The cache can be also turned off, see next example:
> c.use_cache(False) > -.TP 4 -.B TAB-COMPLETION +.SS TAB-COMPLETION Interactive interface also supports tab-completion for basic programming structures and also for CIM objects (such as namespace, classes, methods and properties completion, ). Following code shows few examples: @@ -751,9 +780,27 @@ configuration file, you can set these properties: If you want to inspect a script after it has been interpreted by the shell, run this:
- $ lmishell -i some_script.py + $ lmishell -i some_script.lmi # some stuff done > + +\fBNOTE:\fR Preffered extension of LMIShell's scripts is `.lmi`. +.SS LMI IS INSTANCE +LMIShell is able to verify, if a LMIInstance or LMIInstanceName object passed +to `lmi_isinstance()` is a instance of LMIClass. The function is similar to +python's `isinstance()`. + + > lmi_isinstance(inst, cls) + True/False + > +.SS LMI ASSOCIATORS +LMIShell can speed up associated objects' traversal by manual joining, instead +of calling `object.associators()`. The call needs to get a list of +\fBassociation\fR classes, for which the referenced objects will be joined. The +list must contain objects of `LMIClass`. See following example: + + > associators = lmi_associators(list_of_association_classes) + > .SH "AUTHORS" .LP Peter Hatina phatina@redhat.com
cura-tools-devel@lists.fedorahosted.org