Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initiator type and host os_type #804

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion delfin/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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'
Expand Down
1 change: 1 addition & 0 deletions delfin/db/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
3 changes: 2 additions & 1 deletion delfin/tests/unit/fake_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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"

},
]
Expand Down