<?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 sdk -perl - getting snap_used ontapi 1.9 in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106387#M1522</link>
    <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;we are trying to automate quota assignment on qtrees and to do so, we need to get first some figures about volume occupancy (newbie - very first program).&lt;BR /&gt;We are ontapi 1.9 7-mode and I managed to get almost all data that we need except snapshot occupancy.&lt;/P&gt;&lt;P&gt;This is the output of df in the column used for a volume&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;cdcsx077:~ # ssh user@nat002 df /vol/&amp;lt;volumename&amp;gt;/.snapshot&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;Filesystem kbytes used avail capacity Mounted on&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;/vol/&amp;lt;volumename&amp;gt;/ 145920 31424 114496 22% /vol/&amp;lt;volumename&amp;gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;/vol/&amp;lt;volumename&amp;gt;/.snapshot 7680 27940 0 364% /vol/&amp;lt;volumename&amp;gt;/.snapshot&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I basically would like to get 27940 or at least (27940 - 7680)&lt;/P&gt;&lt;P&gt;And this is important not to offer this amount of space to the end user.&lt;/P&gt;&lt;P&gt;Please, could you point me out how to get it? I got blind looking at the API, I also installed Zexlorer and parse many xmls, with no success.&lt;/P&gt;&lt;P&gt;I'd be a pitty if we had to revert sdk to rsh to solve this. I'd appreciate any suggestion.&lt;BR /&gt;Regards,&lt;BR /&gt;Felipe&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 04:09:14 GMT</pubDate>
    <dc:creator>kfelipe</dc:creator>
    <dc:date>2025-06-05T04:09:14Z</dc:date>
    <item>
      <title>sdk -perl - getting snap_used ontapi 1.9</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106387#M1522</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;we are trying to automate quota assignment on qtrees and to do so, we need to get first some figures about volume occupancy (newbie - very first program).&lt;BR /&gt;We are ontapi 1.9 7-mode and I managed to get almost all data that we need except snapshot occupancy.&lt;/P&gt;&lt;P&gt;This is the output of df in the column used for a volume&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;cdcsx077:~ # ssh user@nat002 df /vol/&amp;lt;volumename&amp;gt;/.snapshot&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;Filesystem kbytes used avail capacity Mounted on&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;/vol/&amp;lt;volumename&amp;gt;/ 145920 31424 114496 22% /vol/&amp;lt;volumename&amp;gt;/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" face="courier new,courier"&gt;/vol/&amp;lt;volumename&amp;gt;/.snapshot 7680 27940 0 364% /vol/&amp;lt;volumename&amp;gt;/.snapshot&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I basically would like to get 27940 or at least (27940 - 7680)&lt;/P&gt;&lt;P&gt;And this is important not to offer this amount of space to the end user.&lt;/P&gt;&lt;P&gt;Please, could you point me out how to get it? I got blind looking at the API, I also installed Zexlorer and parse many xmls, with no success.&lt;/P&gt;&lt;P&gt;I'd be a pitty if we had to revert sdk to rsh to solve this. I'd appreciate any suggestion.&lt;BR /&gt;Regards,&lt;BR /&gt;Felipe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 04:09:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106387#M1522</guid>
      <dc:creator>kfelipe</dc:creator>
      <dc:date>2025-06-05T04:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: sdk -perl - getting snap_used ontapi 1.9</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106457#M1523</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of gaps in the SDK coverage. This has been the case for years and contunies to be frustrating. I've never managed to get a comittment from NetApp to fix the gaps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To avoid falling back to an alternate conneciton method you can send CLI commands over the existing HTTP(S) connection using a NaElelemt type 'system-cli'. I have no idea if this is supported or not, but I use it extensively to plug gaps in the SDK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is an exmple method from my OO API. I don't know your coding style (and this page will kill my indentation, so ignore that) but you should get the idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sub get_snapshot_used {&lt;/P&gt;&lt;P&gt;# Workaround API gap&lt;/P&gt;&lt;P&gt;my $self = shift;&lt;/P&gt;&lt;P&gt;$self-&amp;gt;verbose;&lt;BR /&gt;$self-&amp;gt;debug( { Passed =&amp;gt; \@_ } );&lt;/P&gt;&lt;P&gt;my $serv = $self-&amp;gt;get_classic-&amp;gt;get_naserver;&lt;/P&gt;&lt;P&gt;($serv)&lt;BR /&gt;&amp;nbsp; || croak ( "No naserver object bound" );&lt;/P&gt;&lt;P&gt;my $name = $self-&amp;gt;get_name();&lt;/P&gt;&lt;P&gt;my $cmd = NetAppApi::NaElement-&amp;gt;new("system-cli");&lt;BR /&gt;my $cmd_args = NetAppApi::NaElement-&amp;gt;new("args");&lt;/P&gt;&lt;P&gt;$cmd_args-&amp;gt;child_add(NetAppApi::NaElement-&amp;gt;new ("arg", "df"));&lt;BR /&gt;$cmd_args-&amp;gt;child_add(NetAppApi::NaElement-&amp;gt;new ("arg", "$name"));&lt;/P&gt;&lt;P&gt;$cmd-&amp;gt;child_add($cmd_args);&lt;/P&gt;&lt;P&gt;my $output = $serv-&amp;gt;invoke_elem( $cmd );&lt;/P&gt;&lt;P&gt;$self-&amp;gt;debug( { Response =&amp;gt; $output } );&lt;/P&gt;&lt;P&gt;if ( $output-&amp;gt;results_status() eq "failed" ) {&lt;BR /&gt;croak (&lt;BR /&gt;"Unable to run system-cli $cmd,\n",&lt;BR /&gt;$output-&amp;gt;results_reason() . "\n"&lt;BR /&gt;);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;my @lines = split /\n/,$output-&amp;gt;child_get_string("cli-output");;&lt;/P&gt;&lt;P&gt;my $used;&lt;/P&gt;&lt;P&gt;LINE:&lt;BR /&gt;for my $line (@lines){&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;/vol/&amp;lt;name&amp;gt;/.snapshot 7680 27940 0 364% /vol/&amp;lt;volumename&amp;gt;/.snapshot&lt;/P&gt;&lt;P&gt;if ($line =~ m/$name\/.snapshot/){&lt;/P&gt;&lt;P&gt;my @parts = split /\s+/,$line;&lt;/P&gt;&lt;P&gt;$used = $parts[2];&lt;BR /&gt;last LINE;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return $used;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 15:10:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106457#M1523</guid>
      <dc:creator>chris_algar</dc:creator>
      <dc:date>2015-06-22T15:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: sdk -perl - getting snap_used ontapi 1.9</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106511#M1525</link>
      <description>&lt;P&gt;If you don't want to use the, for all intents and purposes, hidden, system-cli element, you can get what you are looking for with a little bit of collection and math.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;snapshot-list-info&lt;/STRONG&gt; returns 'total', the total number of 1024 byte blocks in a snapshot.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;volume-list-info&lt;/STRONG&gt; returns 'size-total', the total useable size in bytes of the volume (not including WAFL reserve or snapshot reserve). If you are using snap reserve, you'll have to take into accout the 'snapshot-blocks-reserve' value.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 13:20:24 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106511#M1525</guid>
      <dc:creator>liesc</dc:creator>
      <dc:date>2015-06-23T13:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: sdk -perl - getting snap_used ontapi 1.9</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106578#M1527</link>
      <description>&lt;P&gt;Thanks for your reply Chris!&lt;/P&gt;&lt;P&gt;Yesterday I tested with Zexplorer and it worked, but wanted to create a function before replying, now I tested it and it works too. Perhaps it helps others.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 10:07:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106578#M1527</guid>
      <dc:creator>kfelipe</dc:creator>
      <dc:date>2015-06-24T10:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: sdk -perl - getting snap_used ontapi 1.9</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106580#M1528</link>
      <description>&lt;P&gt;Thanks Liesc&lt;/P&gt;&lt;P&gt;Perhaps I am missing how to get the information, I tried to collect it from&amp;nbsp;&lt;STRONG&gt;snapshot-list-info&amp;nbsp;&lt;/STRONG&gt;and getting the info not with total but wiht &lt;STRONG&gt;&lt;EM&gt;cumulative-total &amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;.&lt;BR /&gt;It just gives me a value that it does not match with df output:&lt;/P&gt;&lt;P&gt;&amp;lt;!-- last snapshot --&amp;gt;&lt;BR /&gt;&amp;lt;total&amp;gt;84&amp;lt;/total&amp;gt;&lt;BR /&gt;&amp;lt;cumulative-total&amp;gt;&lt;STRONG&gt;1676&lt;/STRONG&gt;&amp;lt;/cumulative-total&amp;gt;&lt;BR /&gt;while df gives me:&lt;/P&gt;&lt;P&gt;/vol/&amp;lt;volname&amp;gt;/.snapshot 7680 &lt;STRONG&gt;28528&lt;/STRONG&gt; 0 371% /vol/&amp;lt;volname&amp;gt;/.snapshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate if you could explain me a bit more how to do the math with the data, I'd indeed prefer to use the sdk methods instead of the ssh backdoor.&lt;BR /&gt;Basically I want to get 28528 to substract&amp;nbsp;to the volume reserved space, and this becomes the snap_delta, which cannot be shown as free to&amp;nbsp;the end user. (Final goal is that this advanced users handle quotas themselfs, and this is to create proper limits)&lt;BR /&gt;I am not a Netapp admin, but my colleagues have also told me that perhaps this snapshot-list-info is based on snap list and if so, it can cause performance problems on big systems.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 14:32:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/sdk-perl-getting-snap-used-ontapi-1-9/m-p/106580#M1528</guid>
      <dc:creator>kfelipe</dc:creator>
      <dc:date>2015-06-24T14:32:41Z</dc:date>
    </item>
  </channel>
</rss>

