4. nidhogg cluster-mode details

class nidhogg.clustermode.ClusterMode(url, username, password, major, minor, http=<class 'nidhogg.http.NidhoggHttp'>)

Bases: nidhogg.core.Nidhogg

This class implements cluster-mode filer specific API calls.

ACL_CHANGE = u'change'

ACL permission constant for write access

ACL_FULL_CONTROL = u'full_control'

ACL permission constant for full control

ACL_NO_ACCESS = u'no_access'

ACL permission constant for denying access

ACL_PERMISSIONS = [u'full_control', u'read', u'change', u'no_access']

list of all permission constants

ACL_READ = u'read'

ACL permission constant for read access

create_cifs_share(volume, qtree, share_name, group_name=None, comment=None, umask=u'007')

Create a cifs share.

Parameters:
  • volume (str) – name of the volume
  • qtree (str) – name of the qtree
  • share_name (str) – name of the share
  • group_name (str) – force group name if provided (supported by cluster-mode filers with ontapi >= 1.30)
  • comment (str) – description of the share
  • umask (str) – file permission umask
Raises NidhoggException:
 

if an error occurs

delete_cifs_acl(share_name, user_or_group, is_group=None)

Delete cifs ACL of the specified user or group.

Parameters:
  • share_name (str) – name of the share
  • user_or_group (str) – name of a user or group
  • is_group (None) – not used for cluster-mode filers, specified here to be compatible with seven-mode method signature
Raises NidhoggException:
 

if an error occurs

delete_cifs_acls(share_name)

Remove all cifs permssions.

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

Delete the quota of the specified volume and qtree.

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

if an error occurs

get_quota(volume, qtree, max_records=65536)

Return the quota of the specified qtree on the given volume.

Parameters:
  • volume (str) – name of the volume
  • qtree (str) – name of the qtree
  • max_records (int) – limit returned records
Returns:

quota

Return type:

Quota or empty dict

Raises NidhoggException:
 

if an error occurs

get_snapmirror_status(volume=None, qtree=None)

Get status the snapmirror replication.

get_snapmirror_volume_status(volume)

Get status the snapmirror replication.

list_cifs_acls(share_name, max_records=65536)

Return ACL of the specified share.

Parameters:
  • share_name (str) – name of the share
  • max_records (int) – limit returned records
Returns:

list of ACEs (access control entries)

Return type:

ACE or empty list

Raises NidhoggException:
 

if an error occurs

list_cifs_shares()

List all cifs shares.

Returns:list of cifs shares
Return type:list of CifsShare or empty list
Raises NidhoggException:
 if an error occurs
list_qtrees(volume, max_records=65536)

Return a list of qtrees of type QTree.

Parameters:
  • volume (str) – name of the volume
  • max_records (int) – limit returned records
Returns:

list of qtrees

Return type:

list of QTree or empty list

Raises NidhoggException:
 

if an error occurs

list_quotas(volume, max_records=65536)

Return a list of quota reports of the specified volume.

Parameters:
  • volume (str) – name of the volume
  • max_records (int) – limit returned records
Returns:

list of quota reports

Return type:

QuotaReport or empty list

Raises NidhoggException:
 

if an error occurs

list_snapshots(target_name, max_records=65536)

Return list of snapshots for given volume.

Parameters:
  • target_name (str) – name of the volume
  • max_records (int) – limit returned records
Returns:

list of snapshots

Return type:

list of Snapshot or empty list

Raises NidhoggException:
 

if an error occurs

list_volumes(*args, **kwds)

Return a list of volumes of type Volume.

Parameters:max_records (int) – limit returned records
Returns:list of volumes
Return type:list of Volume or empty list
Raises NidhoggException:
 if an error occurs
set_cifs_acl(share_name, user=u'everyone', right=u'read', set_group_rights=None)

Set a single ACL for the specifed share.

Parameters:
  • share_name (str) – name of the share
  • user (str) – name of a user or group
  • right (str) – right to be set, value must be one of ACL_PERMISSIONS
  • set_group_rights (bool) – if true, user param specifies a unix group name; if false, user param specifies a unix user name; if not defined, user param specifies a windows name
Raises:
  • NidhoggException – if an error occurs
  • NidhoggException – if wrong right was set
set_quota(volume, qtree, quota_in_mb=1024, wait_til_finished=True)

Set a quota in MiB (default = 1GiB) for the specified volume and qtree.

Parameters:
  • volume (str) – name of the volume
  • qtree (str) – name of the qtree
  • quota_in_mb (int) – quota in MiB
  • wait_til_finished (bool) – if false, do not wait for resize operation
Raises:
  • NidhoggException – if an error occurs
  • NidhoggException – if resize did not finish in time and we were waiting for it
  • NidhoggException – if quotas are not enabled
update_snapmirror(destination_volume, destination_qtree=None)

Trigger the snapmirror replication.

update_snapmirror_with_snapshot(name, destination_volume, destination_qtree=None)

Update the named snapshot to the snapmirror destination.

volume_info(*args, **kwds)

Return basic information about the volume.

Parameters:volume (str) – name of the volume
Returns:volume
Return type:Volume
Raises NidhoggException:
 if an error occurs
nidhogg.clustermode.MAX_RECORDS = 65536

maximum records that can be retrieved via NETAPP API