LMIInstance Package

class LMIInstance.LMIInstance(conn, lmi_class, cim_instance)[source]

LMI wrapper class representing CIMInstance.

Parameters:
  • conn (LMIConnection) – connection object
  • lmi_class (LMIClass) – wrapped creation class of the instance
  • cim_instance (CIMInstance) – wrapped object
associator_names(**kwargs)[source]

Returns a list of associated LMIInstanceName with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • AssocClass (string) – valid CIM association class name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an instance of this class or one of its subclasses. Default value is None.
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be either an instance of this class (or one of its subclasses) or be this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an association in which the source object plays the specified role. That is, the name of the property in the association class that refers to the source object shall match the value of this parameter. Default value is None.
  • ResultRole (string) – valid property name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an association in which the named returned object plays the specified role. That is, the name of the property in the association class that refers to the returned object shall match the value of this parameter. Default value is None.
Returns:

list of associated LMIInstanceName objects

Raises :

LMIDeletedObjectError

Usage: Associated Instance Names.

associators(**kwargs)[source]

Returns a list of associated LMIInstance objects with this instance.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • AssocClass (string) – valid CIM association class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated to the source object through an instance of this class or one of its subclasses. Default value is None.
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be either an instance of this class (or one of its subclasses) or be this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated with the source object through an association in which the source object plays the specified role. That is, the name of the property in the association class that refers to the source object shall match the value of this parameter. Default value is None.
  • ResultRole (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated to the source object through an association in which the returned object plays the specified role. That is, the name of the property in the association class that refers to the returned object shall match the value of this parameter. Default value is None.
  • IncludeQualifiers (bool) – bool flag indicating, if all qualifiers for each object (including qualifiers on the object and on any returned properties) shall be included as <QUALIFIER> elements in the response. Default value is False.
  • IncludeClassOrigin (bool) – bool flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object. Default value is False.
  • PropertyList (list) – if not None, the members of the array define one or more property names. Each returned object shall not include elements for any properties missing from this list. If PropertyList is an empty list, no properties are included in each returned object. If it is None, no additional filtering is defined. Default value is None.
Returns:

list of associated LMIInstance objects

Raises :

LMIDeletedObjectError

Usage: Associated Instances.

delete()[source]

Deletes this instance from the CIMOM.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:True, if the instance is deleted; False otherwise
Raises :LMIDeletedObjectError

Usage: Instance deletion.

doc()[source]

Prints out pretty verbose message with documentation for the instance. 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.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Raises :LMIDeletedObjectError
first_associator(**kwargs)[source]

Returns the first associated LMIInstance with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • AssocClass (string) – valid CIM association class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated to the source object through an instance of this class or one of its subclasses. Default value is None.
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be either an instance of this class (or one of its subclasses) or be this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated with the source object through an association in which the source object plays the specified role. That is, the name of the property in the association class that refers to the source object shall match the value of this parameter. Default value is None.
  • ResultRole (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall be associated to the source object through an association in which the returned object plays the specified role. That is, the name of the property in the association class that refers to the returned object shall match the value of this parameter. Default value is None.
  • IncludeQualifiers (bool) – bool flag indicating, if all qualifiers for each object (including qualifiers on the object and on any returned properties) shall be included as <QUALIFIER> elements in the response. Default value is False.
  • IncludeClassOrigin (bool) – bool flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object. Default value is False.
  • PropertyList (list) – if not None, the members of the array define one or more property names. Each returned object shall not include elements for any properties missing from this list. If PropertyList is an empty list, no properties are included in each returned object. If it is None, no additional filtering is defined. Default value is None.
Returns:

first associated LMIInstance

Raises :

LMIDeletedObjectError

Usage: Associated Instances.

first_associator_name(**kwargs)[source]

Returns the first associated LMIInstanceName with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • AssocClass (string) – valid CIM association class name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an instance of this class or one of its subclasses. Default value is None.
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be either an instance of this class (or one of its subclasses) or be this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an association in which the source object plays the specified role. That is, the name of the property in the association class that refers to the source object shall match the value of this parameter. Default value is None.
  • ResultRole (string) – valid property name. It acts as a filter on the returned set of names by mandating that each returned name identify an object that shall be associated to the source object through an association in which the named returned object plays the specified role. That is, the name of the property in the association class that refers to the returned object shall match the value of this parameter. Default value is None.
Returns:

first associated LMIInstanceName object

Raises :

LMIDeletedObjectError

Usage: Associated Instance Names.

first_reference(**kwargs)[source]

Returns the first association LMIInstance with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be an instance of this class (or one of its subclasses) or this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall refer to the target object through a property with a name that matches the value of this parameter. Default value is None.
  • IncludeQualifiers (bool) – flag indicating, if all qualifiers for each object (including qualifiers on the object and on any returned properties) shall be included as <QUALIFIER> elements in the response. Default value is False.
  • IncludeClassOrigin (bool) – flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object. Default value is False.
  • PropertyList (list) – if not None, the members of the list define one or more property names. Each returned object shall not include elements for any properties missing from this list. If PropertyList is an empty list, no properties are included in each returned object. If PropertyList is None, no additional filtering is defined. Default value is None.
Returns:

first association LMIInstance object

Raises :

LMIDeletedObjectError

Usage: Association Instances.

first_reference_name(**kwargs)[source]

Returns the first association LMIInstanceName with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of object names by mandating that each returned Object Name identify an instance of this class (or one of its subclasses) or this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of object names by mandating that each returned object name shall identify an object that refers to the target instance through a property with a name that matches the value of this parameter. Default value is None.
Returns:

first association LMIInstanceName object

Raises :

LMIDeletedObjectError

Usage: Association Instance Names.

methods()[source]

Returns a list of CIMInstance methods’ names.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:list of CIMInstance methods’ names
Raises :LMIDeletedObjectError

Usage: Instance Methods.

print_methods()[source]

Prints out the list of CIMInstance methods’ names.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Raises :LMIDeletedObjectError

Usage: Instance Methods.

print_properties()[source]

Prints out the list of CIMInstance properties.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Raises :LMIDeletedObjectError

Usage: Instance Properties.

properties()[source]

Returns a list of CIMInstance properties.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:list of CIMInstance properties
Return type:list
Raises :LMIDeletedObjectError

Usage: Instance Properties.

properties_dict()[source]

Returns dictionary containing property name and value pairs. This method may consume significant memory amount when called.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty dictionary. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:dictionary of CIMInstance properties
Raises :LMIDeletedObjectError
property_value(prop_name)[source]

Returns a CIMInstance property value.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:prop_name (string) – CIMInstance property name
Raises :LMIDeletedObjectError
push()[source]

Pushes the modified object to the CIMOM.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return LMIReturnValue object containing False as a return value with proper error string set. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:LMIReturnValue object with rval set to 0, if modified; -1 otherwise
Raises :LMIDeletedObjectError

Usage: Instance Properties.

reference_names(**kwargs)[source]

Returns a list of association LMIInstanceName objects with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of object names by mandating that each returned Object Name identify an instance of this class (or one of its subclasses) or this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of object names by mandating that each returned object name shall identify an object that refers to the target instance through a property with a name that matches the value of this parameter. Default value is None.
Returns:

list of association LMIInstanceName objects

Raises :

LMIDeletedObjectError

Usage: Association Instance Names.

references(**kwargs)[source]

Returns a list of association LMIInstance objects with this object.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty list. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Parameters:
  • ResultClass (string) – valid CIM class name. It acts as a filter on the returned set of objects by mandating that each returned object shall be an instance of this class (or one of its subclasses) or this class (or one of its subclasses). Default value is None.
  • Role (string) – valid property name. It acts as a filter on the returned set of objects by mandating that each returned object shall refer to the target object through a property with a name that matches the value of this parameter. Default value is None.
  • IncludeQualifiers (bool) – flag indicating, if all qualifiers for each object (including qualifiers on the object and on any returned properties) shall be included as <QUALIFIER> elements in the response. Default value is False.
  • IncludeClassOrigin (bool) – flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object. Default value is False.
  • PropertyList (list) – if not None, the members of the list define one or more property names. Each returned object shall not include elements for any properties missing from this list. If PropertyList is an empty list, no properties are included in each returned object. If PropertyList is None, no additional filtering is defined. Default value is None.
Returns:

list of association LMIInstance objects

Raises :

LMIDeletedObjectError

Usage: Association Instances.

refresh()[source]

Retrieves a new CIMInstance object. Basically refreshes the object properties. Returns LMIReturnValue with rval set to True, if the wrapped CIMInstance object was refreshed; otherwise rval is set to False.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return LMIReturnValue object containing False as a return value with proper error string set. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:LMIReturnValue object with rval set to True, if refreshed; False otherwise
Raises :LMIDeletedObjectError

Usage: Instance refreshing.

tomof()[source]

Prints out a message with MOF representation of CIMMethod. 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.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Raises :LMIDeletedObjectError
classname[source]

Property returning a string of a class name.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty string. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:class name
Return type:string
Raises :LMIDeletedObjectError
copy()[source]
Returns:copy of itself
is_deleted[source]
Returns:True, if the instance was deleted from the CIMOM; False otherwise
namespace[source]

Property retuning a string of a namespace name.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return an empty string. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:namespace name
Return type:string
Raises :LMIDeletedObjectError
path[source]

Property returning a LMIInstanceName objec5.

NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return None. If the shell uses exceptions, LMIDeletedObjectError will be raised.

Returns:LMIInstanceName object
Raises :LMIDeletedObjectError
wrapped_object[source]
Returns:wrapped CIMInstance object

This Page