6.5

Table Of Contents
vSphere SDK for Perl Programming Guide
40 VMware, Inc.
my $memory = MethodActionArgument->new(
value => PrimType->new(0, 'boolean')
);
my $quiesce = MethodActionArgument->new(
value => PrimType->new(0, 'boolean')
);
YouusetheMethodActionArgumentobjectsintheorderdefinedinthepositionalAPI,notwiththeusual
name => $valuesyntax.Youcanthensupplythefourvaluesdefinedaboveasargumentsto
CreateSnapshot().
my $snapshot_action = MethodAction->new(
name => "CreateSnapshot",
argument => [
$name,
$description,
$memory,
$quiesce
]
);
Thecompleteexampleisin /samples/scheduled_task/vm_snapshot_schedule.pl(Linux)andin
VMware vSphere CLI\Perl\samples\scheduled_task\vm_snapshot_schedule.pl(Windows).
Using Advanced Subroutines
vSphereSDKforPerlincludesonesubroutine,Opts::get_config().
Opts::get_config()
DetermineswhetheraconfigurationfilewasreadwhenvSphereSDKforPerlexecutedOpts::parse().
Thissubroutinehasnoparameters.
Returns
Ifaconfigurationfilewassuccessfullyopened,Opts::get_config()returnsthepathtoit.Ifno
configurationfilewasfound,orifitcouldnotbeopened,Opts::get_config()returnsundef.