Software Development Kit (SDK) and API Discussions

OnTAPI volume-get-iter returns with errors


At customer site:

When iterating through the tags for volume-get-iter we get strange errors.

E.g. returned by na_results_errno and na_results_reason after na_server_invoke:

Error:13001, PCDATA invalid Char value 18 .

Error:1, Extra content at the end of the document .


We asked the customer to run the ApiTest pgm with volume-get-iter to see if there was something strange in their settings.

There was:

<results status="passed">

... (20 volumes elided)



The text in bold seems to be garabage. I have not been able to reproduce this behavior in our lab.


Does anyone have any input on this?








Re: OnTAPI volume-get-iter returns with errors


The <next-tag> data is certainly not garbage, although it's not designed for human consumption.  You requested 20 records in your query (default, see max-records if you want to request more) but there are more than 20 records that match your query so the output has been "paged".  <next-tag> is the pointer to the next page of results, which you can feed back into another volume-get-iter as the "tag" input.  As long as you have a <next-tag> returned, you still have more results to process.  If there is no <next-tag>, you have fetched all your records.  All *-iter APIs should support max-records and tag/next-tag.


So that doesn't solve your real issue but hopefully you understand what <next-tag> is now.

Re: OnTAPI volume-get-iter returns with errors


OK. I knew about the next-tag but was just surprised by getting unprocessed xml entities from ApiTest.

I found the bug in my code, wrong scoping for the return value from na_server_invoke.





Re: OnTAPI volume-get-iter returns with errors




Same here by calling luns, have you resolvd this issue?



Re: OnTAPI volume-get-iter returns with errors


Here it something i wrote a while back (lil more than 4 years..) in perl.


#Collecting CDOT Volume Information and Storing in perl hash %volinfo:
    my $volapi = new NaElement('volume-get-iter');
        my $xi = new NaElement('query');
        my $xi1 = new NaElement('volume-attributes');
        my $xi3 = new NaElement('desired-attributes');
            my $xi4 = new NaElement('volume-attributes');
            my $xi5 = new NaElement('volume-id-attributes');
            my $xi6 = new NaElement('volume-state-attributes');
            my $xi7 = new NaElement('volume-space-attributes');
            my $xi8 = new NaElement('volume-inode-attributes');
    my $outv = $ss->invoke_elem($volapi);
    if ($outv->results_status() eq 'failed') {
        print ((caller(0))[3], $filer, $outv->results_reason(), "\n");
    } else {
        my $nor = $outv->child_get_string("num-records");
        if ($nor > 0 ) {
            my @volattr     = $outv->child_get("attributes-list")->children_get("volume-attributes");
            foreach my $vol (@volattr) {
                my $volidattr                           = $vol->child_get("volume-id-attributes");
                my $volspattr                           = $vol->child_get("volume-space-attributes");
                my $volstattr                           = $vol->child_get("volume-state-attributes");
                my $volinattr                           = $vol->child_get("volume-inode-attributes");
                if ($volidattr and $volstattr and $volspattr and $volinattr) {
                    my $volname                         = $volidattr->child_get_string("name");
                    my $volid                           = join (":", $na, $volname);
                    $volinfo{$volid}{'volid'}           = $volid;
                    $volinfo{$volid}{'uuid'}            = $volidattr->child_get_string("uuid");
                    $volinfo{$volid}{'name'}            = $volidattr->child_get_string("name");
                    $volinfo{$volid}{'type'}            = $volidattr->child_get_string("type");
                    $volinfo{$volid}{'containingAggr'}  = $volidattr->child_get_string("containing-aggregate-name");
                    $volinfo{$volid}{'junctionPath'}    = $volidattr->child_get_string("junction-path");
                    $volinfo{$volid}{'state'}           = $volstattr->child_get_string("state");
                    $volinfo{$volid}{'sizeTotal'}       = $volspattr->child_get_int("size-total");
                    $volinfo{$volid}{'sizeUsed'}        = $volspattr->child_get_int("size-used");
                    $volinfo{$volid}{'sizeAvailable'}   = $volspattr->child_get_int("size-available");
                    $volinfo{$volid}{'percentageUsed'}  = $volspattr->child_get_int("percentage-size-used");
                    $volinfo{$volid}{'filesTotal'}      = $volinattr->child_get_int("files-total");
                    $volinfo{$volid}{'filesUsed'}       = $volinattr->child_get_int("files-used");
                    $volinfo{$volid}{'filer'}           = $filer;

hope this helps...

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums