LMIClass

class lmi.shell.LMIClass.LMIClass(conn, namespace, classname)[source]

LMI wrapper class representing wbem.CIMClass.

Parameters:
  • conn (LMIConnection) – connection object
  • namespace (LMINamespace) – namespace object
  • classname (string) – CIM class name
classname[source]
Returns:class name
Return type:string
create_instance(self_wr, *args, **kwargs)[source]

Creates a new wbem.CIMInstance at the server side and returns LMIReturnValue object containing LMIInstance as a result.

Parameters:
  • properties (dictionary) – initial properties with corresponding values
  • qualifiers (dictionary) – initial qualifiers
  • property_list (list) – list of properties, which should be present in LMIInstance object

Usage: See Creating a new instance.

doc(self_wr, *args, **kwargs)[source]

Prints out pretty verbose message with documentation for the class. If the LMIShell is run in a interactive mode, the output will be redirected to a pager set by environment variable PAGER. If there is not PAGER set, less or more will be used as a fall-back.

fetch(*args, **kwargs)[source]

Manually fetches a wrapped wbem.CIMClass object.

Parameters:full_fetch (bool) – True, if wbem.CIMClass should include qualifiers and class origin. Default value is False.
Raises:CIMError, ConnectionError

Usage: See Fetching a class.

first_instance(inst_filter=None, client_filtering=False, **kwargs)[source]

Returns the first LMIInstance of the corresponding class.

Parameters:
  • inst_filter (dictionary) – filter values, where the key corresponds to the key of wbem.CIMInstance; value contains the filtering value.
  • client_filtering (bool) – if True, client-side filtering will be performed, otherwise the filtering will be done by a CIMOM. Default value is False.
  • kwargs (dictionary) –

    deprecated keyword arguments

    • Key or key – filtering key, see above
    • Value or value – filtering value, see above
Returns:

first LMIInstance object

Usage: See Get Instances and Filtering.

first_instance_name(inst_filter=None, **kwargs)[source]

Returns the first LMIInstanceName of the corresponding class.

Parameters:
  • inst_filter (dictionary) – filter values, where the key corresponds to the primary key of wbem.CIMInstanceName; value contains the filtering value
  • kwargs (dictionary) –

    deprecated keyword arguments

    • Key or key (string) – filtering key, see above
    • Value or value – filtering value, see above
Returns:

first LMIInstanceName object

Usage: See Get Instance Names and Filtering.

instance_names(self_wr, *args, **kwargs)[source]

Returns a LMIReturnValue containing a list of LMIInstanceNames.

Parameters:
  • inst_filter (dictionary) – filter values. The key corresponds to the primary key of the wbem.CIMInstanceName; value contains the filtering value
  • kwargs (dictionary) –

    deprecated keyword arguments

    • Key or key (string) – filtering key, see above
    • Value or value – filtering value, see above
Returns:

LMIReturnValue object with rval set to a list of LMIInstanceName objects

Usage: See Get Instance Names and Filtering.

instances(self_wr, *args, **kwargs)[source]

Returns a list of objects of LMIInstance.

Parameters:
  • inst_filter (dictionary) – filter values, where the key corresponds to the key of wbem.CIMInstance; value contains the filtering value
  • client_filtering (bool) – if True, client-side filtering will be performed, otherwise the filtering will be done by a CIMOM. Default value is False.
  • kwargs (dictionary) –

    deprecated keyword arguments

    • Key or key (string) – filtering key, see above
    • Value or value – filtering value, see above
Returns:

list of LMIInstance objects

Usage: See Get Instances and Filtering.

is_fetched(full_fetch=False)[source]

Returns True, if wbem.CIMClass has been fetched.

Parameters:full_fetch (bool) – defines, if qualifiers are also included
methods(self_wr, *args, **kwargs)[source]
Returns:list of strings of wbem.CIMClass methods.

Usage: See Class Methods. Note: When caching is turned off, this method may consume some time.

namespace[source]
Returns:namespace name
Return type:string
new_instance_name(keybindings)[source]
Create new LMIInstanceName object by passing all the
keys/values of the object.
Parameters:keybindings (dictionary) – primary keys of instance name with corresponding values
Returns:new LMIInstanceName object

Usage: See New Instance Name.

print_methods(self_wr, *args, **kwargs)[source]

Prints out the list of wbem.CIMClass methods.

Usage: See Class Methods.

print_properties(self_wr, *args, **kwargs)[source]

Prints out the list of wbem.CIMClass properties.

Usage: See Class Properties.

print_valuemap_properties(self_wr, *args, **kwargs)[source]

Prints out the list of string of constant names.

Usage: Get ValueMap properties.

properties(self_wr, *args, **kwargs)[source]
Returns:list of strings of the wbem.CIMClass properties

Usage: See Class Properties.

valuemap_properties(self_wr, *args, **kwargs)[source]
Returns:list of strings of the constant names

Usage: Get ValueMap properties.

wrapped_object[source]
Returns:wrapped wbem.CIMClass object