If you missed the pre-registration for NetApp MS Azure AD B2C, the new login prompt will offer the option to register. Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

REST output



I'm getting in a bit of a tangle here;

I'm trying to provide output to the REST process which is calling my workflow.

<atom:link rel="out-parameter" href="http://loninasu0005.uk.db.com/rest/workflows/d50d03f0-93ca-4a34-a50a-af8fc0766fe9/out

The workflow creates ACL groups in the domain via a PoSH script and I need to pass these values back to the REST process once complete so they can be passed on to the initiator.

The ACL names are logged in a log file which takes the name of the Job ID so easy to track. So far I have been tinkering with the Return Parameters option but not getting far.

In the command I want to interogate the log file for the ACL values and return these if possible.

Any help appreciated.


Get-WFALogger -Info -message $("Triggering Provisiong command")

$output = get-host
Get-WFALogger -Info -message $output

$PSLogfile =   $(Get-WfaRestParameter "jobId")

$expression = $("c:\PROGRA~1\NetApp\WFA-Scripts\VFS_add_new_array-uat-v3.ps1 $dbArray $dbThin $dbCapacity $dbDatacentre $dbReparray $PSLogFile")

Get-WFALogger -Info -message $("Command to invoke: " + $expression)

Get-WFALogger -Info -message "ENV - $env:path "

$output = Invoke-Expression $expression

function OutVars ([string] $var)
foreach ($line in $file)
    if ($line.contains($var))
        $var = $line.substring($line.indexof(":") +2)
        return $var

$file = Get-Content c:\PROGRA~1\NetApp\WFA-PSLogs\LOG-ID-$PSLogfile.log

$aclr = OutVars "ACLR"
$aclc = OutVars "ACLC"

Add-WfaWorkflowParameter -Name ACLR -Value $aclr -AddAsReturnParameter
Add-WfaWorkflowParameter -Name ACLC -Value $aclc -AddAsReturnParameter

# print the output of the exe
Get-WFALogger -Info -message "----------------------------------------------------------------------------------"

foreach($line in $output)
        Get-WFALogger -Info -message $line

Get-WFALogger -Info -message "----------------------------------------------------------------------------------"



Do the following in order:

1. Execute the  workflow with your custom command and put logs in POSH command  for ACL to be created  e.g:

POST :  http://localhost/rest/workflows/4aa88c6d-4dd3-49da-8546-0385deca8535/jobs

with input like:



    <userInputEntry key="aggr" value="aggr1" />




2.get the job status of executed workflow here jobid is 4.

GET : http://localhost/rest/workflows/4aa88c6d-4dd3-49da-8546-0385deca8535/jobs/4

if status is completed.

3. get the log message saved during command execution. Here 4 is workflow executionID same as job id in step 1 output and 0 is the command index.

GET : http://localhost/rest/workflows/executions/4/log/0

output will be like:





        <message>### Command 'Create and configure Storage Virtual Machine' ###</message>





        <message>Executing command: ./Create_and_configure_Storage_Virtual_Machine922462921215618622.ps1 -CifsAllowed $false -Cluster -DnsDomainNames @('ctl.gdl.englab.netapp.com') -DnsServers @('') -FcpAllowed $false -IscsiAllowed $false -Language c -RootVolumeAggregate aggr_krish -RootVolumeName restTest_root -SecurityStyle unix -VserverName restTest </message>





        <message>Get-WfaCredentials -Host</message>





        <message>Credentials successfully provided for ''</message>





        <message>Connect-Controller -Type CLUSTER -Name -Credential System.Management.Automation.PSCredential -Vserver  -Timeout 60000</message>





        <message>Connect-NcController (with credentials) -Name -Timeout 60000 -ErrorAction Stop</message>


NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner