Instance Names

LMIInstanceName is a object, which holds a set of primary keys and their values. This type of object exactly identifies an instance.

Key properties

To get a list of key properties, see following example:

> instance_name.print_key_properties()
...
> instance_name.key_properties()
...
> instance_name.SomeKeyProperty
...
>

Instance Names deletion

A single instance can be removed from the CIMOM by executing:

> instance_name.delete()
True
>

NOTE: After executing the 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
>

Conversion to a LMIInstance

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()
>

Useful Properties

Following part describes LMIInstanceName useful properties.

Class Name

The property returns a string representation of the class name. See next example:

> instance_name.classname
ClassName
>

Namespace

The property returns a string representation of namesapce. See next example:

> instance_name.namespace
Namespace
>

Host Name

This property returns a string representation of the host name, where the CIM instance is located.

> instance_name.hostname
Hostname
>

Connection Object

This property returns a connection object, which was used to retrieve the instance name (refer to Establish a connection). See next example:

> instance.connection
LMIConnection(URI='uri', user='user'...)
>

Wrapped Object

This property returns a wrapped wbem object. See the example:

> instance.wrapped_object
CIMInstanceName(classname='ClassName', keybindings=NocaseDict(...), host='hostname', namespace='namespace')
>