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

Class CIMInstanceName

source code

                   object --+    
                            |    
cim_types._CIMComparisonMixin --+
                                |
                               CIMInstanceName

A CIM instance path (aka instance name).

A CIM instance path references a CIM instance in a namespace in a WBEM server. Namespace and WBEM server may be unknown.

This object can be used like a dictionary to retrieve the key bindings.

Instance Methods
 
__init__(self, classname, keybindings=None, host=None, namespace=None)
Initialize the CIMInstanceName object.
source code
 
copy(self)
Return a copy of the CIMInstanceName object
source code
 
__str__(self)
Return string representation of CIMClassname in readable format
source code
 
__repr__(self)
return string of CIMClassName in name=value form
source code
 
__getitem__(self, key) source code
 
__contains__(self, key) source code
 
__delitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__len__(self)
Return number of keybindings
source code
 
has_key(self, key)
Return boolean.
source code
 
keys(self)
Return list of keys in keybindings
source code
 
values(self)
Return keybinding values
source code
 
items(self) source code
 
iterkeys(self) source code
 
itervalues(self) source code
 
iteritems(self) source code
 
update(self, *args, **kwargs) source code
 
get(self, key, default=None)
Get the value of a specific key property, or the specified default value if a key binding with that name does not exist.
source code
 
tocimxml(self)
Generate a CIM-XML representation of the instance name (class name and key bindings).
source code

Inherited from cim_types._CIMComparisonMixin: __eq__, __ge__, __gt__, __le__, __lt__, __ne__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

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

Inherited from object: __class__

Method Details

__init__(self, classname, keybindings=None, host=None, namespace=None)
(Constructor)

source code 
Initialize the CIMInstanceName object.
Parameters:
  • classname (Unicode string or UTF-8 encoded byte string) - Name of the creation class of the referenced instance.
  • keybindings (dict or NocaseDict) - Optional: Dictionary of key bindings, specifying key properties that identify the referenced instance. The dictionary must contain one item for each key property, where:

    • its key is the property name.
    • its value is the property value, as a CIM typed value as described in cim_types.

    If None, an empty dictionary of key bindings will be created.

    Default: None.

  • host (Unicode string or UTF-8 encoded byte string) - Optional: URL of the WBEM server that contains the CIM namespace of this instance path.

    If None, the instance path will not specify a WBEM server.

    Default: None.

  • namespace (Unicode string or UTF-8 encoded byte string) - Optional: Name of the CIM namespace that contains the referenced instance.

    If None, the instance path will not specify a CIM namespace.

    Default: None.

Raises:
  • TypeError
  • ValueError
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
Return string representation of CIMClassname in readable format
Overrides: object.__str__

__repr__(self)
(Representation operator)

source code 
return string of CIMClassName in name=value form
Overrides: object.__repr__

has_key(self, key)

source code 
Return boolean. True if key is in keybindings