LMIInstance¶
- class lmi.shell.LMIInstance.LMIInstance(conn, lmi_class, cim_instance)[source]¶
LMI wrapper class representing wbem.CIMInstance.
Parameters: - conn (LMIConnection) – connection object
- lmi_class (LMIClass) – wrapped creation class of the instance
- cim_instance (CIMInstance) – wrapped object
- associator_names(self_wr, *args, **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.
- 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).
- 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.
- 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.
Returns: list of associated LMIInstanceName objects
Raises: Usage: Associated Instance Names.
- associators(self_wr, *args, **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.
- 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).
- 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.
- 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.
- 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.
- IncludeClassOrigin (bool) – bool flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object.
- 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.
Returns: list of associated LMIInstance objects
Raises: Usage: Associated Instances.
- 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
- delete(self_wr, *args, **kwargs)[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(self_wr, *args, **kwargs)[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(self_wr, *args, **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.
- 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).
- 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.
- 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.
- 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.
- IncludeClassOrigin (bool) – bool flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object.
- 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.
Returns: first associated LMIInstance
Raises: Usage: Associated Instances.
- first_associator_name(self_wr, *args, **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.
- 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).
- 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.
- 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.
Returns: first associated LMIInstanceName object
Raises: Usage: Associated Instance Names.
- first_reference(self_wr, *args, **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).
- 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.
- 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.
- IncludeClassOrigin (bool) – flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object.
- 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.
Returns: first association LMIInstance object
Raises: Usage: Association Instances.
- first_reference_name(self_wr, *args, **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).
- 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.
Returns: first association LMIInstanceName object
Raises: Usage: Association Instance Names.
- methods(self_wr, *args, **kwargs)[source]¶
Returns a list of wbem.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 wbem.CIMInstance methods’ names Raises: LMIDeletedObjectError Usage: Instance Methods.
- 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 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.
Returns: LMIInstanceName object Raises: LMIDeletedObjectError
- print_methods(self_wr, *args, **kwargs)[source]¶
Prints out the list of wbem.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(self_wr, *args, **kwargs)[source]¶
Prints out the list of wbem.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(self_wr, *args, **kwargs)[source]¶
Returns a list of wbem.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 wbem.CIMInstance properties Return type: list Raises: LMIDeletedObjectError Usage: Instance Properties.
- properties_dict(self_wr, *args, **kwargs)[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 wbem.CIMInstance properties Raises: LMIDeletedObjectError
- property_value(self_wr, *args, **kwargs)[source]¶
Returns a wbem.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) – wbem.CIMInstance property name Raises: LMIDeletedObjectError
- push(self_wr, *args, **kwargs)[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 True, if modified; False otherwise Raises: LMIDeletedObjectError Usage: Instance Properties.
- reference_names(self_wr, *args, **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).
- 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.
Returns: list of association LMIInstanceName objects
Raises: Usage: Association Instance Names.
- references(self_wr, *args, **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).
- 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.
- 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.
- IncludeClassOrigin (bool) – flag indicating, if the CLASSORIGIN attribute shall be present on all appropriate elements in each returned object.
- 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.
Returns: list of association LMIInstance objects
Raises: Usage: Association Instances.
- refresh(self_wr, *args, **kwargs)[source]¶
Retrieves a new wbem.CIMInstance object. Basically refreshes the object properties. Returns LMIReturnValue with rval set to 0, if the wrapped wbem.CIMInstance object was refreshed; otherwise rval is set to -1.
NOTE: If the method LMIInstance.delete() was called, this method will not execute its code and will return LMIReturnValue object containing -1 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 refreshed; -1 otherwise Raises: LMIDeletedObjectError Usage: Instance refreshing.
- tomof(self_wr, *args, **kwargs)[source]¶
Prints out a message with MOF representation of wbem.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