Accepted Solution

Delete an export rule by IP address

Hey Guys,

I'm looking to create a workflow that can by initiated by VCO to remove NFS Export Rules, based on a given list of IPs. I'm certainly not an expert in either SQL or Powershell, but I do have access to co-workers that are.

I would like to have VCO provide only cluster/vserver/export_name, and a comma seperated list of IPs and then have the WFA workflow take that list of IPs, and remove them. The trouble i have is that all the WFA examples i find will only remove an export rule by rule_index. so i am thinking i should be able to create a command using powershell that will match the IP to the rule_index and then remove that rule. then loop the command for each IP address given. (i have not found a workflow that does this already)

I have found that there is a filter "filter export rules by export policy", and that seems to generate a table that relates the IPs to the rule_index. i assume i should be able to use this, but i just dont understand how to use the output i need from that filter (the rule_index) and make powershell act on it.

Completely WFA-101 i'm sure, but any help would be greatly appreciated.


Re: Delete an export rule by IP address

Got what i was missing...

$q = Get-NcExportRule -Template

$q.ClientMatch = $ClientMatch

$q.Vserver = $VserverName

$q.PolicyName = $PolicyName

$rule = Get-NcExportRule -Query $q