<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OnCommand WFA Workflow to update or delete export rule cdot in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125740#M22570</link>
    <description>&lt;P&gt;1. There is a Create Export Rule command in WFA which is precanned. This will help you in adding. You have to develop a command to delete the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Creates an Export rule configuration. If the specified policy does not exist, the "Create CM export rule"&amp;#157; command will create the export policy in the given cluster/Storage Virtual Machine and then create the export rules in the new policy with the specified parameters."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. In the playground DB you need to add the list of workstations. In the user inputs you need to take care which workstation will be able to access what kind of exports.&lt;/P&gt;&lt;P&gt;This will have to taken care via SQL queries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Abhi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2016 08:25:47 GMT</pubDate>
    <dc:creator>abhit</dc:creator>
    <dc:date>2016-11-29T08:25:47Z</dc:date>
    <item>
      <title>OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125691#M22561</link>
      <description>&lt;P&gt;IHAC that is new to cDOT (8.3.x) and WFA. They are looking to create RBAC process to allow certain users to either add or delete export rules to an existing export policy on select SVMs. I'm not sure how to create. Does anyone already have this created in WFA and that can share with me please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2016 14:29:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125691#M22561</guid>
      <dc:creator>LucasVDP</dc:creator>
      <dc:date>2016-11-27T14:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125695#M22562</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;A href="https://community.netapp.com/t5/OnCommand-Storage-Management-Software-Articles-and-Resources/Video-Applying-Role-Based-Access-Control-RBAC-to-your-workflows/ta-p/87676" target="_blank"&gt;https://community.netapp.com/t5/OnCommand-Storage-Management-Software-Articles-and-Resources/Video-Applying-Role-Based-Access-Control-RBAC-to-your-workflows/ta-p/87676&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 01:31:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125695#M22562</guid>
      <dc:creator>hariprak</dc:creator>
      <dc:date>2016-11-28T01:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125701#M22565</link>
      <description>&lt;P&gt;Thank. This is part of what I need. I still need the workflow to add or delete export rules. Do you have that? Again, the need is to be able to update what workstations can access an export. I don't need to create new export policies or volumes; I just need to update the existing ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 02:21:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125701#M22565</guid>
      <dc:creator>LucasVDP</dc:creator>
      <dc:date>2016-11-28T02:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125740#M22570</link>
      <description>&lt;P&gt;1. There is a Create Export Rule command in WFA which is precanned. This will help you in adding. You have to develop a command to delete the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Creates an Export rule configuration. If the specified policy does not exist, the "Create CM export rule"&amp;#157; command will create the export policy in the given cluster/Storage Virtual Machine and then create the export rules in the new policy with the specified parameters."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. In the playground DB you need to add the list of workstations. In the user inputs you need to take care which workstation will be able to access what kind of exports.&lt;/P&gt;&lt;P&gt;This will have to taken care via SQL queries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Abhi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 08:25:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125740#M22570</guid>
      <dc:creator>abhit</dc:creator>
      <dc:date>2016-11-29T08:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125790#M22580</link>
      <description>&lt;P&gt;Hi Lucas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the WFA command code to remove a client from an export policy.&lt;/P&gt;&lt;P&gt;Rather than use the playground mysql database as suggested...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd recommend you simply query the rule index matching the client (much simpler)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Param(
   [Parameter(Mandatory=$True, HelpMessage="The cluster name or IP Address")]
   [String]$ClusterName,
   [Parameter(Mandatory=$True, HelpMessage="The vserver name")]
   [String]$VserverName,
   [Parameter(Mandatory=$True, HelpMessage="The NFS export policy name")]
   [String]$PolicyName,
   [Parameter(Mandatory=$False, HelpMessage="The NFS export policy rule index number")]
   [Int]$RuleIndex,  
   [Parameter(Mandatory=$True, HelpMessage="The IP address or FQDN of the NFS client")]
   [String]$ClientMatch,
   [Parameter(Mandatory=$False, HelpMessage="The maximum number of ZAPI retry attempts")]
   [Int]$ZapiRetryCount   
)
#'------------------------------------------------------------------------------
#'Connect to cluster
#'------------------------------------------------------------------------------
Connect-WFACluster $ClusterName
#'------------------------------------------------------------------------------
#'Check if the Export Policy exists on the vserver.
#'------------------------------------------------------------------------------
Get-WFALogger -Info -Message "Enumerating export policy ""$PolicyName"" on vserver ""$VserverName"""
[String]$command = "Get-NcExportPolicy -VserverContext $VserverName -Name $PolicyName -ErrorAction Stop"
Try{
   $policy = Invoke-Expression -Command $command -ErrorAction Stop
   Get-WFALogger -Info -Message "Executed Command`: $command"
}Catch{
   Get-WFALogger -Error -Message $("Failed Executing Command`: $command. Error " + $_.Exception.Message)
   Throw "Failed enumerating export policy ""$PolicyName"" on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
#'Raise an error if the export policy does not exist.
#'------------------------------------------------------------------------------
If(-Not($policy)){
   Throw "The export policy ""$PolicyName"" does not exist on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
#'Enumerate the index number of the client in the export policy rules.
#'------------------------------------------------------------------------------
$query = Get-NcExportRule -Template
$query.ClientMatch = $ClientMatch
$query.PolicyName  = $PolicyName
$query.Vserver     = $VserverName
Try{
   $exportRules = Get-NcExportRule -Query $query -ErrorAction Stop
}Catch{
   Get-WFALogger -Error -Message $("Failed enumerating export policy rules for policy ""$PolicyName"" on vserver ""$VserverName"". Error " + $_.Exception.Message)
   Throw "Failed enumerating export policy rules for policy ""$PolicyName"" on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
#'Raise an error if the export policy rules don't exist.
#'------------------------------------------------------------------------------
If(-Not($exportRules)){
   Throw "Failed enumerating an export policy rule matching client ""$ClientMatch"" in export policy ""$PolicyName"" on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------
#'Enuemrate and set the rule index number if not provided or raise an error.
#'------------------------------------------------------------------------------
If(-Not($RuleIndex)){
   $RuleIndex = $exportRules.RuleIndex
   If($RuleIndex -eq $Null -Or $RuleIndex -eq ""){
      Throw "Failed enumerating an export policy rule matching client ""$ClientMatch"" in export policy ""$PolicyName"" on vserver ""$VserverName"""
   }
}
#'------------------------------------------------------------------------------
#'Create the command to remove the export policy rule.
#'------------------------------------------------------------------------------
[String]$command = "Remove-NcExportRule -Policy $PolicyName "
If($RuleIndex){
   [String]$command += "-Index $RuleIndex "
}
If($ZapiRetryCount){
   [String]$command += "-ZapiRetryCount $ZapiRetryCount "
}
[String]$command += "-VserverContext $VserverName -Confirm:`$False -ErrorAction Stop"
#'------------------------------------------------------------------------------
#'Execute the command to remove the export policy rule.
#'------------------------------------------------------------------------------
Try{
   Invoke-Expression -Command $command -ErrorAction Stop
   Get-WFALogger -Info -Message "Executed Command`: $command"
   Get-WFALogger -Info -Message "Removed export policy rule for ""$ClientMatch"" in export policy ""$PolicyName"" on vserver ""$VserverName"""
}Catch{
   Get-WFALogger -Error -Message $("Failed Executing Command`: $command. Error " + $_.Exception.Message)
   Throw "Failed removing export policy rule for ""$ClientMatch"" in export policy ""$PolicyName"" on vserver ""$VserverName"""
}
#'------------------------------------------------------------------------------&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 01:38:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/125790#M22580</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2016-11-30T01:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146100#M26541</link>
      <description>&lt;P&gt;I just implemented the code provided and it works great.&amp;nbsp; Thanks Matt.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 22:56:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146100#M26541</guid>
      <dc:creator>DavidSpano</dc:creator>
      <dc:date>2019-01-22T22:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146331#M26616</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've added your code as a command and it works great.&amp;nbsp;&amp;nbsp; I am struggling on one aspect though,&amp;nbsp; in my environment I can have a single clientmatch rule in multiple export policies.&amp;nbsp; I'm trying to figure out how to loop through all my export policies with the matching clientmatch rule and remove it.&amp;nbsp;&amp;nbsp; I can easily do it via a query (mult-select), but it requires the user to select the returned values.&amp;nbsp; I'm looking more for a method to loop through without user intervention.&amp;nbsp;&amp;nbsp; If there was a way to default all the multi-select options to selected I would be done, but if there is a documented way I haven't found it.&amp;nbsp; Thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 21:29:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146331#M26616</guid>
      <dc:creator>StevenB1016</dc:creator>
      <dc:date>2019-01-31T21:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: OnCommand WFA Workflow to update or delete export rule cdot</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146346#M26617</link>
      <description>&lt;P&gt;Never mind,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I finally figured it out using GROUP_CONCAT to put the query results in a CSV list and then use getValueAt to loop through the list.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:46:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/OnCommand-WFA-Workflow-to-update-or-delete-export-rule-cdot/m-p/146346#M26617</guid>
      <dc:creator>StevenB1016</dc:creator>
      <dc:date>2019-02-01T13:46:11Z</dc:date>
    </item>
  </channel>
</rss>

