-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add msa system pool volume disks alerts resources (#761)
- Loading branch information
Showing
8 changed files
with
1,235 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from delfin.common import constants | ||
|
||
|
||
class AlertOIDNumber: | ||
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' | ||
OID_EVENT_DESC = '1.3.6.1.3.94.1.11.1.9' | ||
OID_EVENT_ID = '1.3.6.1.3.94.1.11.1.3' | ||
OID_SEVERITY = '1.3.6.1.3.94.1.11.1.6' | ||
|
||
|
||
class StorageVendor: | ||
HPE_MSA_VENDOR = "HPE" | ||
|
||
|
||
class TrapSeverity: | ||
TRAP_SEVERITY_MAP = { | ||
'1': 'unknown', | ||
'2': 'emergency', | ||
'3': 'alert', | ||
'4': constants.Severity.CRITICAL, | ||
'5': 'error', | ||
'6': constants.Severity.WARNING, | ||
'7': 'notify', | ||
'8': constants.Severity.INFORMATIONAL, | ||
'9': 'debug', | ||
'10': 'mark' | ||
} | ||
|
||
SEVERITY_MAP = {"warning": "Warning", | ||
"informational": "Informational", | ||
"error": "Major" | ||
} | ||
|
||
|
||
class SecondsNumber: | ||
SECONDS_TO_MS = 1000 | ||
|
||
|
||
class RpmSpeed: | ||
RPM_SPEED = 1000 | ||
|
||
|
||
class DiskPhysicalType: | ||
DISK_PHYSICAL_TYPE = { | ||
'fc': constants.DiskPhysicalType.FC, | ||
'SAS': constants.DiskPhysicalType.SAS | ||
} | ||
|
||
|
||
class InitiatorType: | ||
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from delfin.drivers import driver | ||
from delfin.drivers.hpe.hpe_msa import ssh_handler | ||
from delfin.drivers.hpe.hpe_msa.ssh_handler import SSHHandler | ||
|
||
|
||
class HpeMsaStorDriver(driver.StorageDriver): | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
self.ssh_handler = ssh_handler.SSHHandler(**kwargs) | ||
|
||
def reset_connection(self, context, **kwargs): | ||
self.ssh_handler.login() | ||
|
||
def get_storage(self, context): | ||
return self.ssh_handler.get_storage(self.storage_id) | ||
|
||
def list_storage_pools(self, context): | ||
return self.ssh_handler.list_storage_pools(self.storage_id) | ||
|
||
def list_volumes(self, context): | ||
return self.ssh_handler.list_storage_volume(self.storage_id) | ||
|
||
def list_controllers(self, context): | ||
return self.ssh_handler.\ | ||
list_storage_controller(self.storage_id) | ||
|
||
def list_ports(self, context): | ||
return self.ssh_handler.list_storage_ports(self.storage_id) | ||
|
||
def list_disks(self, context): | ||
return self.ssh_handler.list_storage_disks(self.storage_id) | ||
|
||
def list_alerts(self, context, query_para=None): | ||
return self.ssh_handler.list_alerts(query_para) | ||
|
||
def add_trap_config(self, context, trap_config): | ||
pass | ||
|
||
def remove_trap_config(self, context, trap_config): | ||
pass | ||
|
||
@staticmethod | ||
def parse_alert(context, alert): | ||
return SSHHandler.parse_alert(alert) | ||
|
||
def clear_alert(self, context, alert): | ||
pass |
Oops, something went wrong.