Package pywbem :: Module cim_obj :: Class CIMInstance |
[frames] | no frames]

# Class CIMInstance

source code

    object --+
             |
            CIMInstance

A CIM instance, optionally including its instance path.

This object can be used like a dictionary to retrieve the property values.

Instance Methods
__init__(self, classname, properties=`{``}`, qualifiers=`{``}`, path=None, property_list=None) Initialize the CIMInstance object. | source code
None |
update(D, E, **F) Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k] | source code
update_existing(self, *args, **kwargs) Update property values iff the property previously exists. | source code
copy(self) | source code
__cmp__(self, other) | source code
__repr__(self) repr(x) | source code
__contains__(self, key) | source code
__getitem__(self, key) | source code
__delitem__(self, key) | source code
__len__(self) | source code
has_key(self, key) | source code
keys(self) | source code
values(self) | source code
items(self) | source code
iterkeys(self) | source code
itervalues(self) | source code
iteritems(self) | source code
__setitem__(self, key, value) | source code
get(self, key, default=None) Get the value of a specific property, or the specified default value if a property with that name does not exist. | source code
tocimxml(self) | source code
tomof(self) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Instance Variables
| ... All parameters of __init__ are set as instance variables.

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, classname, properties=`{``}`, qualifiers=`{``}`, path=None, property_list=None) (Constructor) | source code
Initialize the CIMInstance object. Parameters: `classname` (`unicode` or UTF-8 encoded `str`) - Name of the creation class of the instance. `properties` (`dict` or NocaseDict) - Optional: Dictionary of properties, specifying property values of the instance. The dictionary must contain one item for each property, where: its key is the property name. its value is a CIMProperty object representing the property value. `qualifiers` (`dict` or NocaseDict) - Optional: Dictionary of qualifier values of the instance. Note that CIM-XML has deprecated the presence of qualifier values on CIM instances. `path` (CIMInstanceName) - Optional: Instance path of the instance. If `None`, the instance is not addressable or the instance path is unknown or not needed. Default: `None`. `property_list` (list of strings) - Optional: List of property names for use by some operations on this object. Raises: `TypeError` `ValueError` Overrides: object.__init__

### update_existing(self, *args, **kwargs) | source code
Update property values iff the property previously exists. Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k] Like update, but properties that are not already present in the instance are skipped.

### __repr__(self) (Representation operator) | source code
repr(x) Overrides: object.__repr__ (inherited documentation)