6.0
Table Of Contents
- vSphere SDK for Perl Programming Guide
- Contents
- Getting Started with vSphere SDK for Perl
- Writing vSphere SDK for Perl Scripts
- Refining vSphere SDK for Perl Scripts
- Creating and Using Filters
- Filtering Views Selectively Using Properties
- Retrieving the ServiceInstance Object on a vSphere Host
- Saving and Using Sessions
- Using Multiple Sessions
- Learning About Object Structure Using Data::Dumper
- Specifying Untyped Arguments in Scheduled Tasks and Callbacks
- Using Advanced Subroutines
- vSphere SDK for Perl Subroutine Reference
- Web Services for Management Perl Library
- Credential Store Perl Library
VMware, Inc. 3
Contents
AboutThisBook 7
RevisionHistory 7
IntendedAudience 7
1 GettingStartedwithvSphere SDK for Perl 9
vSphereSDKforPerlArchitecture 9
UsingvSphereSDKforPerl 10
GettingStarted 10
CommonvSphereSDKforPerlTasks 11
vSphereSDKforPerlProgrammingConventions 11
vSphereSDKforPerlCommonOptions 12
SpecifyingOptions 12
AuthenticatingThroughvCenterServerandvCenterSingleSign‐On 13
Example 13
UsingaSessionFile 13
PassingParametersattheCommandLine 14
SettingEnvironmentVariables 14
Usinga
ConfigurationFile 15
UsingMicrosoftWindowsSecuritySupportProviderInterface(SSPI) 15
CommonOptionsReference 16
HelloHost:RunningYourFirstScript 17
2 WritingvSphereSDKforPerlScripts 19
BasicvSphereSDKforPerlScript 19
Step1:ImportthevSphereSDKforPerlModules 20
Step2:(Optional)DefineScript‐SpecificCommand‐LineOptions 20
Step3:ConnecttotheServer 22
Step4:ObtainViewObjectsofServer‐SideManagedObjects 22
Step5:ProcessViewsandReportResults 22
Step6:ClosetheServerConnection 23
Understanding
Server‐SideObjects 24
UsetheManagedObjectBrowsertoExploreServer‐SideObjects 24
TypesofManagedObjectsandtheManagedObjectHierarchy 25
ManagedObjectHierarchy 26
ManagedEntitiesintheInventory 26
AccessingServer‐SideInventoryObjects 27
UnderstandingPerlViewObjects 28
WorkingwithViewObjectPropertyValues 28
AccessingPropertyValues 28
AccessingSimplePropertyValues 29
AccessingEnumerationPropertyValues 29
ModifyingPropertyValues 29
CreatingDataObjectswithProperties 30
UnderstandingOperationsandMethods 30
Non‐BlockingandBlockingMethods 30
ExamplesofOperations 31
CallingMethods 31