diff --git a/delfin/common/constants.py b/delfin/common/constants.py index c512cb8aa..bff18dc3c 100644 --- a/delfin/common/constants.py +++ b/delfin/common/constants.py @@ -261,9 +261,10 @@ class HostOSTypes(object): WINDOWS_SERVER_2012 = 'Windows Server 2012' ORACLE_VM = 'Oracle VM' OPEN_VMS = 'Open VMS' + UNKNOWN = 'Unknown' ALL = (LINUX, WINDOWS, SOLARIS, HP_UX, AIX, XEN_SERVER, VMWARE_ESX, - LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS) + LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS, UNKNOWN) class InitiatorStatus(object): @@ -274,6 +275,15 @@ class InitiatorStatus(object): ALL = (ONLINE, OFFLINE, UNKNOWN) +class InitiatorType(object): + FC = 'fc' + ISCSI = 'iscsi' + NVME_OVER_ROCE = 'roce' + UNKNOWN = 'unknown' + + ALL = (FC, ISCSI, NVME_OVER_ROCE, UNKNOWN) + + # Enumerations for alert severity class Severity(object): FATAL = 'Fatal' diff --git a/delfin/db/sqlalchemy/models.py b/delfin/db/sqlalchemy/models.py index 815f5c5d1..cabbf750a 100644 --- a/delfin/db/sqlalchemy/models.py +++ b/delfin/db/sqlalchemy/models.py @@ -302,6 +302,7 @@ class StorageHostInitiator(BASE, DelfinBase): alias = Column(String(255)) wwn = Column(String(255)) status = Column(String(255)) + type = Column(String(255)) native_storage_host_id = Column(String(255)) native_storage_host_initiator_id = Column(String(255)) diff --git a/delfin/tests/unit/fake_data.py b/delfin/tests/unit/fake_data.py index 643bbd275..287646442 100644 --- a/delfin/tests/unit/fake_data.py +++ b/delfin/tests/unit/fake_data.py @@ -103,7 +103,7 @@ def fake_storage_host_initiator_create(): 'updated_at': '2020-06-10T07:17:08.707356', 'native_storage_host_initiator_id': 'storage_host_initiator_1', 'native_storage_host_id': 'storage_host_1', - 'wwn': 'wwn1', } + 'wwn': 'wwn1', 'type': 'fc'} return fake_storage_host_initiators @@ -121,6 +121,7 @@ def fake_expected_storage_host_initiator_create(): "native_storage_host_initiator_id": "storage_host_initiator_1", "native_storage_host_id": "storage_host_1", "wwn": "wwn1", + "type": "fc" }, ]