2. nidhogg API

class nidhogg.core.Nidhogg(url, username, password, major, minor, verify, http=<class 'nidhogg.http.NidhoggHttp'>)

Bases: object

This is the base class for connecting to a NETAPP filer.

It provides functions that have 7-mode filers and cluster-mode filers in common.

Subclasses:

apis

List of API commands available with the current credentials.

Returns:list of API commands
Return type:list of str or empty list
clustered

True if the filer is a cluster-mode filer, false otherwise.

Return type:boolean
create_cifs_share(*args, **kwargs)

See sub classes.

create_qtree(volume, qtree, mode='007')

Create a qtree on the specified volume.

Parameters:
  • volume (str) – name of the volume
  • qtree – name of the qtree to be created
  • mode (str) – initial file system permissions of the qtree
Raises:

NidhoggException – if an error occurs

create_snapshot(*args, **kwargs)

See sub classes.

delete_cifs_acl(*args, **kwargs)

See sub classes.

delete_cifs_acls(*args, **kwargs)

See sub classes.

delete_cifs_share(share_name)

Delete the share with the given name.

Parameters:share_name (str) – name of the share
Raises:NidhoggException – if an error occurs
delete_qtree(volume, qtree, force=False)

Delete a qtree on the specified volume.

Parameters:
  • volume (str) – name of the volume
  • qtree (str) – name of the qtree to be deleted
  • force (bool) – force deletion if true
Raises:

NidhoggException – if an error occurs

delete_quota(*args, **kwargs)

See sub classes.

delete_snapshot(volume, name)

Delete a snapshot.

Parameters:
  • volume (str) – name of the volume
  • name (str) – name of the snapshot
Raises:

NidhoggException – if an error occurs

exists_qtree(volume, qtree)

Check if a qtree exits.

Parameters:
  • volume (str) – name of the volume
  • qtree (str) – name of the qtree
Returns:

true, if the qtree exists

Return type:

bool

Raises:

NidhoggException – if an error occurs

get_allocated_quota_ratio

Return the ratio allocated quota size / volume size.

Parameters:
  • volume (str) – name of the volume
  • volume_size_total (int) – if specified we have the total size already from a previous API call
Returns:

ratio allocated quota size / volume size

Return type:

int

Raises:

NidhoggException – if an error occurs

get_allocated_quota_size

Return the sum of all quotas of the specified volume.

Parameters:volume (str) – name of the volume
Returns:sum of all qtree quotas on this volume in byte
Return type:int
Raises:NidhoggException – if an error occurs
get_quota(*args, **kwargs)

See sub classes.

get_snapmirror_status(*args, **kwargs)

See sub classes.

get_snapmirror_volume_status(*args, **kwargs)

See sub classes.

get_volumes(filter_volume_names=[])

Return a list of snapable volumes of type Volume.

Parameters:filter_volume_names (list of str) – consider only volumes that are in this list
Returns:list of user home volumes
Return type:list of Volume
Raises:NidhoggException – if an error occurs
get_volumes_with_quota_info(filter_volume_names=[])

Return a list of snapable volumes of type VolumeWithQuotaRatio.

Parameters:filter_volume_names (list of str) – consider only volumes that are in this list
Returns:list of project home volumes
Return type:list of VolumeWithQuotaRatio
Raises:NidhoggException – if an error occurs
has_forcegroup

Check if this cifs share feature is available.

Returns:true, if feature is available
Return type:bool
list_cifs_acls(*args, **kwargs)

See sub classes.

list_cifs_shares(*args, **kwargs)

See sub classes.

list_qtrees(*args, **kwargs)

See sub classes.

list_quotas(*args, **kwargs)

See sub classes.

list_snapable_volumes()

Return a list of snapable volumes.

That means, ignore volumes that are used as a snapmirror destination.

Returns:list of snapable volumes
Return type:list of Volume
Raises:NidhoggException – if an error occurs
list_snapmirror_destinations(*args, **kwargs)

See sub classes.

list_snapshots(*args, **kwargs)

See sub classes.

list_volumes(*args, **kwargs)

See sub classes.

ontapi_version

ONTAPI version of the connected filer.

Returns:ontapi version
Return type:str
set_cifs_acl(*args, **kwargs)

See sub classes.

set_quota(*args, **kwargs)

See sub classes.

update_snapmirror(*args, **kwargs)

See sub classes.

update_snapmirror_with_snapshot(*args, **kwargs)

See sub classes.

volume_info(*args, **kwargs)

See sub classes.

vserver

Hostname of the connected filer.

Returns:hostname
Return type:str
vserver_fqdn

FQDN of the connected filer.

Returns:FQDN of the filer
Return type:str
exception nidhogg.core.NidhoggException

Bases: Exception

Exception wrapper.