5.0

Table Of Contents
VMware, Inc. 33
Chapter 3 vMA Interfaces
Using the VmaTargetLib Library
TheVmaTargetLib libraryallowsyoutoprogrammaticallyconnecttovMAtargetsbyusingPerlorJava.
AgentscanlinkwithVmaTargetLib
andusevifastpassfunctionality.TheVmaTargetLiblibraryallowsyou
toenablevifastpassauthenticationandtoqueryorlistoneormoretargetswiththefollowingcommands:
EnumerateTargetsRetrievesalistofallserversthatarevMAtargets.
QueryTargetRetrievesconnectioninformationforatargetserver.
LoginConnectstoatargetserver.
LogoutLogsyououtofthetargetserver.
SeetheVmaTargetLibjavalibraryforamoredetailedreferencetotheJavainterface.Youcanfindsamplesin
/opt/vmware/vma/samples.
VmaTargetLib Reference
YoucanusethefollowingVmaTargetLibcommandsinPerlorJavaprograms.
Enumerating Targets
Usage
Description
ReturnsalistoftargetvCenterServerorESXisystemsaddedtothevMAinstancebyusingvifp addserver.
Options
None
Returns
Returnsalistofalltargetservers.
Querying Targets
Usage
Description
Allowsthecaller,forexample,anagent,toretrievelogincredentialsfromavMAtargetandusethose
credentialstoconnecttothevMAtarget.
Options
Returns
ReturnsaspecificvMAtargetserver.
Perl
enumerate_targets()
Java
enumerateTargets()
Perl
query_target (<servername>)
Java
queryTarget (string <servername>)
Option Description
servername OneoftheserversaddedtothisvMAinstanceusingvifp addserver.CanbeanESXihostor
avCenterServersystem.