Associated Objects

An association from CIM perspective is a type of class that contains two or more references. Associations represent relationships between two or more classes.

Associations are classes which establish a relationship between classes without affecting any of the related classes. In other words, the addition of an association has no effect on any of the related classes.

Following text describes the means of retrieving associated objects within a given one.

Associated Instances

To get a list of associated LMIInstance objects with a given object, run following:

> associated_objects = instance.associators(
...    AssocClass=cls,
...    ResultClass=cls,
...    ResultRole=role,
...    IncludeQualifiers=include_qualifiers,
...    IncludeClassOrigin=include_class_origin,
...    PropertyList=property_lst)
> first_associated_object = instance.first_associator(
...    AssocClass=cls,
...    ResultClass=cls,
...    ResultRole=role,
...    IncludeQualifiers=include_qualifiers,
...    IncludeClassOrigin=include_class_origin,
...    PropertyList=property_lst))

NOTE: Refer to LMIInstance.associators() and LMIInstance.first_associator().

Associated Instance Names

To get a list of associated LMIInstanceName objects with a given object, run following:

> associated_object_names = instance.associator_names(
...    AssocClass=cls,
...    ResultClass=cls,
...    Role=role,
...    ResultRole=result_role)
> first_associated_object_name = instance.first_associator_name(
...    AssocClass=cls,
...    ResultClass=cls,
...    Role=role,
...    ResultRole=result_role)
>

NOTE: Refer to LMIInstance.associator_names() and LMIInstance.first_associator_name().