The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Software Development Kit (SDK) and API Discussions

volume-get-iter error when retrieving volume attributes

tom_yuyitung

I am using Ontap API and I am talking to 7-Mode NetApp filer. I am able to get a list of volumes, but I cannot figure out how to get volume attributes. I tried to use VolumeGetIterResponse class, here is a code snippet

VolumeGetIterRequest volumeGetIter = new VolumeGetIterRequest();
volumeGetIter.setMaxRecords(100);
List<VolumeAttributes> volAttributes = volumeGetIterResponse.getAttributesList();
for (VolumeAttributes vas : volAttributes) {
VolumeExportAttributes vs = vas.getVolumeExportAttributes();
}


When running this code, I get error:
Unable to find API: volume-get-iter
Please point me where I am wrong, your help is highly appreciated

1 REPLY 1

robinpeter

There is no  "volume-get-ltr" call in 7-Mode ontapi 

 

this is what i used a while back... while i muck around with 7-mode system.

 

    #Collecting 7Mode Volume Information and Storing in Perl %volinfo:
    my $outv = $ss->invoke( "volume-list-info" );
    if ($outv->results_status() eq "failed"){
        print ((caller(0))[3], $filer, $outv->results_reason(), "\n");
    } else {
        my $volume_info = $outv->child_get("volumes");
        my @result = $volume_info->children_get();
        foreach my $vol (@result){
            my $volname                                 = $vol->child_get_string("name");
            my $volid                                   = join (":", $filer, $volname);
            $volinfo{$volid}{'volid'}                   = $volid;
            $volinfo{$volid}{'uuid'}                    = $vol->child_get_string("uuid");
            $volinfo{$volid}{'name'}                    = $vol->child_get_string("name");
            $volinfo{$volid}{'state'}                   = $vol->child_get_string("state");
            $volinfo{$volid}{'type'}                    = $vol->child_get_string("type");
            $volinfo{$volid}{'sizeTotal'}               = $vol->child_get_int("size-total");
            $volinfo{$volid}{'sizeUsed'}                = $vol->child_get_int("size-used");
            $volinfo{$volid}{'sizeAvailable'}           = $vol->child_get_int("size-available");
            $volinfo{$volid}{'percentageUsed'}          = $vol->child_get_int("percentage-used");
            $volinfo{$volid}{'filesTotal'}              = $vol->child_get_int("files-total");
            $volinfo{$volid}{'filesUsed'}               = $vol->child_get_int("files-used");
            $volinfo{$volid}{'containingAggr'}          = $vol->child_get_string("containing-aggregate");
            $volinfo{$volid}{'filer'}                   = $filer;
        }
    }

Yes, back in days.. i was using Perl..  😛 

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public