Skip to content

Commit

Permalink
add driver interfaces for Port, Controller, NAS(FS, QTree, Share, Quo…
Browse files Browse the repository at this point in the history
…ta) (#597)
  • Loading branch information
guankc authored Jun 10, 2021
1 parent 73fe3a1 commit 93b3b01
Show file tree
Hide file tree
Showing 7 changed files with 689 additions and 136 deletions.
14 changes: 7 additions & 7 deletions delfin/drivers/netapp/dataontap/cluster_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ def list_volumes(self, context):
return self.netapp_handler.list_volumes(self.storage_id)

def list_controllers(self, context):
pass
return self.netapp_handler.list_controllers(self.storage_id)

def list_ports(self, context):
pass
return self.netapp_handler.list_ports(self.storage_id)

def list_disks(self, context):
pass
return self.netapp_handler.list_disks(self.storage_id)

def list_alerts(self, context, query_para=None):
return self.netapp_handler.list_alerts(query_para)

def list_qtrees(self, context):
pass
return self.netapp_handler.list_qtrees(self.storage_id)

def list_quotas(self, context):
pass
return self.netapp_handler.list_quotas(self.storage_id)

def list_filesystems(self, context):
pass
return self.netapp_handler.list_filesystems(self.storage_id)

def list_shares(self, context):
pass
return self.netapp_handler.list_shares(self.storage_id)

def add_trap_config(self, context, trap_config):
pass
Expand Down
72 changes: 70 additions & 2 deletions delfin/drivers/netapp/dataontap/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
EVENT_SHOW_DETAIL_COMMAND = "event show -instance -severity EMERGENCY"
ALTER_SPLIT_STR = " Node"
EVENT_TIME_TYPE = '%m/%d/%Y %H:%M:%S'

ALTER_TIME_TYPE = '%a %b %d %H:%M:%S %Y'

CLEAR_ALERT_COMMAND = \
Expand All @@ -39,15 +40,40 @@
DISK_SHOW_DETAIL_COMMAND = "disk show -instance"
DISK_SHOW_PHYSICAL_COMMAND = "disk show -physical"
DISK_SPLIT_STR = " Dis"
DISK_ERROR_COMMAND = "disk error show"

LUN_SHOW_DETAIL_COMMAND = "lun show -instance"
LUN_SPLIT_STR = " Vserver"

CONTROLLER_SHOW_DETAIL_COMMAND = "node show -instance"
CONTROLLER_SPLIT_STR = " Nod"

PORT_SHOW_DETAIL_COMMAND = "port show -instance"
INTERFACE_SHOW_DETAIL_COMMAND = "network interface show -instance"
FC_PORT_SHOW_DETAIL_COMMAND = "fcp adapter show -instance"
PORT_SPLIT_STR = " Nod"
INTERFACE_SPLIT_STR = " Vserver "

QTREE_SHOW_DETAIL_COMMAND = "qtree show -instance"
QTREE_SPLIT_STR = " Vserver "

CIFS_SHARE_SHOW_DETAIL_COMMAND = "vserver cifs share show -instance" \
" -vserver %(vserver_name)s"
CIFS_SHARE_SPLIT_STR = " Vserve"
SHARE_AGREEMENT_SHOW_COMMAND = "vserver show -fields Allowed-protocols"
VSERVER_SHOW_COMMAND = "vserver show -type data"

STORAGE_VENDOR = "netapp"
STORAGE_MODEL = "cmodel"

CONTROLLER_SHOW_DETAIL_COMMAND = "node show -instance"
CONTROLLER_SPLIT_STR = " Nod"
QUOTA_SHOW_DETAIL_COMMAND = "volume quota policy rule show -instance"
QUOTA_SPLIT_STR = " Vserve"

AGGREGATE_NAME = "e"
POOL_NAME = "ame"
DISK_NAME = "k"
CONTROLLER_NAME = "e"
VSERVER_NAME = "r"

STORAGE_STATUS = {
'ok': constants.StorageStatus.NORMAL,
Expand Down Expand Up @@ -134,6 +160,48 @@
'force-offline': constants.FilesystemStatus.FAULTY,
}

NETWORK_LOGICAL_TYPE = {
'data': constants.PortLogicalType.DATA,
'cluster': constants.PortLogicalType.CLUSTER,
'node-mgmt': constants.PortLogicalType.NODE_MGMT,
'cluster-mgmt': constants.PortLogicalType.CLUSTER_MGMT,
'intercluster': constants.PortLogicalType.INTERCLUSTER,
}

ETH_LOGICAL_TYPE = {
'physical': constants.PortLogicalType.PHYSICAL,
'if-group': constants.PortLogicalType.IF_GROUP,
'vlan': constants.PortLogicalType.VLAN,
'undef': constants.PortLogicalType.OTHER
}

FC_TYPE = {
'fibre-channel': constants.PortType.FC,
'ethernet': constants.PortType.FCOE
}

WORM_TYPE = {
'non-snaplock': constants.WORMType.NON_WORM,
'compliance': constants.WORMType.COMPLIANCE,
'enterprise': constants.WORMType.ENTERPRISE
}

QUOTA_TYPE = {
'user': constants.QuotaType.USER,
'tree': constants.QuotaType.TREE,
'group': constants.QuotaType.GROUP
}

NETWORK_PORT_TYPE = {
'nfs': constants.PortType.NFS,
'cifs': constants.PortType.CIFS,
'iscsi': constants.PortType.ISCSI,
'fcp': constants.PortType.FC,
'fcache': constants.PortType.FCACHE,
'none': constants.PortType.OTHER,
'nfs, cifs': constants.PortType.NFS_CIFS
}

SEVERITY_MAP = {
'AccessCache.ReachedLimits': 'EMERGENCY',
'LUN.inconsistent.filesystem': 'EMERGENCY',
Expand Down
Loading

0 comments on commit 93b3b01

Please sign in to comment.