:py:class:`.LMIInstanceName` is a object, which holds a set of primary keys and their values. This type of object exactly identifies an instance.
To get a list of key properties, see following example:
> instance_name.print_key_properties()
...
> instance_name.key_properties()
...
> instance_name.SomeKeyProperty
...
>
A single instance can be removed from the CIMOM by executing:
> instance_name.delete()
True
>
NOTE: After executing the :py:meth:`.LMIInstanceName.delete` method, all the object key properties, methods will become inaccessible.
Deletion of the instance can be verified by:
> instance_name.is_deleted
True
>
This type of object may be returned from a method call. Each instance name can be converted into the instance, see next example:
> instance = instance_name.to_instance()
>
Following part describes :py:class:`.LMIInstanceName` useful properties.
The property returns a string representation of the class name. See next example:
> instance_name.classname
ClassName
>
The property returns a string representation of namesapce. See next example:
> instance_name.namespace
Namespace
>
This property returns a string representation of the host name, where the CIM instance is located.
> instance_name.hostname
Hostname
>
This property returns a connection object, which was used to retrieve the instance name (refer to :ref:`startup_connection`). See next example:
> instance.connection
LMIConnection(URI='uri', user='user'...)
>
This property returns a wrapped :py:mod:`lmiwbem` object. See the example:
> instance.wrapped_object
CIMInstanceName(classname='ClassName', keybindings=NocaseDict(...), host='hostname', namespace='namespace')
>