6.0

Table Of Contents
vSphere SDK for Perl Programming Guide
60 VMware, Inc.
Example
$client->EnumerateAssociatedInstances(
class_name => 'CIM_Foo',
selectors => \%hash;
associationclassname => 'CIM_Bar', #optional
role => 'CIM_Baz', #optional
resultclassname => 'CIM_Bat', #optional
resultrole => 'CIM_Quux', #optional
includeresult => \%hash, #optional
namespace => 'root/cimv2' #optional
EnumerateAssociatedInstanceNames
Returnsobjectswithonlythekeyvaluesoftheassociatedinstancepopulated.Theusageisthesameasfor
EnumerateAssociatedInstances.
EnumerateAssociationInstances
Returnsobjectscontainingassociationinstancesofwhichtheclassisapart.Theusageisthesameasfor
EnumerateAssociatedInstances.
EnumerateAssociationInstanceNames
Returnsobjectscontainingkeyvaluesoftheassociationinstancesofwhichtheclassisapart.Theusageisthe
sameasforEnumerateAssociatedInstances.
GetInstance
Retrievesaparticularinstanceofaclass.
Arguments
Acceptsthefollowingnamedarguments:
Returns
Printsafaultstringorreturnstheresultinahash.
role(optional) Rolethattheobjectplaysintheassociationclass.Themethodfilterstheresults
accordingtotherole.
resultclassname(optional) Resultclassname,whichmustbepresentintheassociation.Themethod
returnsonlythoseinstances.
resultrole(optional) Rolethattheresultclassplaysinthisinstance.The
methodreturnstheresults
basedonresultrole.
includeresult(optional) Furtherfiltersqueryresultsbasedonpropertiesoftheinstances.Youcanpass
inpropertiesasanamevaluehash,thenpassinareferencetothishashinthe
includeresultnamedargument.
namespace DefaultCIMnamespace.Defaultisroot/cimv2.
Ifthenamespace
isnotroot/cimv2,youmustpassinthenamespaceofthe
classinthisargument.
Argument Description
Argument Description
class_name Nameoftheclasswhoseinstanceyouwanttoretrieve,passedasastring
options KeysfortheinstanceonwhichyouwanttoperformtheGetInstanceoperation.Theargumentis
passedasareferencetoahashcontainingthekeysinnamevaluepairs.
namespace DefaultCIMnamespace.Defaultis
root/cimv2.
Ifthenamespaceisnotroot/cimv2,youmustpassinthenamespaceoftheclassinthisargument.