Data ONTAP APIs

The Data ONTAP APIs are used to retrieve information about various NetApp storage system features, such as qtrees, quotas, volumes, LUNs, Snapshot, SnapMirror, and so on.

The following list describes sample codes that demonstrate the use of Data ONTAP APIs. The list also provides links to view those codes.

 

 

Sample code in five languages

Name

Description

C

Perl

Java

C#

VB.NET

FlexClone

This sample code demonstrates how to create a clone for a flexible volume. It estimates the size, splits the clone, and shows the status.

flexclone.c

view

flexclone.pl

view

flextest.java

view

-

-

Quota listing

This sample code demonstrates how to list the quota available on a storage system.

quotalist.c

view

quotalist.pl

view

quotalist.java

view

-

-

Snapshot

This sample code shows how to manage Snapshot copies.

It demonstrates how to make a Snapshot copy, rename it, and delete it. The sample code also demonstrates how to get Snapshot copy lists and schedules.

snapman.c

view

snapman.pl

view

-

snapman.cs

view

snapman.vb

view

SNMP

This sample code describes how to use the SNMP API. The following actions are performed with this sample code:

  • Add new SNMP community

  • Delete specific SNMP community

  • Delete all SNMP communities

  • Disable SNMP interface

  • Enable SNMP interface

  • SNMP get for specific OID

  • SNMP getnext for specific OID

  • SNMP Status

  • Disable Traps

  • Enable Trap

  • Add Trap Host

  • Delete Trap Host

snmp.c

view

snmp.pl

view

snmp.java

view

-

-

Consistency Group

This sample code shows how to manage a consistency group (that is how to start and commit a consistency group).

cg_operation.c

view

cg_operation.pl

view

-

-

-

Volume List

This sample code lists volumes that are available on a storage system.

Vollist.c

view

print_volume.pl

view

vollist.java

view

vollist.cs

view

vollist.vb

view

MAC address List

This sample code shows a list of IP addresses and the corresponding MAC addresses.

getmac.c

view

-

-

-

-

Option List

This sample code shows a list of the options and demonstrates the use of the following functions:

  • Lists all the options

  • Gets the value of a particular option

  • Sets the value of a particular option

optmgmt.c

view

optmgmt.pl

view

optmgmt.java

view

optmgmt.cs

view

optmgmt.vb

view

SnapVault

This sample code shows the management of SnapVault. It demonstrates the use of following operations:

  • createSnapshot—creates Snapshot copies.

  • relationshipStatusgets the SnapVault relationship status

  • scheduleList—lists configured Snapshot schedules

snapvault.c

view

snapvault.pl

view

snapvault.java

view

 

 

SnapMirror

This code demonstrates the management of SnapMirror operations.

sm.cpp

view

snapmirror.pl

view

snapmirror.java

view

 

 

Symlink

This is a sample code for symbolic links from Windows. It demonstrates the use of the following functions:

  • file-create-symlink—creates a symlink

  • file-read-symlink—reads the content of a symlink

symlink.c

view

-

-

 

-

Volume Monitor

This sample code shows how to monitor a volume on a storage system.

-

monitor_volume.pl

view

-

 

-

qtree

This sample code creates a qtree on a specified volume and adds a quota entry.

-

qtree_quota.pl

view

-

 

-

vFiler

This sample code demonstrates how to create, destroy, and list vFiler units on the storage system.

vfiler.c

view

vfiler.pl

view

vfiler.java

view

 

 

vFiler Tunnelling

This sample code demonstrates how to invoke Data ONTAP APIs on a vFiler through the physical storage system.

vfiler_tunnel.c

view

vfiler_tunnel.pl

view

vfiler_tunnel.java

view

vfiler_tunnel.cs

view

vfiler_tunnel.vb

view

Unified Capacity Management

This sample code demonstrates the usage of Data ONTAP APIs for capacity management of NetApp storage systems.

It demonstrates the following:

  • raw-capacity—calculates the total installed capacity of the system.

  • formatted-capacity—calculates the total formatted capacity of the system.

  • allocated-capacity—calculates the total space reserved for the volume and the space used by nonreserved data.

  • available-user-data-capacity—calculates the total capacity available for user data.

  • provisioning-capacity—calculates the usable space for provisioning.

  • raid-overhead and wafl-overhead—calculates the total capacity in RAID overhead and WAFL overhead.

unified_capacity_mgmt.c

view

unified_capacity_mgmt.pl

view

-

-

-

User administration

This sample code demonstrates how to add, modify. and list the user administration capabilities using Data ONTAP APIs

It demonstrates the following:

  • user-add—adds a new user to a group with  defined capabilities.

  • user-modify—modifies the user with allowed-capability and group-info values.

  • user-list—lists the administrative users with allowed-capabilities and group-information.

  • role-add—adds a new role with allowed capabilities.

  • role-modify—modifies a user role.

  • role-list—lists information about all roles on the system.

  • group-add—adds a new group with allowed capabilities.

  • group-list—lists information about all the groups in the system.

useradmin.c

view

-

-

-

-

Performance Operation

This sample code demonstrates the use of some of the perf family APIs. The sample code lists the system-wide performance objects, lists the counters for a given performance object, lists the object instances for a given object, and provides values for counters of a given performance object.

perf_operation.c

view

perf_operation.pl

view

perf_operation.java

view

perf_operation.cs

view

perf_operation.vb

view

NFS

This sample code demonstrates the use of some of the NFS family API. The sample code enables you to start, stop, and query the status of the NFS service. It also lists the current NFS export rules.

nfs.c

view

nfs.pl

view

nfs.java

view

nfs.cs

view

nfs.vb

view

File SnapLock

This sample code demonstrates how to get the retention time and how to set the retention for SnapLock files.

file_snaplock.c

view

file_snaplock.pl

view

file_snaplock.java

view

-

-

SAN Management

This sample code demonstrates the following:

  • Create, delete, and list LUN clone

  • Map and unmap LUNs

  • Create, delete, and list igroups

  • Configure FCP and iSCSI

san_mgmt.c

view

san_mgmt.pl

view

-

-

-