Skip to content

Commit

Permalink
Merge branch 'master' into netapp_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjiangyu-ghca authored May 20, 2022
2 parents d01190d + 00a5d58 commit 9e0f778
Show file tree
Hide file tree
Showing 65 changed files with 12,118 additions and 281 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ This is one of the SODA Core Projects and is maintained by SODA Foundation direc

## Quick Start - To Use/Experience

[https://docs.sodafoundation.io](https://docs.sodafoundation.io/)
[https://docs.sodafoundation.io/guides/user-guides/delfin](https://docs.sodafoundation.io/guides/user-guides/delfin/)

## Quick Start - To Develop

[https://docs.sodafoundation.io](https://docs.sodafoundation.io/)
[https://docs.sodafoundation.io/guides/developer-guides/delfin](https://docs.sodafoundation.io/guides/developer-guides/delfin/)

## Latest Releases

Expand Down
9 changes: 9 additions & 0 deletions delfin/api/schemas/storage_capabilities_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@
'maxLength': 255}
},
},
'ioSize': {
'type': 'object',
'properties': {
'unit': {'type': 'string', 'enum': ["KB"]},
'description': {'type': 'string',
'minLength': 1,
'maxLength': 255}
},
},
'readIoSize': {
'type': 'object',
'properties': {
Expand Down
7 changes: 5 additions & 2 deletions delfin/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ class PortLogicalType(object):
class DiskStatus(object):
NORMAL = 'normal'
ABNORMAL = 'abnormal'
DEGRADED = 'degraded'
OFFLINE = 'offline'

ALL = (NORMAL, ABNORMAL, OFFLINE)
ALL = (NORMAL, ABNORMAL, DEGRADED, OFFLINE)


class DiskPhysicalType(object):
Expand Down Expand Up @@ -262,10 +263,12 @@ class HostOSTypes(object):
WINDOWS_SERVER_2012 = 'Windows Server 2012'
ORACLE_VM = 'Oracle VM'
OPEN_VMS = 'Open VMS'
MAC_OS = 'Mac OS'
UNKNOWN = 'Unknown'

ALL = (LINUX, WINDOWS, SOLARIS, HP_UX, AIX, XEN_SERVER, VMWARE_ESX,
LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS, UNKNOWN)
LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS, MAC_OS,
UNKNOWN)


class InitiatorStatus(object):
Expand Down
109 changes: 109 additions & 0 deletions delfin/drivers/dell_emc/unity/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

DEFAULT_TIMEOUT = 10
ALERT_TIMEOUT = 20
REST_RETRY_TIMES = 1
TRAP_DESC = {
"1:127486a": ["WARNING", "ALRT_LCC_FW_UPGRADE_FAILED",
"The link control card (LCC) will continue to function with "
Expand Down Expand Up @@ -3454,3 +3455,111 @@
"Performance metrics are unavailable due to a system error."
" Contact your service provider."]
}
IOPS_DESCRIPTION = {
"unit": "IOPS",
"description": "Input/output operations per second"
}
READ_IOPS_DESCRIPTION = {
"unit": "IOPS",
"description": "Read input/output operations per second"
}
WRITE_IOPS_DESCRIPTION = {
"unit": "IOPS",
"description": "Write input/output operations per second"
}
THROUGHPUT_DESCRIPTION = {
"unit": "MB/s",
"description": "Represents how much data is "
"successfully transferred in MB/s"
}
READ_THROUGHPUT_DESCRIPTION = {
"unit": "MB/s",
"description": "Represents how much data read is "
"successfully transferred in MB/s"
}
WRITE_THROUGHPUT_DESCRIPTION = {
"unit": "MB/s",
"description": "Represents how much data write is "
"successfully transferred in MB/s"
}
RESPONSE_TIME_DESCRIPTION = {
"unit": "ms",
"description": "Average time taken for an IO "
"operation in ms"
}
CACHE_HIT_RATIO_DESCRIPTION = {
"unit": "%",
"description": "Percentage of io that are cache hits"
}
READ_CACHE_HIT_RATIO_DESCRIPTION = {
"unit": "%",
"description": "Percentage of read ops that are cache hits"
}
WRITE_CACHE_HIT_RATIO_DESCRIPTION = {
"unit": "%",
"description": "Percentage of write ops that are cache hits"
}
IO_SIZE_DESCRIPTION = {
"unit": "KB",
"description": "The average size of IO requests in KB"
}
READ_IO_SIZE_DESCRIPTION = {
"unit": "KB",
"description": "The average size of read IO requests in KB"
}
WRITE_IO_SIZE_DESCRIPTION = {
"unit": "KB",
"description": "The average size of write IO requests in KB"
}
CPU_USAGE_DESCRIPTION = {
"unit": "%",
"description": "Percentage of CPU usage"
}
MEMORY_USAGE_DESCRIPTION = {
"unit": "%",
"description": "Percentage of DISK memory usage in percentage"
}
SERVICE_TIME = {
"unit": 'ms',
"description": "Service time of the resource in ms"
}
VOLUME_CAP = {
"iops": IOPS_DESCRIPTION,
"readIops": READ_IOPS_DESCRIPTION,
"writeIops": WRITE_IOPS_DESCRIPTION,
"throughput": THROUGHPUT_DESCRIPTION,
"readThroughput": READ_THROUGHPUT_DESCRIPTION,
"writeThroughput": WRITE_THROUGHPUT_DESCRIPTION,
"responseTime": RESPONSE_TIME_DESCRIPTION,
"ioSize": IO_SIZE_DESCRIPTION,
"readIoSize": READ_IO_SIZE_DESCRIPTION,
"writeIoSize": WRITE_IO_SIZE_DESCRIPTION
}
PORT_CAP = {
"iops": IOPS_DESCRIPTION,
"readIops": READ_IOPS_DESCRIPTION,
"writeIops": WRITE_IOPS_DESCRIPTION,
"throughput": THROUGHPUT_DESCRIPTION,
"readThroughput": READ_THROUGHPUT_DESCRIPTION,
"writeThroughput": WRITE_THROUGHPUT_DESCRIPTION
}
DISK_CAP = {
"iops": IOPS_DESCRIPTION,
"readIops": READ_IOPS_DESCRIPTION,
"writeIops": WRITE_IOPS_DESCRIPTION,
"throughput": THROUGHPUT_DESCRIPTION,
"readThroughput": READ_THROUGHPUT_DESCRIPTION,
"writeThroughput": WRITE_THROUGHPUT_DESCRIPTION,
"responseTime": RESPONSE_TIME_DESCRIPTION
}
FILESYSTEM_CAP = {
"iops": IOPS_DESCRIPTION,
"readIops": READ_IOPS_DESCRIPTION,
"writeIops": WRITE_IOPS_DESCRIPTION,
"throughput": THROUGHPUT_DESCRIPTION,
"readThroughput": READ_THROUGHPUT_DESCRIPTION,
"writeThroughput": WRITE_THROUGHPUT_DESCRIPTION,
"ioSize": IO_SIZE_DESCRIPTION,
"readIoSize": READ_IO_SIZE_DESCRIPTION,
"writeIoSize": WRITE_IO_SIZE_DESCRIPTION
}
32 changes: 27 additions & 5 deletions delfin/drivers/dell_emc/unity/rest_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RestHandler(RestClient):
REST_QTREE_URL = '/api/types/treeQuota/instances'
REST_USERQUOTA_URL = '/api/types/userQuota/instances'
REST_QUOTACONFIG_URL = '/api/types/quotaConfig/instances'
REST_VIRTUAL_DISK_URL = '/api/types/virtualDisk/instances'
STATE_SOLVED = 2

def __init__(self, **kwargs):
Expand Down Expand Up @@ -106,11 +107,19 @@ def logout(self):

def get_rest_info(self, url, data=None, method='GET',
calltimeout=consts.DEFAULT_TIMEOUT):
result_json = None
res = self.call(url, data, method, calltimeout)
if res.status_code == 200:
result_json = res.json()
return result_json
retry_times = consts.REST_RETRY_TIMES
while retry_times >= 0:
try:
res = self.call(url, data, method, calltimeout)
if res.status_code == 200:
return res.json()
err_msg = "rest response abnormal,status_code:%s,res.json:%s" \
% (res.status_code, res.json())
LOG.error(err_msg)
except Exception as e:
LOG.error(e)
retry_times -= 1
return None

def call(self, url, data=None, method='GET',
calltimeout=consts.DEFAULT_TIMEOUT):
Expand Down Expand Up @@ -271,3 +280,16 @@ def get_quota_configs(self):
'fields=id,filesystem,treeQuota,quotaPolicy')
result_json = self.get_rest_info(url)
return result_json

def get_history_metrics(self, path, page):
url = '/api/types/metricValue/instances?filter=path EQ "%s"&page=%s'\
% (path, page)
result_json = self.get_rest_info(url)
return result_json

def get_virtual_disks(self):
url = '%s?%s' % (RestHandler.REST_VIRTUAL_DISK_URL,
'fields=health,name,spaScsiId,tierType,sizeTotal,'
'id,model,manufacturer,wwn')
result_json = self.get_rest_info(url)
return result_json
Loading

0 comments on commit 9e0f778

Please sign in to comment.