Perl SDK Module: ZoomVantage

Name

ZoomVantage – Helper methods to interact with Vantage

Dependencies

Ensure the Perl SDK is setup.

Synopsis

use ZoomVantage;
my $jobId = ZoomVantage::submitFileToVantage($wfId, $in, $jobName, $outpathkey, $params_href); 

Methods

getVantageWorkflowId

Usage: getVantageWorkflowId($workflowName)

Given a valid vantage workflow name, returns the corresponding workflow id

my $workflowId = ZoomVantage::getVantageWorkflowId('Hires Ingest');

submitFileToVantage

Usage: submitFileToVantage($wfId, $in, $jobName, $outpathkey, $params_href)

Submits the input file to Vantage for processing. On successful submission returns the job id, otherwise undef

my $jobId = ZoomVantage::submitFileToVantage($wfId, $in, $jobName, $outpathkey, $params_href);
Where,
$wfid - Vantage Workflow id
$in - Input file path
$jobName - Job Name which will be displayed in Vantage job monitoring
$outpathkey - Variable name used by Vantage to determine the output file path
$params_href - Hashmap reference to a table of variables with key matching Vantage variable name

getJobState

Usage: getJobState($jobId)

Given a vantage job id, returns the status of the job. Job status can be any of Active | Failed | StoppedByUser | Complete | WaitingToRetry | Waiting

my $jobId = ZoomVantage::submitFileToVantage($wfId, $in, $jobName, $outpathkey, $params_href);
my $jobStatus = ZoomVantage::getJobState($jobId);

getSessions

Usage: getSessions($jobId)

Given a job id, returns a map of all the sessions specific to the job and its session id. Use this subroutine to lookup session id by description

my $sessionDesc2Id_href = ZoomVantage::getSessions($jobId);
if($sessionDesc2Id_href){
  my $sessionId = $sessionDesc2Id_href->{'Zoom-deploy'};
}

getSessionVariables

Usage: getSessionVariables($sessionId)

Given a session id, returns a map of the session’s variables and its corresponding values. This includes the list of variables set while submitting file to vantage along with its values

getWorkflowVariableRequirements

Usage: getWorkflowVariableRequirements($workflowId)

Returns the variables required for the input workflow in the form of XML DOM that can be manipulated using XPath and DOM API

my ($dom,$xc) = ZoomVantage::getWorkflowVariableRequirements($workflowId);

setWorkflowVariables

Usage: setWorkflowVariables($workflowId, $params_href)

For a given workflow, sets vantage variables with its respective values required for processing a file. Used with getWorkflowVariableRequirements before submitting a file to Vantage

my $ctxDom = ZoomVantage::setWorkflowVariables($workflowId, $params_href);

extractSingleValueFromXMLResponse

Usage: extractSingleValueFromXMLResponse($namespace, $xpath, $response)

Given a XML response and xpath as input, returns the first matching value. Used when the xpath is expected to return a single value

extractValueListFromXMLResponse

Usage: extractValueListFromXMLResponse($namespace, $xpath, $response)

Given a XML response and xpath as input, returns a list of matching values

my $sids_aref = ZoomVantage::extractValueListFromXMLResponse($namespace, $xpath, $response);

pathForVantage

Usage: pathForVantage($inPath)

Translates the given path relative to vantage mount

my $vantagePath = ZoomVantage::pathForVantage($inPath);
Below fields should be set in config.ini
[VANTAGE]
inPathPrefix = Prefix to $inPath
outPathMount = Prefix to Vantage Location

executeRestURL

Usage: executeRestURL($requestType, $url, \%request_params)

Given a URI and its parameters, queries the vantage REST server and returns response in XML format. If required, use extractSingleValueFromXMLResponse and extractValueListFromXMLResponse to parse the response.

my %params = (identifier => $jobId);
my ($rv, $response) = executeRestURL("GET", "/JobRest/GetSessionsForJob",\%params );

Leave a Comment