Skip to content

Commit

Permalink
update msa mapping view (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
luojiagen authored May 20, 2022
1 parent 32769d1 commit 00a5d58
Show file tree
Hide file tree
Showing 5 changed files with 1,263 additions and 77 deletions.
37 changes: 21 additions & 16 deletions delfin/drivers/hpe/hpe_msa/consts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from delfin.common import constants


class AlertOIDNumber:
class AlertOIDNumber(object):
OID_ERR_ID = '1.3.6.1.3.94.1.11.1.1'
OID_EVENT_TYPE = '1.3.6.1.3.94.1.11.1.7'
OID_LAST_TIME = '1.3.6.1.3.94.1.11.1.4'
Expand All @@ -10,11 +10,11 @@ class AlertOIDNumber:
OID_SEVERITY = '1.3.6.1.3.94.1.11.1.6'


class StorageVendor:
class StorageVendor(object):
HPE_MSA_VENDOR = "HPE"


class TrapSeverity:
class TrapSeverity(object):
TRAP_SEVERITY_MAP = {
'1': 'unknown',
'2': 'emergency',
Expand All @@ -28,32 +28,37 @@ class TrapSeverity:
'10': 'mark'
}

SEVERITY_MAP = {"warning": "Warning",
"informational": "Informational",
"error": "Major"
}
SEVERITY_MAP = {
"warning": "Warning",
"informational": "Informational",
"error": "Major"
}


class SecondsNumber:
class SecondsNumber(object):
SECONDS_TO_MS = 1000


class RpmSpeed:
class RpmSpeed(object):
RPM_SPEED = 1000


class DiskPhysicalType:
class DiskPhysicalType(object):
DISK_PHYSICAL_TYPE = {
'fc': constants.DiskPhysicalType.FC,
'SAS': constants.DiskPhysicalType.SAS
}


class InitiatorType:
class InitiatorType(object):
ISCSI_INITIATOR_TYPE = "9"
FC_INITIATOR_TYPE = "6"
SAS_INITIATOR_TYPE = "8"
ISCSI_INITIATOR_DESCRIPTION = 'iSCSI Initiator'
FC_INITIATOR_DESCRIPTION = 'FC Initiator'
IB_INITIATOR_DESCRIPTION = 'IB Initiator'
UNKNOWN_INITIATOR_DESCRIPTION = 'Unknown Initiator'
ISCSI_INITIATOR_DESCRIPTION = constants.InitiatorType.ISCSI
FC_INITIATOR_DESCRIPTION = constants.InitiatorType.FC
UNKNOWN_INITIATOR_DESCRIPTION = constants.InitiatorType.UNKNOWN


class HostOSTypes(object):
MSA_HOST_TYPE = {
'HP-UX': constants.HostOSTypes.HP_UX
}
22 changes: 22 additions & 0 deletions delfin/drivers/hpe/hpe_msa/hpe_msastor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,25 @@ def parse_alert(context, alert):

def clear_alert(self, context, alert):
pass

def list_storage_host_initiators(self, context):
return self.ssh_handler.list_storage_host_initiators(self.storage_id)

def list_storage_hosts(self, context):
return self.ssh_handler.list_storage_hosts(self.storage_id)

def list_storage_host_groups(self, context):
return self.ssh_handler.list_storage_host_groups(self.storage_id)

def list_port_groups(self, context):
return self.ssh_handler.list_port_groups(self.storage_id)

def list_volume_groups(self, context):
return self.ssh_handler.list_volume_groups(self.storage_id)

def list_masking_views(self, context):
return self.ssh_handler.list_masking_views(self.storage_id)

@staticmethod
def get_access_url():
return 'https://{ip}'
Loading

0 comments on commit 00a5d58

Please sign in to comment.