Software Development Kit (SDK) and API Discussions

Getting volume owner from DFM

GUILLAUMEWYSSEN
4,138 Views

Dear community,

 

We have defined the field "owner" on the DFM web interface on each volumes. We want to use this field to specify "customer name" for another internal system.

 

I need to get this information through the Perl API.

 

I get all Volumes informations with "volume-list-info-iter-next" but I can't see any entry for the owner.

 

There is another way to get the owner field through API ?

 

There is another another field that i can use for external data ? (Like comment or annotation)

1 REPLY 1

cscott
4,138 Views

Hello,

     Assuming DFM 3.7.1 through 5.2 and 7mode controllers(per the SDK), the API can pull comment information, here is the basic outline to pull the information. 

On all of my DFM instances the ownerName field is object ID 2 but you can specify ownerName, your ID may differ.

The comment-field-object-type for a volume is Volume, a qtree would be Qtree.

Object-name-or-id is the DFM volume syntax of <CONTROLLER>:/<VOLUME> or the volume ID in DFM.

I have not done any iterating through volumes, but hopefully this can get you started.

require 5.6.1;

use lib '<path_to_nmsdk_root>/lib/perl/NetApp';

use strict;

use warnings;

use NaServer;

use NaElement;

my $s = new NaServer('<server>', 1 , 0);

$s->set_server_type('DFM');

$s->set_transport_type('HTTPS');

$s->set_port(8488);

$s->set_style('LOGIN');

$s->set_admin_user('<user>', '<password>');

my $api = new NaElement('comment-field-values-list-info-iter-start');

$api->child_add_string('comment-field-name-or-id','ownerName');

my $xi = new NaElement('comment-field-object-types');

$api->child_add($xi);

$xi->child_add_string('comment-field-object-type','Volume');

$api->child_add_string('object-name-or-id','<volume Name or ID>');

my $xo = $s->invoke_elem($api);

if ($xo->results_status() eq 'failed') {

    print 'Error:\n';

    print $xo->sprintf();

    exit 1;

}

print 'Received:\n';

print $xo->sprintf();

- Scott

Public