netapp-sdk
v1.0.0
Published
Node.js client for NetApp ONTAP REST API (SnapMirror, volumes, LUNs, cluster)
Maintainers
Readme
netapp-sdk
Node.js client for the NetApp ONTAP REST API. Supports SnapMirror, volumes, LUNs, snapshots, schedules, cluster, and SVM peers.
Install
npm install netapp-sdkUsage
import {
NetAppOntapClient,
snapmirror,
volumes,
luns,
cluster,
} from "netapp-sdk";
const client = new NetAppOntapClient({
baseUrl: "URL",
username: "user",
password: "secret",
rejectUnauthorized: false,
});
// Cluster info
const clusterInfo = await cluster.getCluster(client);
// List SnapMirror relationships
const rels = await snapmirror.listRelationships(client, {
"destination.path": "svm:flexVolume",
fields: "state,healthy,lag_time",
});
// Trigger manual sync (snapmirror update)
await snapmirror.triggerTransfer(client, "<relationship-uuid>");
// Quiesce (pause replication)
await snapmirror.updateRelationshipState(client, "<uuid>", "paused");
// Break (failover — make destination writable)
await snapmirror.updateRelationshipState(client, "<uuid>", "broken_off");
// Resync (re-establish mirror after break)
await snapmirror.updateRelationshipState(client, "<uuid>", "snapmirrored");
// List volumes
const vols = await volumes.listVolumes(client, {
"svm.name": "vsm",
});
// List LUNs
const lunsList = await luns.listLuns(client, {
"svm.name": "svm",
"volume.name": "flexVolume",
});API surface
| Namespace | Methods |
|------------|---------|
| snapmirror | listRelationships, getRelationship, createRelationship, updateRelationshipState, triggerTransfer, listTransfers, deleteRelationship |
| volumes | listVolumes, getVolume, createVolume, cloneVolume, deleteVolume |
| luns | listLuns, getLun |
| snapshots | listSnapshots |
| schedules | listSchedules, createSchedule |
| cluster | getCluster, listClusterPeers |
| svm | listSvmPeers |
| aggregates | listAggregates |
| lunMaps | createLunMap, deleteLunMap, listLunMaps |
Requirements
- Node.js >= 18
- TypeScript 5.x (optional, for types)
License
MIT
