Software Development Kit (SDK) and API Discussions

Highlighted

volume-get-iter api not fetching full volume list from cluster

API "volume-get-iter” is used to get the list of volumes on a cluster.  When we run this against a cluster which has more than 1000 volumes, it is not retrieving entire volume list. For example, when we ran this on a cluster, it returned 1002 volumes but we have 1258 volumes on that cluster.

 

Here is the sample code used to retrieve the list of volumes on a cluster.  please let me know if any one has experienced this issue.

 

my $in = NaElement->new("volume-get-iter");

    $in->child_add_string( 'max-records', 10000 );

    my $output  = $cluster_conn->invoke_elem($in);

 

    if ( $output->results_errno != 0 ) {

        exit;

    }

    else

    {

        foreach ( $output->child_get("attributes-list")->children_get() )

        {

             my $volname = $_->child_get("volume-id-attributes")->child_get_string("name");

             my $aggrname = $_->child_get("volume-id-attributes")->child_get_string("containing-aggregate-name");

          

             print "$aggrname,$volname\n";

        }

             }

           

 

 

Regards

 

Unni

2 REPLIES 2
Highlighted

Re: volume-get-iter api not fetching full volume list from cluster

Are you checking for a next-tag entry on the response?

 

If there are more entries than can fit in the response (you have set max-records to 1000) then you should get a tag in the answer

 

You need to make a new request with the content of the next-tag under a tag entry

 

 

Highlighted

Re: volume-get-iter api not fetching full volume list from cluster

This would be by design. It's an iteration so you need to handle the 'page' size returned.

Check out the KB!
NetApp Insights To Action
All Community Forums