4. nidhogg cluster-mode details¶
-
class
nidhogg.clustermode.
ClusterMode
(url, username, password, major, minor, verify, http=<class 'nidhogg.http.NidhoggHttp'>)¶ Bases:
nidhogg.core.Nidhogg
This class implements cluster-mode filer specific API calls.
-
ACL_CHANGE
= 'change'¶ ACL permission constant for write access
-
ACL_FULL_CONTROL
= 'full_control'¶ ACL permission constant for full control
-
ACL_NO_ACCESS
= 'no_access'¶ ACL permission constant for denying access
-
ACL_PERMISSIONS
= ['full_control', 'read', 'change', 'no_access']¶ list of all permission constants
-
ACL_READ
= 'read'¶ ACL permission constant for read access
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
- vscan_fileop_profile (str) – vscan-fileop-profile virus scan option (no_scan, standard, strict, writes_only)
Raises: NidhoggException – if an error occurs
-
create_snapshot
(volume, name, label=None)¶ Create a snapshot with an optional label.
Parameters: - volume (str) – name of the volume
- name (str) – name of the snapshot
- label (str) – add a snapmirror label to snapshot
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 dictRaises: NidhoggException – if an error occurs
-
get_snapmirror_status
(volume=None, max_records=65536)¶ Get status of snapmirror replication pairs. You have to be connected on the destination server.
If no params are provided, return all snapmirror status pairs.
Parameters: volume (str) – name of destination volume Returns: list of all snapmirror pair status Return type: list of SnapmirrorStatus
or empty listRaises: NidhoggException – if an error occurs
-
get_snapmirror_volume_status
(*args, **kwargs)¶ Not available for cluster mode.
-
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 listRaises: NidhoggException – if an error occurs
List all cifs shares.
Returns: list of cifs shares Return type: list of CifsShare
or empty listRaises: 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 listRaises: 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 listRaises: NidhoggException – if an error occurs
-
list_snapmirror_destinations
(volume=None, max_records=65536)¶ List all snapmirror destinations. You have to be connected on the source server.
If no params are provided, return all snapmirror destinations.
Parameters: volume (str) – name of source volume Returns: list of all snapmirror destinations Return type: list of SnapmirrorDestinationInfo
or empty listRaises: 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 listRaises: NidhoggException – if an error occurs
-
list_volumes
(max_records=65536)¶ 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 listRaises: NidhoggException – if an error occurs
-
set_cifs_acl
(share_name, user='everyone', right='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
(volume)¶ Trigger the snapmirror replication. You have to be connected on the destination server.
Parameters: volume (str) – name of snapmirror destination volume Raises: NidhoggException – if an error occurs
-
update_snapmirror_with_snapshot
(name, volume)¶ Trigger the snapmirror replication. You have to be connected on the destination server.
Parameters: - name (str) – name of the source snapshot
- volume (str) – name of snapmirror destination volume
Raises: NidhoggException – if an error occurs
-
volume_info
(volume)¶ 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