3. nidhogg seven-mode details

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

Bases: nidhogg.core.Nidhogg

This class implements seven-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 if specified
  • 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=False)

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 (bool) – if true, param user_or_group specifies a unix group name
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)

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

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

quota

Return type:

Quota

Raises NidhoggException:
 

if an error occurs

get_snapmirror_status(volume=None, qtree=None)

Get status of snapmirror replication pairs. If no params are provided, return all snapmirror status pairs.

Parameters:
  • volume (str) – name of source or destination volume
  • qtree (str) – name of source or destination qtree
Returns:

list of all snapmirror pair status

Return type:

list of SnapmirrorStatus or empty list

Raises NidhoggException:
 

if an error occurs

get_snapmirror_volume_status(volume)

Get status of a snapmirror volume.

Parameters:volume (str) – name of volume
Return type:SnapmirrorVolumeStatus
Raises NidhoggException:
 if an error occurs
list_cifs_acls(share_name)

Return ACL of the specified share.

Parameters:share_name (str) – name of the share
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)

Return a list of qtrees of type QTree.

Parameters:volume (str) – name of the volume
Returns:list of qtrees
Return type:list of QTree or empty list
Raises NidhoggException:
 if an error occurs
list_quotas(volume)

Return a list of quota reports of the specified volume.

Parameters:volume (str) – name of the volume
Returns:list of quota reports
Return type:QuotaReport or empty list
Raises NidhoggException:
 if an error occurs
list_snapshots(target_name, target_type=u'volume')

Return list of snapshots for given volume.

Parameters:
  • target_name (str) – name of the volume
  • target_type (str) – type of the volume
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.

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=False)

Set a single ACL for the specifed share.

Parameters:
  • share_name (str) – name of the share
  • user (str) – name of a user or unix group (if set_group_rights = True)
  • 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
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, source_filer=None, source_volume=None, source_qtree=None)

Trigger the snapmirror replication.

If source_filer, source_volume and source_qtree (source location) are not specified (default), then the source in /etc/snapmirror.conf for the destination path must be present.

Parameters:
  • destination_volume (str) – name of snapmirror destination volume
  • destination_qtree (str) – name of snapmirror destination qtree
  • source_filer (str) – hostname of source filer
  • source_volume (str) – name of snapmirror source volume
  • source_qtree (str) – name of snapmirror source qtree
Raises:
  • NidhoggException – if an error occurs
  • NidhoggException – if source params are incomplete
  • NidhoggException – if qtree params are used, but incomplete
update_snapmirror_with_snapshot(name, destination_volume, destination_qtree=None, source_filer=None, source_volume=None, source_qtree=None)

Update the named snapshot to the snapmirror destination.

Use the specified snapshot name also for the snapshot to be created on the destination server if possible.

If source_filer, source_volume and source_qtree (source location) are not specified (default), then the source in /etc/snapmirror.conf for the destination path must be present.

Parameters:
  • name (str) – name of the snapshot
  • destination_volume (str) – name of snapmirror destination volume
  • destination_qtree (str) – name of snapmirror destination qtree
  • source_filer (str) – hostname of source filer
  • source_volume (str) – name of snapmirror source volume
  • source_qtree (str) – name of snapmirror source qtree
Raises:
  • NidhoggException – if an error occurs
  • NidhoggException – if source params are incomplete
  • NidhoggException – if qtree params are used, but incomplete
  • NidhoggException – if source contains no new data
  • NidhoggException – if destination is busy
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