Software Development Kit (SDK) and API Discussions

Fetch quota report for cluster mode filers using NetApp Perl APIs

rahuldhek
2,170 Views

I am using the following LOC to fetch the report. It geneartes the report but the report contains details for a different volume(Not expected) and does not contain any details of the expected volume. I tried verifying by doing a SSH to the particular filer and check the quota entry for a particluar volume. There I see the entries for all the required users for that volume. Don't know where I am missing and what I am missing.

 

Any leads will be helpful.

 

Below is the snippet to fetch the report:

 

$s = NaServer->new($filer, 1, 21 );
$s->set_server_type('FILER');
$s->set_transport_type('HTTPS');
$s->set_port(443);
$s->set_style('LOGIN');
$s->set_admin_user('user','passwd');
$api = NaElement->new('quota-report-iter');
my $xo = $s->invoke_elem($api);
if ( $xo->results_status() eq 'failed' ) {

}
else{
     my @temp= $xo->sprintf();
}
1 REPLY 1

asulliva
2,154 Views

With clustered Data ONTAP you'll need to specify which SVM you want to target.  You can further limit the returned results by specifying the volume too.

 

use Data::Dumper;

$s = NaServer->new($filer, 1, 21 );
$s->set_server_type('FILER');
$s->set_transport_type('HTTPS');
$s->set_port(443);
$s->set_style('LOGIN');
$s->set_admin_user('user','passwd');

# specify the SVM
$s->set_vserver('mySvm');

# specify the volume in the request
my $xo = $s->invoke('quota-report-iter', 'path', '/vol/myVol');

if ( $xo->results_status() eq 'passed' ) {
    # you can get a pretty print of the returned object
    # using Data::Dumper
    print Dumper($xo);
    
} else {
    print $xo->results_reason();
}

Hope that helps.

 

Andrew

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