NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Software Development Kit (SDK) and API Discussions

How to get list of snapshots with the java api

bmpeter
3,945 Views

Hello,

 

i want to get a list of Snapshots with the java-API from a specified volume.

A list of volumes is no problem, but i cant find anything about snapshots.

 

Here the java code for a volume list:

 

private ApiRunner getRunner()
    {
        
        ApiRunner runner = null;
        try
        {
             runner = new ApiRunner(ApiTarget.builder()
                .withHost(ip)
                .withUserName(user)
                .withPassword(pw)
                .withTargetType(TargetType.FILER)
                .useHttp()
                .build());
        
        
        }
        catch(Exception e)
        {
            System.out.println("Connection Problem");
            e.printStackTrace();
        }
        return runner;
    }

public Iterator getVolumes()
    {
        ArrayList volList = null;
        ApiRunner runner = getRunner();
        VolumeListInfoIterStartRequest volListReq = new VolumeListInfoIterStartRequest();
        Iterator<VolumeInfo> volumeIter = runner.iterate(volListReq, 10);
        
        return volumeIter;
     
    }

 

 

Please help!

 

Best regards,

 

Peter

 

1 REPLY 1

richard_payne
3,868 Views

Have you tried the 'snapshot-list-info' API call (assuming 7 mode)?

 

snapshot_list_info

[Family: ontap-classic, vfiler]

Return snapshot information for a specified volume. A list of snapshots and information about each snapshot is returned. In Data ONTAP Cluster-Mode, 'snapshot-get-iter' API is the preferred way of retrieving snapshot information.

 

--rdp

Public