LMIConnection.
LMIConnection
(uri, username='', password='', **kwargs)[source]¶Class representing a connection object. Each desired connection to separate CIMOM should have its own connection object created. This class provides an entry point to the namespace/classes/instances/methods hierarchy present in the LMIShell.
Parameters: |
|
---|
NOTE: If interactive is set to True, LMIShell will:
LMIInstance.doc()
, LMIClass.doc()
,
LMIInstance.tomof()
and LMIMethod.tomof()
get_namespace
(namespace)[source]¶Parameters: | namespace (string) – namespace path (eg. root/cimv2) |
---|---|
Returns: | LMINamespace object |
Raises: | LMINamespaceNotFound |
namespaces
¶Returns: | list of all available namespaces |
---|
Usage: Available namespaces.
root
¶Returns: | LMINamespaceRoot object for root namespace |
---|
subscribe_indication
(**kwargs)[source]¶Subscribes to an indication. Indication is formed by 3 objects, where 2 of them (filter and handler) can be provided, if the LMIShell should not create those 2 by itself.
NOTE: Currently the call registers atexit
hook, which auto-deletes
all subscribed indications by the LMIShell.
Parameters: | kwargs (dictionary) – parameters for the indication subscription
|
---|---|
Returns: | LMIReturnValue object with rval set to True, if
indication was subscribed; False otherwise. If a error occurs, errorstr is
set to appropriate error string. |
unsubscribe_all_indications
()[source]¶Unsubscribes all the indications. This call ignores Permanent flag, which may be
provided in LMIConnection.subscribe_indication()
, and deletes all the
subscribed indications.
unsubscribe_indication
(name)[source]¶Unsubscribes an indication.
Parameters: | name (string) – indication name |
---|---|
Returns: | LMIReturnValue object with rval set to True, if
unsubscribed; False otherwise |
uri
¶Returns: | URI of the CIMOM |
---|---|
Return type: | string |
use_cache
(active=True)[source]¶Sets a bool flag, which defines, if the LMIShell should use a cache.
Parameters: | active (bool) – whether the LMIShell’s cache should be used |
---|
verify_credentials
()[source]¶Verifies credentials by performing a “dummy” GetClass()
call on
“SomeNonExistingClass”. Provided credentials are OK, if the LMIShell
obtains pywbem.CIMError
exception with the flag
CIM_ERR_NOT_FOUND
set. Otherwise, the should receive
pywbem.AuthError
.
Returns: | LMIReturnValue object with rval set to True, if
the user was properly authenticated; False otherwise. In case of any
error, rval is set to False and errorstr contains appropriate error
string. |
---|---|
Return type: | LMIReturnValue |
LMIConnection.
connect
(uri, username='', password='', **kwargs)[source]¶Creates a connection object with provided URI and credentials.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
NOTE: If interactive is set to True, LMIShell will:
LMIInstance.doc()
,
LMIClass.doc()
, LMIInstance.tomof()
and
LMIMethod.tomof()
Usage: Establish a connection.