Software Development Kit (SDK) and API Discussions

PowerShell module with cDot and Fpolicy

ChannelTapeFibre
6,040 Views

Hi,

I'm sure I posted this a few hours, if it turns up as a duplicate perhaps the mods can remove it.

 

Anyway, I'm looking for the cmdlets to manage Fpolicy in cDOT. I've found the cmdlets for 7-mode, but there doesn't seem to be any exact counterpart for the Nc-* ones.

 

I looked under Nc-Vserver, but nothing obvious. Could someone point me in the right direction?

1 ACCEPTED SOLUTION

asulliva
5,912 Views

That behavior is/was a result of the switch to the single "unified" toolkit deployer...where both ONTAP and E-Series modules were packaged together in a single installer.

 

Glad you were able to get it straightened out!

 

Andrew

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

View solution in original post

6 REPLIES 6

asulliva
6,015 Views

Hello @ChannelTapeFibre,

 

There are a number of cmdlets for managing Fpolicies with ONTAP.  You can view all of them using the Get-Command cmdlet:

 

Get-Command -Module DataONTAP | ?{ $_.Name -match "NcFpolicy" }

CommandType     Name                                               Version    Source                                                                                                                        
-----------     ----                                               -------    ------                                                                                                                        
Cmdlet          Connect-NcFpolicyServer                            4.0.0      dataontap                                                                                                                     
Cmdlet          Disable-NcFpolicyPolicy                            4.0.0      dataontap                                                                                                                     
Cmdlet          Disconnect-NcFpolicyServer                         4.0.0      dataontap                                                                                                                     
Cmdlet          Enable-NcFpolicyPolicy                             4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyEvent                                 4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyExternalEngine                        4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyPassthroughReadConnection             4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyPolicy                                4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyScope                                 4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyServerStatus                          4.0.0      dataontap                                                                                                                     
Cmdlet          Get-NcFpolicyStatus                                4.0.0      dataontap                                                                                                                     
Cmdlet          New-NcFpolicyEvent                                 4.0.0      dataontap                                                                                                                     
Cmdlet          New-NcFpolicyExternalEngine                        4.0.0      dataontap                                                                                                                     
Cmdlet          New-NcFpolicyPolicy                                4.0.0      dataontap                                                                                                                     
Cmdlet          New-NcFpolicyScope                                 4.0.0      dataontap                                                                                                                     
Cmdlet          Remove-NcFpolicyEvent                              4.0.0      dataontap                                                                                                                     
Cmdlet          Remove-NcFpolicyExternalEngine                     4.0.0      dataontap                                                                                                                     
Cmdlet          Remove-NcFpolicyPolicy                             4.0.0      dataontap                                                                                                                     
Cmdlet          Remove-NcFpolicyScope                              4.0.0      dataontap                                                                                                                     
Cmdlet          Set-NcFpolicyEvent                                 4.0.0      dataontap                                                                                                                     
Cmdlet          Set-NcFpolicyExternalEngine                        4.0.0      dataontap                                                                                                                     
Cmdlet          Set-NcFpolicyPolicy                                4.0.0      dataontap                                                                                                                     
Cmdlet          Set-NcFpolicyScope                                 4.0.0      dataontap  

Alternatively, you can use the Get-NcCommand cmdlet from the PSTK:

 

Get-NcCommand -Category FPolicy | Format-Table -AutoSize

Hope that helps.

 

Andrew

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

ChannelTapeFibre
5,991 Views

Thanks for the help, but I'm still struggling:

 

PS C:\> Get-NcFpolicyStatus
Get-NcFpolicyStatus : The 'Get-NcFpolicyStatus' command was found in the module 'DataONTAP', but the module could not b
e loaded. For more information, run 'Import-Module DataONTAP'.
At line:1 char:2
+ Get-NcFpolicyStatus
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-NcFpolicyStatus:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

 

PS C:\> Get-Command -Module DataONTAP | ?{ $_.Name -match "NcFpolicy" }
PS C:\> Get-NcCommand -Category FPolicy | Format-Table -AutoSize

 

Nothing is returned.

 

PS C:\> get-help Get-NcFpolicyStatus
get-help : Get-Help could not find Get-NcFpolicyStatus in a help file in this session. To download updated help topics
type: "Update-Help". To get help online, search for the help topic in the TechNet library at http://go.microsoft.com/fw
link/?LinkID=107116.
At line:1 char:1
+ get-help Get-NcFpolicyStatus
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
+ FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

PS C:\>

 

The first error message indicates there is something found around the cmdlet Get-NcFpolicyStatus, but not much more and there is no help entry.

Could there be a problem with my version of Ontap? I'm running 8.3.2, and in another thread I read something about certain QoS cmdlets no longer available after 8.2.

asulliva
5,971 Views

If appears there are some errors loading the module: "CouldNotAutoloadMatchingModule".  Are you able to load the module manually?

 

Import-Module DataONTAP

 

Also, what version of the PSTK are you using?  You can check using the "Get-NaToolkitVersion" cmdlet.

 

Andrew

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

ChannelTapeFibre
5,936 Views

A manual import seems to work, I at least don't get any error message. I should probably point out that I've successfully used other cmdlets in my setup, such as Get-NcVol, Get-NcVserver, Get-NcAggr and Get-NcSnapmirror. As such, I don't suspect I have a problem with importing the module.

 

PS C:\> Import-Module DataONTAP

 

(nothing is returned)


PS C:\> Get-NaToolkitVersion

Major Minor Build Revision
----- ----- ----- --------
2 3 0 86

ChannelTapeFibre
5,928 Views

Ah, obviously. I was running an older version of the module. It would appear that eventhough I downloaded the latest version of the PowerShell toolkit, an older version was installed and the new install did not upgrade the version. I removed the module folder manually, and reran the installer. 

New results:

PS C:\> Get-NaToolkitVersion

Major Minor Build Revision
----- ----- ----- --------
4 0 0 231

 

Thanks for nudging me in the right direction.

 

To summarize; newer installs of the toolkit may not always upgrade existing installs.

asulliva
5,913 Views

That behavior is/was a result of the switch to the single "unified" toolkit deployer...where both ONTAP and E-Series modules were packaged together in a single installer.

 

Glad you were able to get it straightened out!

 

Andrew

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