Subscribe
Accepted Solution

WAF - Email Output from a filter

Hello Guys,

 

I was wondering if we have a possibility to be able to Email the output of the complete filter.

 

I have a situation where I am creating a Volume and multiple qtree's with custom Quote per Qtree and then email all the qtree's within the volume so that we can have mount information for newly provisioned Shares.

 

I would really appreciate any suggestation or examples on this subject.

 

Thanks,

Sheel

Re: WAF - Email Output from a filter

Do you have a filter that currently works for what you are doing?

 

You may know this already, but that filter is nothing more than just a mySQL query. You could create a new custom powershell command to send the email, and use the 'invoke-mysqlquery' command to invoke a query against the WFA database to get the results you want.

Re: WAF - Email Output from a filter

Thanks,

 

Is it posible to create an array element from a loop or repeating row (from filter [member of a group]).

And then email the complete array element !

 

,Sheel

Re: WAF - Email Output from a filter

Another way.

Dump it in a file/playground.

Send email by retrieving the data from file/playgournd.


Regards
Abhi

Re: WAF - Email Output from a filter

I haven't tested it, but you may be able to do it within the commands by using the 'Add-WfaWorkflowParameter' command

 

$qtreedata =@()

$qtreedata += get-wfaworkflowparameter -name 'filesystemData'

$qtreedata += $Your_Qtree_Data_From_This_Command

add-wfaworkflowparameter -name 'filesystemData' -value $qtreedata

 

Then when you get to the last step you would use " get-wfaworkflowparameter -name 'filesystemData'" to get your data you wanted.

 

I haven't actually tried to overwrite an existing workflow parameter.  Let us know how it goes if you go down this route.

 

abhit's suggestion would work as well.  I have done that in the past where I dumped data out to a temp directory in a csv format.

Re: WAF - Email Output from a filter

[ Edited ]

Answering to the original question.

 

I have n alternate solution as well. Its a filter, so you must know that a filters are available at WFA REST interface. Now I can excute them and get data in my command.

 

Attaching here a fully functional sample workflow here.

 

  1. It gets data from REST Apis executing the filter.
  2. Prepares html rows as would appear in testing the filter.
  3. Send this data as email.

 

1. Import the Data Source type, and then create a Data Souce out of it. It will get you data you need. 

2. Import the filter. This is the filter I'm using

3. Import the workflow.

 

sinhaa

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: WAF - Email Output from a filter

Thanks Sinhaa,

 

This was really helpfull.

Just a follow up question with the Filter ULR.

How can i possibily provide an input to the Filer ULR, because if i dont provide an URL, i get the following error:

 

WfaException{Message: Missing filter parameter 'effective_cluster_version', Cause: javax.ejb.EJBTransactionRolledbackException: Missing filter parameter 'effective_cluster_version'}

and the URL I am ussing is : http://localhost/rest/filters/629d7946-3008-4938-917d-290aa085a8ee/test?IP=127.0.0.1

 

Thanks,

Sheel

Re: WAF - Email Output from a filter

@sheelnidhig

I didn't get what are you asking here.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: WAF - Email Output from a filter

Hello,

 

When we run any filter, we need to provide some inputs like cluster name or volume.

Like:

SELECT
volume.name,
vserver.name AS 'vserver.name',
cluster.primary_address AS 'vserver.cluster.primary_address'
FROM
cm_storage.volume,
cm_storage.vserver,
cm_storage.cluster
WHERE
vserver.id = volume.vserver_id
AND cluster.id = vserver.cluster_id
AND volume.name LIKE '${vol_name}%'
AND vserver.name = '${vserver_name}'
AND (
cluster.name = '${cluster_name}'
OR cluster.primary_address = '${cluster_name}'
)

 

In this case, if i access the filter via Rest APi, it will throw an error 

WfaException{Message: Missing filter parameter 'cluster_name', Cause: javax.ejb.EJBTransactionRolledbackException: Missing filter parameter 'cluster_name'} 

 

So is there any way to test the filter with Rest API and user input !

 

Not sure if I am able to explain my question :-(

 

,Sheel

Re: WAF - Email Output from a filter

See my filter and the command code I've used. You being the WFA workflow designer, you must see the command code to understand how it works. Also read the WFA Develper's guide and REST Primer.

 

Parameters to filters are passed like:

 

http://localhost/rest/filters/<filter_uuid>/test?param1=val1&param2=val2

 

Try it on your browser.

 

sinhaa

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.