<?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 Using PowerShell Cmdlets in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29362#M251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have begun using the NetApp API and am wondering if I am missing documentation or using a lesser preferred programming language.&amp;nbsp; I initially wanted to use c# to call the API and got a test program working, but it seems that NetApp wants things to go through PowerShell.&amp;nbsp; The only sample source code is for PowerShell Cmdlets.&amp;nbsp; There is none in the current documentation for using c# directly.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I got the Cmdlet Get_VolumeListInfo from the sample in netapp-manageability-sdk-5.1-dotnet-bindings working.&amp;nbsp; The documentation in netapp-manageability-sdk-ontap-api-documentation/ontapi_1.20/7-Mode references volume-list-info and the sample uses VolumeListInfo volinput = new VolumeListInfo();. Is there better documentation for Cmdlets and c#? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In adding to the Cmdlet I can’t seem to get snapshot-list-info working.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotListInfo snapinput = new SnapshotListInfo();&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotListInfoResult snapoutput = snapinput.Invoke(Server);&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotInfo[] snapshots = snapoutput.Snapshots;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Cmdlet throws an error saying that “Either argument volume or (target-name, target-type) pair should be specified”&amp;nbsp; The documentation refers to using the volume as input, but I am not sure where to supply the volume name.&amp;nbsp; There are no samples.&amp;nbsp; Perhaps there is a slight learning curve, so my real question is if many others are using Cmdlets in c# to access the NetApp API?&amp;nbsp; I get very few results searching for things like SnapshotListInfoResult and NetApp c# api.&amp;nbsp; Is there a preferred language that most people are using?&amp;nbsp; I want the ability to do more things than I believe calling PowerShell directly can do.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 05:59:21 GMT</pubDate>
    <dc:creator>scottfoley</dc:creator>
    <dc:date>2025-06-05T05:59:21Z</dc:date>
    <item>
      <title>Using PowerShell Cmdlets</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29362#M251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have begun using the NetApp API and am wondering if I am missing documentation or using a lesser preferred programming language.&amp;nbsp; I initially wanted to use c# to call the API and got a test program working, but it seems that NetApp wants things to go through PowerShell.&amp;nbsp; The only sample source code is for PowerShell Cmdlets.&amp;nbsp; There is none in the current documentation for using c# directly.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I got the Cmdlet Get_VolumeListInfo from the sample in netapp-manageability-sdk-5.1-dotnet-bindings working.&amp;nbsp; The documentation in netapp-manageability-sdk-ontap-api-documentation/ontapi_1.20/7-Mode references volume-list-info and the sample uses VolumeListInfo volinput = new VolumeListInfo();. Is there better documentation for Cmdlets and c#? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In adding to the Cmdlet I can’t seem to get snapshot-list-info working.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotListInfo snapinput = new SnapshotListInfo();&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotListInfoResult snapoutput = snapinput.Invoke(Server);&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SnapshotInfo[] snapshots = snapoutput.Snapshots;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Cmdlet throws an error saying that “Either argument volume or (target-name, target-type) pair should be specified”&amp;nbsp; The documentation refers to using the volume as input, but I am not sure where to supply the volume name.&amp;nbsp; There are no samples.&amp;nbsp; Perhaps there is a slight learning curve, so my real question is if many others are using Cmdlets in c# to access the NetApp API?&amp;nbsp; I get very few results searching for things like SnapshotListInfoResult and NetApp c# api.&amp;nbsp; Is there a preferred language that most people are using?&amp;nbsp; I want the ability to do more things than I believe calling PowerShell directly can do.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:59:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29362#M251</guid>
      <dc:creator>scottfoley</dc:creator>
      <dc:date>2025-06-05T05:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell Cmdlets</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29366#M252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't speak for c#, but the PowerShell Cmdlets for NetApp are pretty full featured.&amp;nbsp; You can do just about anything through the PowerShell Cmdlets that you can do through OnCommand System Manager or SSH/console.&amp;nbsp; PowerShell is also pretty easy to learn.&amp;nbsp; I have never been a programmer, but I started using PowerShell a couple of years ago and have created some pretty elaborate scripts with it (for both NetApp and VMware).&amp;nbsp; Two examples are using the PowerShell Cmdlets to create both source and destination volumes, with a mirror between both (&lt;A _jive_internal="true" href="https://community.netapp.com/docs/DOC-23751" title="https://communities.netapp.com/docs/DOC-23751" target="_blank"&gt;https://communities.netapp.com/docs/DOC-23751&lt;/A&gt;) and restoring a VM from an NFS datastore using SnapRestore (&lt;A _jive_internal="true" href="https://community.netapp.com/docs/DOC-23783" title="https://communities.netapp.com/docs/DOC-23783" target="_blank"&gt;https://communities.netapp.com/docs/DOC-23783&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help files in Powershell are also built in.&amp;nbsp; If you are not sure of how a particular Cmdlet works, you can just use Get-Help &amp;lt;Cmdlet name&amp;gt;.&amp;nbsp; You can also use Get-Help &amp;lt;Cmdlet name&amp;gt; -examples to see some usage examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sample script to get snapshot info would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-NaController &amp;lt;FilerName&amp;gt; #connect to Filer&lt;/P&gt;&lt;P&gt;$vols = Get-NaVol #get a list of volumes to pass to the Get-NaSnapshot Cmdlet&lt;/P&gt;&lt;P&gt;ForEach ($vol in $vols) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; $snaps = Get-NaSnapshot $vol #get the list of Snapshots for each volume&lt;/P&gt;&lt;P&gt;&amp;nbsp; $snaps #display the Snapshot list on the screen&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;-Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 14:38:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29366#M252</guid>
      <dc:creator>skiser</dc:creator>
      <dc:date>2013-07-03T14:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell Cmdlets</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29369#M253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using&amp;nbsp; Cmdlets that NetApp has provided.&amp;nbsp; I am trying to write my own Cmdlets.&amp;nbsp; Perhaps I need to look more at what NetApp has written.&amp;nbsp; My real goal is to have programs run from scheduled tasks (or called from a web page) to get information from multiple NetApps and store it in a database or display it in a web page.&amp;nbsp; Right now I just remotely run a cli command on the NetApp and parse the output.&amp;nbsp; Having an API for the NetApp is much easier, but it seems too limiting in some areas.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 23:31:06 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29369#M253</guid>
      <dc:creator>scottfoley</dc:creator>
      <dc:date>2013-07-03T23:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell Cmdlets</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29374#M254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might find it easier to use the more popular ManageOntap.dll .NET library included with the&amp;nbsp; SDK rather than the .NET bindings. There is sample code for C# in &lt;SPAN style="font-family: courier new,courier;"&gt;netapp-manageability-sdk-5.1\src\sample\Data_ONTAP\DotNet\CSharp&lt;/SPAN&gt;. The "snapman" sample project has an example of calling the &lt;SPAN style="font-family: courier new,courier;"&gt;snapshot-list-info&lt;/SPAN&gt; API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to stick with the .NET bindings, you can specify a volume like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13733053998042314" jivemacro_uid="_13733053998042314"&gt;&lt;P&gt;SnapshotListInfo snapinput = new SnapshotListInfo();&lt;/P&gt;&lt;P&gt;snapinput.Volume = "vol0";&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "properties" section under the API class name in the help documentation has the full list of parameters for API classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 17:53:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Using-PowerShell-Cmdlets/m-p/29374#M254</guid>
      <dc:creator>zulanch</dc:creator>
      <dc:date>2013-07-08T17:53:03Z</dc:date>
    </item>
  </channel>
</rss>

