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

how to get information of Disks and Aggregates using ontap api 8.1 and nmsdk 5.1?

VISHWASTALULE

I want to get information about disks and aggregates using api classes.

For getting information about aggregate I used AggrListInfoRequest class, but didn't get anything as a output?

here is my code:

import com.netapp.nmsdk.client.ApiRunner;

import com.netapp.nmsdk.client.ApiTarget;

import com.netapp.nmsdk.client.ApiTarget.Protocol;

import com.netapp.nmsdk.client.ApiTarget.TargetType;

import com.netapp.nmsdk.common.api.annotation.IterStartAPIRequest;

import com.netapp.nmsdk.common.api.annotation.IterStartAPIResponse;

import com.netapp.nmsdk.ontap.api.volume.DiskInfo;

import com.netapp.nmsdk.ontap.api.volume.VolumeInfo;

import com.netapp.nmsdk.ontap.api.volume.VolumeListInfoIterStartRequest;

//import com.netapp.nmsdk.dfm.api.lun.LunInfo;

import com.netapp.nmsdk.ontap.api.lun.*;

import com.netapp.nmsdk.ontap.api.aggr.*;

import com.netapp.nmsdk.ontap.api.disk.*;

import com.netapp.nmsdk.ontap.api.lun.LunListInfoRequest;

import java.util.Iterator;

import java.util.List;

public class RunStorage {

          /**

           * Constructor

           */

          public RunStorage() {

                    // TODO Auto-generated constructor stub

          }

 

          public void startStorage(){

                    //NaServer na;

 

                    System.out.println("in start storage class");

          }

 

          public static void main (String [] args){

                    //Attempt to connect to host and get basic info.

                    String myip= "192.xxx.xxx.xxx";

                    String url = "https://"+myip;

 

                    Protocol protocol = Protocol.INSECURE_HTTPS;

                    try {

                              System.out.println("url is .." + url);

                              ApiRunner apirunner = new ApiRunner(ApiTarget.builder()

                                        .withHost(myip)

                                        .withUserName("uname")

                                        .withPassword("pwd")

                                        .withTargetType(TargetType.FILER)

                                        .useProtocol(protocol)

                                        .build()

                              );

AggrListInfoRequest aggrReq = new AggrListInfoRequest();

//I get error in following line ..

Iterator <AggrInfo> aggrIter = apirunner.iterate(aggrReq,10);

}catch (Exception e) { }

How should I handle the request object to get information???

1 REPLY 1

zulanch

You have the same problem here as in your other post. AggrListInfoRequest is not an iterator API, so you need to use ApiRunner.run() instead of ApiRunner.iterate().

-Ben

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