PowerShell and Perl WFA modules
You must be aware of the PowerShell or Perl modules for OnCommand Workflow Automation (WFA) to write scripts for your workflows.
PowerShell modules
| Guidelines | Example |
|---|---|
Use the Data ONTAP PS Toolkit to invoke APIs whenever the toolkit is available. |
The
|
If there are no cmdlets available in the Data ONTAP PS Toolkit, use the |
|
Perl modules
The NaServer module is used in WFA commands. The NaServer module allows the invocation of Data ONTAP APIs, which are used in active management of Data ONTAP systems.
| Guidelines | Example | ||
|---|---|---|---|
Use the NaServer module to invoke APIs whenever the NetApp Manageability SDK is available. |
The following example shows how the NaServer module is used for a resume SnapMirror operation: eval {
$wfa_util->sendLog('INFO',
"Connecting to the cluster: $DestinationCluster"
);
my $server
= $wfa_util->connect($DestinationClusterIp, $DestinationVserver);
my $sm_info = $server->snapmirror_get(
'destination-vserver' => $DestinationVserver,
'destination-volume' => $DestinationVolume
);
my $sm_state = $sm_info->{'attributes'}->{'snapmirror-info'}->{'mirror-state'};
my $sm_status = $sm_info->{'attributes'}->{'snapmirror-info'}->{'relationship-status'};
$wfa_util->sendLog('INFO',
"SnapMirror relationship is $sm_state ($sm_status)");
if ($sm_status ne 'quiesced') {
$wfa_util->sendLog('INFO',
'The status needs to be quiesced to resume transfer.');
} else {
my $result = $server->snapmirror_resume(
'destination-vserver' => $DestinationVserver,
'destination-volume' => $DestinationVolume
);
$wfa_util->sendLog('INFO', "Result of resume: $result");
$wfa_util->sendLog('INFO', 'Resume operation started successfully.');
}
}
|
||
If a Data ONTAP API is not available, invoke the Data ONTAP CLI using the executeSystemCli utility method.
|
None |