From 71458f4a6778e29c9952f741020b6a435e43927b Mon Sep 17 00:00:00 2001 From: tanjy Date: Wed, 18 May 2022 16:57:24 +0800 Subject: [PATCH 1/2] unity code rebase --- delfin/drivers/dell_emc/unity/consts.py | 109 ++ delfin/drivers/dell_emc/unity/rest_handler.py | 32 +- delfin/drivers/dell_emc/unity/unity.py | 448 +++++++- .../drivers/dell_emc/unity/test_emc_unity.py | 993 ++++++++++++++++++ 4 files changed, 1533 insertions(+), 49 deletions(-) diff --git a/delfin/drivers/dell_emc/unity/consts.py b/delfin/drivers/dell_emc/unity/consts.py index c4d848246..cde044ebc 100644 --- a/delfin/drivers/dell_emc/unity/consts.py +++ b/delfin/drivers/dell_emc/unity/consts.py @@ -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 " @@ -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 +} diff --git a/delfin/drivers/dell_emc/unity/rest_handler.py b/delfin/drivers/dell_emc/unity/rest_handler.py index 491db441a..d482e2fa0 100644 --- a/delfin/drivers/dell_emc/unity/rest_handler.py +++ b/delfin/drivers/dell_emc/unity/rest_handler.py @@ -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): @@ -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): @@ -295,3 +304,16 @@ def get_host_lun(self, page): ('fields=id,host,lun', page) 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 diff --git a/delfin/drivers/dell_emc/unity/unity.py b/delfin/drivers/dell_emc/unity/unity.py index 56a30e30a..8dfce7175 100644 --- a/delfin/drivers/dell_emc/unity/unity.py +++ b/delfin/drivers/dell_emc/unity/unity.py @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import time + import six from oslo_log import log from oslo_utils import units @@ -18,7 +20,7 @@ from delfin import exception from delfin.common import constants from delfin.drivers import driver -from delfin.drivers.dell_emc.unity import rest_handler, alert_handler +from delfin.drivers.dell_emc.unity import rest_handler, alert_handler, consts from delfin.drivers.dell_emc.unity.alert_handler import AlertHandler LOG = log.getLogger(__name__) @@ -53,6 +55,57 @@ class UnityStorDriver(driver.StorageDriver): 9: constants.DiskPhysicalType.FLASH, 99: constants.DiskPhysicalType.VMDISK } + VOLUME_PERF_METRICS = { + 'readIops': 'sp.*.storage.lun.*.readsRate', + 'writeIops': 'sp.*.storage.lun.*.writesRate', + 'readThroughput': 'sp.*.storage.lun.*.readBytesRate', + 'writeThroughput': 'sp.*.storage.lun.*.writeBytesRate', + 'responseTime': 'sp.*.storage.lun.*.responseTime', + 'readIoSize': 'sp.*.storage.lun.*.avgReadSize', + 'writeIoSize': 'sp.*.storage.lun.*.avgWriteSize' + } + DISK_PERF_METRICS = { + 'readIops': 'sp.*.physical.disk.*.readsRate', + 'writeIops': 'sp.*.physical.disk.*.writesRate', + 'readThroughput': 'sp.*.physical.disk.*.readBytesRate', + 'writeThroughput': 'sp.*.physical.disk.*.writeBytesRate', + 'responseTime': 'sp.*.physical.disk.*.responseTime' + } + ETHERNET_PORT_METRICS = { + 'readThroughput': 'sp.*.net.device.*.bytesInRate', + 'writeThroughput': 'sp.*.net.device.*.bytesOutRate', + 'readIops': 'sp.*.net.device.*.pktsInRate', + 'writeIops': 'sp.*.net.device.*.pktsOutRate', + } + FC_PORT_METRICS = { + 'readIops': 'sp.*.fibreChannel.fePort.*.readsRate', + 'writeIops': 'sp.*.fibreChannel.fePort.*.writesRate', + 'readThroughput': 'sp.*.fibreChannel.fePort.*.readBytesRate', + 'writeThroughput': 'sp.*.fibreChannel.fePort.*.writeBytesRate' + } + ISCSI_PORT_METRICS = { + 'readIops': 'sp.*.iscsi.fePort.*.readsRate', + 'writeIops': 'sp.*.iscsi.fePort.*.writesRate', + 'readThroughput': 'sp.*.iscsi.fePort.*.readBytesRate', + 'writeThroughput': 'sp.*.iscsi.fePort.*.writeBytesRate' + } + FILESYSTEM_PERF_METRICS = { + 'readIops': 'sp.*.storage.filesystem.*.readsRate', + 'writeIops': 'sp.*.storage.filesystem.*.writesRate', + 'readThroughput': 'sp.*.storage.filesystem.*.readBytesRate', + 'writeThroughput': 'sp.*.storage.filesystem.*.writeBytesRate', + 'readIoSize': 'sp.*.storage.filesystem.*.readSizeAvg', + 'writeIoSize': 'sp.*.storage.filesystem.*.writeSizeAvg' + } + PERF_TYPE_MAP = { + 'readIops': {'write': 'writeIops', + 'total': 'iops'}, + 'readThroughput': {'write': 'writeThroughput', + 'total': 'throughput'}, + 'readIoSize': {'write': 'writeIoSize', + 'total': 'ioSize'}, + } + MS_PER_HOUR = 60 * 60 * 1000 OS_TYPE_MAP = {'AIX': constants.HostOSTypes.AIX, 'Citrix XenServer': constants.HostOSTypes.XEN_SERVER, @@ -110,48 +163,51 @@ def get_storage(self, context): system_info = self.rest_handler.get_storage() capacity = self.rest_handler.get_capacity() version_info = self.rest_handler.get_soft_version() - if system_info is not None and capacity is not None: - system_entries = system_info.get('entries') - for system in system_entries: - content = system.get('content', {}) - name = content.get('name') - model = content.get('model') - serial_number = content.get('serialNumber') - health_value = content.get('health', {}).get('value') - status = UnityStorDriver.STORAGE_STATUS_MAP.get( - health_value, constants.StorageStatus.ABNORMAL) - break - capacity_info = capacity.get('entries') - for per_capacity in capacity_info: - content = per_capacity.get('content', {}) - free = content.get('sizeFree') - total = content.get('sizeTotal') - used = content.get('sizeUsed') - subs = content.get('sizeSubscribed') - break - if version_info: - soft_version = version_info.get('entries') - for soft_info in soft_version: - content = soft_info.get('content', {}) - if content: - version = content.get('id') - break - raw_capacity = self.get_disk_capacity(context) - raw_capacity = raw_capacity if raw_capacity else int(total) - system_result = { - 'name': name, - 'vendor': 'DELL EMC', - 'model': model, - 'status': status, - 'serial_number': serial_number, - 'firmware_version': version, - 'location': '', - 'subscribed_capacity': int(subs), - 'total_capacity': int(total), - 'raw_capacity': raw_capacity, - 'used_capacity': int(used), - 'free_capacity': int(free) - } + if not system_info or not capacity: + err_msg = "unity get system or capacity info failed" + LOG.error(err_msg) + raise exception.StorageBackendException(err_msg) + system_entries = system_info.get('entries') + for system in system_entries: + content = system.get('content', {}) + name = content.get('name') + model = content.get('model') + serial_number = content.get('serialNumber') + health_value = content.get('health', {}).get('value') + status = UnityStorDriver.STORAGE_STATUS_MAP.get( + health_value, constants.StorageStatus.ABNORMAL) + break + capacity_info = capacity.get('entries') + for per_capacity in capacity_info: + content = per_capacity.get('content', {}) + free = content.get('sizeFree') + total = content.get('sizeTotal') + used = content.get('sizeUsed') + subs = content.get('sizeSubscribed') + break + if version_info: + soft_version = version_info.get('entries') + for soft_info in soft_version: + content = soft_info.get('content', {}) + if content: + version = content.get('id') + break + raw_capacity = self.get_disk_capacity(context) + raw_capacity = raw_capacity if raw_capacity else int(total) + system_result = { + 'name': name, + 'vendor': 'DELL EMC', + 'model': model, + 'status': status, + 'serial_number': serial_number, + 'firmware_version': version, + 'location': '', + 'subscribed_capacity': int(subs), + 'total_capacity': int(total), + 'raw_capacity': raw_capacity, + 'used_capacity': int(used), + 'free_capacity': int(free) + } return system_result def list_storage_pools(self, context): @@ -409,7 +465,7 @@ def list_disks(self, context): try: disks = self.rest_handler.get_all_disks() disk_list = [] - if disks is not None: + if disks and disks.get('entries'): disk_entries = disks.get('entries') for disk in disk_entries: content = disk.get('content') @@ -445,6 +501,8 @@ def list_disks(self, context): 'location': content.get('name') } disk_list.append(disk_result) + else: + disk_list = self.get_virtual_disk() return disk_list except Exception as err: @@ -803,3 +861,305 @@ def list_masking_views(self, context): except Exception as e: LOG.error("Failed to get view metrics from unity") raise e + + def get_metrics_loop(self, target, start_time, + end_time, metrics, path): + page = 1 + bend = False + time_map = {'latest_time': 0} + if not path: + return + while True: + if bend is True: + break + results = self.rest_handler.get_history_metrics(path, page) + if not results: + break + if 'entries' not in results: + break + if len(results['entries']) < 1: + break + bend = UnityStorDriver.get_metric_value( + target, start_time, end_time, metrics, results, time_map) + page += 1 + + def get_history_metrics(self, resource_type, targets, + start_time, end_time): + metrics = [] + for target in targets: + path = None + if resource_type == constants.ResourceType.VOLUME: + path = self.VOLUME_PERF_METRICS.get(target) + elif resource_type == constants.ResourceType.DISK: + path = self.DISK_PERF_METRICS.get(target) + elif resource_type == constants.ResourceType.FILESYSTEM: + path = self.FILESYSTEM_PERF_METRICS.get(target) + elif resource_type == constants.ResourceType.PORT: + self.get_metrics_loop(target, start_time, end_time, metrics, + self.ETHERNET_PORT_METRICS.get(target)) + self.get_metrics_loop(target, start_time, end_time, metrics, + self.FC_PORT_METRICS.get(target)) + continue + if path: + self.get_metrics_loop(target, start_time, end_time, + metrics, path) + return metrics + + @staticmethod + def get_metric_value(target, start_time, end_time, metrics, + results, time_map): + try: + if results is None: + return True + entries = results.get('entries') + for entry in entries: + content = entry.get('content') + if not content or not content.get('values'): + continue + occur_time = int(time.mktime(time.strptime( + content.get('timestamp'), + AlertHandler.TIME_PATTERN)) + ) * AlertHandler.SECONDS_TO_MS + hour_offset = (time.mktime(time.localtime()) - time.mktime( + time.gmtime())) / AlertHandler.SECONDS_PER_HOUR + occur_time = occur_time + (int(hour_offset) * + UnityStorDriver.MS_PER_HOUR) + if occur_time < start_time: + return True + if time_map.get('latest_time') <= occur_time \ + and time_map.get('latest_time') != 0: + continue + time_map['latest_time'] = occur_time + if start_time <= occur_time <= end_time: + for sp_value in content.get('values'): + perf_value = content.get('values').get(sp_value) + for key, value in perf_value.items(): + bfind = False + value = float(value) + for metric in metrics: + if metric.get('resource_id') == key and \ + metric.get('type') == target: + if metric.get('values').get( + occur_time): + if target == 'responseTime': + metric.get( + 'values')[occur_time] = \ + max(value, metric.get( + 'values').get( + occur_time)) + else: + metric.get('values')[ + occur_time] += value + else: + metric.get('values')[occur_time] \ + = value + bfind = True + break + if bfind is False: + metric_value = { + 'type': target, + 'resource_id': key, + 'values': {occur_time: value} + } + metrics.append(metric_value) + except Exception as err: + err_msg = "Failed to collect history metrics from Unity: %s, " \ + "target:%s" % (six.text_type(err), target) + LOG.error(err_msg) + return False + + @staticmethod + def count_total_perf(metrics): + if metrics is None: + return + for metric in metrics: + write_tye = None + total_type = None + if UnityStorDriver.PERF_TYPE_MAP.get(metric.get('type')): + write_tye = UnityStorDriver.PERF_TYPE_MAP.get( + metric.get('type')).get('write') + total_type = UnityStorDriver.PERF_TYPE_MAP.get( + metric.get('type')).get('total') + else: + continue + for metric_write in metrics: + if metric_write.get('resource_id') == \ + metric.get('resource_id') \ + and metric_write.get('type') == write_tye: + total = { + 'type': total_type, + 'resource_id': metric.get('resource_id') + } + bfind_total = False + for tr, read in metric.get('values').items(): + for tw, write in metric_write.get( + 'values').items(): + if tr == tw: + value = read + write + if total.get('values'): + total['values'][tr] = value + else: + total['values'] = {tr: value} + bfind_total = True + break + if bfind_total: + metrics.append(total) + break + + @staticmethod + def package_metrics(storage_id, resource_type, metrics, metrics_list): + for metric in metrics_list: + unit = None + if resource_type == constants.ResourceType.PORT: + unit = consts.PORT_CAP[metric.get('type')]['unit'] + elif resource_type == constants.ResourceType.VOLUME: + unit = consts.VOLUME_CAP[metric.get('type')]['unit'] + elif resource_type == constants.ResourceType.DISK: + unit = consts.DISK_CAP[metric.get('type')]['unit'] + elif resource_type == constants.ResourceType.FILESYSTEM: + unit = consts.FILESYSTEM_CAP[metric.get('type')]['unit'] + labels = { + 'storage_id': storage_id, + 'resource_type': resource_type, + 'resource_id': metric.get('resource_id'), + 'type': 'RAW', + 'unit': unit + } + if 'THROUGHPUT' in metric.get('type').upper() or \ + 'RESPONSETIME' in metric.get('type').upper(): + for tm in metric.get('values'): + metric['values'][tm] = metric['values'][tm] / units.k + value = constants.metric_struct(name=metric.get('type'), + labels=labels, + values=metric.get('values')) + metrics.append(value) + + def collect_perf_metrics(self, context, storage_id, + resource_metrics, start_time, + end_time): + metrics = [] + try: + if resource_metrics.get(constants.ResourceType.VOLUME): + volume_metrics = self.get_history_metrics( + constants.ResourceType.VOLUME, + resource_metrics.get(constants.ResourceType.VOLUME), + start_time, + end_time) + UnityStorDriver.count_total_perf(volume_metrics) + UnityStorDriver.package_metrics(storage_id, + constants.ResourceType.VOLUME, + metrics, volume_metrics) + if resource_metrics.get(constants.ResourceType.DISK): + disk_metrics = self.get_history_metrics( + constants.ResourceType.DISK, + resource_metrics.get(constants.ResourceType.DISK), + start_time, + end_time) + UnityStorDriver.count_total_perf(disk_metrics) + UnityStorDriver.package_metrics(storage_id, + constants.ResourceType.DISK, + metrics, disk_metrics) + if resource_metrics.get(constants.ResourceType.PORT): + port_metrics = self.get_history_metrics( + constants.ResourceType.PORT, + resource_metrics.get(constants.ResourceType.PORT), + start_time, + end_time) + UnityStorDriver.count_total_perf(port_metrics) + UnityStorDriver.package_metrics(storage_id, + constants.ResourceType.PORT, + metrics, port_metrics) + if resource_metrics.get(constants.ResourceType.FILESYSTEM): + file_metrics = self.get_history_metrics( + constants.ResourceType.FILESYSTEM, + resource_metrics.get(constants.ResourceType.FILESYSTEM), + start_time, + end_time) + UnityStorDriver.count_total_perf(file_metrics) + UnityStorDriver.package_metrics( + storage_id, constants.ResourceType.FILESYSTEM, + metrics, file_metrics) + except Exception as err: + err_msg = "Failed to collect metrics from Unity: %s" % \ + (six.text_type(err)) + LOG.error(err_msg) + raise exception.InvalidResults(err_msg) + return metrics + + @staticmethod + def get_capabilities(context, filters=None): + """Get capability of supported driver""" + return { + 'is_historic': True, + 'resource_metrics': { + constants.ResourceType.VOLUME: consts.VOLUME_CAP, + constants.ResourceType.PORT: consts.PORT_CAP, + constants.ResourceType.DISK: consts.DISK_CAP, + constants.ResourceType.FILESYSTEM: consts.FILESYSTEM_CAP + } + } + + def get_latest_perf_timestamp(self, context): + latest_time = 0 + page = 1 + results = self.rest_handler.get_history_metrics( + UnityStorDriver.VOLUME_PERF_METRICS.get('readIops'), page) + if not results: + results = self.rest_handler.get_history_metrics( + UnityStorDriver.ETHERNET_PORT_METRICS.get('readIops'), page) + if results: + if 'entries' in results: + entries = results.get('entries') + for entry in entries: + content = entry.get('content') + if not content: + continue + occur_time = int(time.mktime(time.strptime( + content.get('timestamp'), + AlertHandler.TIME_PATTERN)) + ) * AlertHandler.SECONDS_TO_MS + hour_offset = \ + (time.mktime(time.localtime()) - + time.mktime(time.gmtime()))\ + / AlertHandler.SECONDS_PER_HOUR + occur_time = occur_time + (int(hour_offset) * + UnityStorDriver.MS_PER_HOUR) + latest_time = occur_time + break + return latest_time + + def get_virtual_disk(self): + try: + disks = self.rest_handler.get_virtual_disks() + disk_list = [] + if disks is not None: + disk_entries = disks.get('entries') + for disk in disk_entries: + content = disk.get('content') + if not content: + continue + health_value = content.get('health', {}).get('value') + slot_info = \ + content.get('health', {}).get('descriptionIds', []) + if 'ALRT_DISK_SLOT_EMPTY' in slot_info: + continue + if health_value in UnityStorDriver.HEALTH_OK: + status = constants.DiskStatus.NORMAL + else: + status = constants.DiskStatus.ABNORMAL + disk_result = { + 'name': content.get('name'), + 'storage_id': self.storage_id, + 'native_disk_id': content.get('id'), + 'capacity': int(content.get('sizeTotal')), + 'status': status, + 'manufacturer': content.get('manufacturer'), + 'model': content.get('model'), + 'physical_type': constants.DiskPhysicalType.VMDISK + } + disk_list.append(disk_result) + return disk_list + except Exception as err: + err_msg = "Failed to get virtual disk from Unity: %s" % \ + (six.text_type(err)) + raise exception.InvalidResults(err_msg) diff --git a/delfin/tests/unit/drivers/dell_emc/unity/test_emc_unity.py b/delfin/tests/unit/drivers/dell_emc/unity/test_emc_unity.py index 23200620d..445535d67 100644 --- a/delfin/tests/unit/drivers/dell_emc/unity/test_emc_unity.py +++ b/delfin/tests/unit/drivers/dell_emc/unity/test_emc_unity.py @@ -1323,6 +1323,928 @@ 'user_group_name': '22222' } ] +GET_ETH_PORT_READ_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_eth0": "10000", + "spa_eth1": "20000", + "spa_eth2": "30000", + "spa_eth3": "40000" + }, + "spb": { + "spa_eth0": "10000", + "spa_eth1": "20000", + "spa_eth2": "30000", + "spa_eth3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spa": { + "spa_eth0": "40000", + "spa_eth1": "30000", + "spa_eth2": "20000", + "spa_eth3": "10000" + }, + "spb": { + "spa_eth0": "40000", + "spa_eth1": "30000", + "spa_eth2": "20000", + "spa_eth3": "10000" + } + } + } + } + ] +} +GET_ETH_PORT_READ_THR_PERF_NULL = { + "entries": [] +} +GET_ETH_PORT_WRITE_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_eth0": "90000", + "spa_eth1": "80000", + "spa_eth2": "70000", + "spa_eth3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spa": { + "spa_eth0": "60000", + "spa_eth1": "70000", + "spa_eth2": "80000", + "spa_eth3": "90000" + } + } + } + } + ] +} +GET_ETH_PORT_WRITE_THR_PERF_NULL = { + "entries": [] +} +GET_FC_PORT_READ_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_fc0": "10000", + "spa_fc1": "20000", + "spa_fc2": "30000", + "spa_fc3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spa": { + "spa_fc0": "40000", + "spa_fc1": "30000", + "spa_fc2": "20000", + "spa_fc3": "10000" + } + } + } + } + ] +} +GET_FC_PORT_READ_THR_PERF_NULL = { + "entries": [] +} +GET_FC_PORT_WRITE_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_fc0": "90000", + "spa_fc1": "80000", + "spa_fc2": "70000", + "spa_fc3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spa": { + "spa_fc0": "60000", + "spa_fc1": "70000", + "spa_fc2": "80000", + "spa_fc3": "90000" + } + } + } + } + ] +} +GET_FC_PORT_WRITE_THR_PERF_NULL = { + "entries": [] +} +GET_FC_PORT_READ_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_fc0": "10000", + "spa_fc1": "20000", + "spa_fc2": "30000", + "spa_fc3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spa": { + "spa_fc0": "40000", + "spa_fc1": "30000", + "spa_fc2": "20000", + "spa_fc3": "10000" + } + } + } + } + ] +} +GET_FC_PORT_READ_IOPS_PERF_NULL = { + "entries": [] +} +GET_FC_PORT_WRITE_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "spa_fc0": "90000", + "spa_fc1": "80000", + "spa_fc2": "70000", + "spa_fc3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "spa_fc0": "60000", + "spa_fc1": "70000", + "spa_fc2": "80000", + "spa_fc3": "90000" + } + } + } + } + ] +} +GET_FC_PORT_WRITE_IOPS_PERF_NULL = { + "entries": [] +} +GET_VOLUME_READ_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "10000", + "volume1": "20000", + "volume2": "30000", + "volume3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "40000", + "volume1": "30000", + "volume2": "20000", + "volume3": "10000" + } + } + } + } + ] +} +GET_VOLUME_READ_THR_PERF_NULL = { + "entries": [] +} +GET_VOLUME_WRITE_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "90000", + "volume1": "80000", + "volume2": "70000", + "volume3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "60000", + "volume1": "70000", + "volume2": "80000", + "volume3": "90000" + } + } + } + } + ] +} +GET_VOLUME_WRITE_THR_PERF_NULL = { + "entries": [] +} +GET_VOLUME_READ_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "10000", + "volume1": "20000", + "volume2": "30000", + "volume3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "40000", + "volume1": "30000", + "volume2": "20000", + "volume3": "10000" + } + } + } + } + ] +} +GET_VOLUME_READ_IOPS_PERF_NULL = { + "entries": [] +} +GET_VOLUME_WRITE_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "90000", + "volume1": "80000", + "volume2": "70000", + "volume3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "60000", + "volume1": "70000", + "volume2": "80000", + "volume3": "90000" + } + } + } + } + ] +} +GET_VOLUME_WRITE_IOPS_PERF_NULL = { + "entries": [] +} +GET_VOLUME_READ_IO_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "10000", + "volume1": "20000", + "volume2": "30000", + "volume3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "40000", + "volume1": "30000", + "volume2": "20000", + "volume3": "10000" + } + } + } + } + ] +} +GET_VOLUME_READ_IO_PERF_NULL = { + "entries": [] +} +GET_VOLUME_WRITE_IO_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "90000", + "volume1": "80000", + "volume2": "70000", + "volume3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "60000", + "volume1": "70000", + "volume2": "80000", + "volume3": "90000" + } + } + } + } + ] +} +GET_VOLUME_WRITE_IO_PERF_NULL = { + "entries": [] +} +GET_VOLUME_RESPONSE_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "volume0": "90000", + "volume1": "80000", + "volume2": "70000", + "volume3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "volume0": "60000", + "volume1": "70000", + "volume2": "80000", + "volume3": "90000" + } + } + } + } + ] +} +GET_VOLUME_RESPONSE_PERF_NULL = { + "entries": [] +} +GET_DISK_READ_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "DISK0": "10000", + "DISK1": "20000", + "DISK2": "30000", + "DISK3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "DISK0": "40000", + "DISK1": "30000", + "DISK2": "20000", + "DISK3": "10000" + } + } + } + } + ] +} +GET_DISK_READ_THR_PERF_NULL = { + "entries": [] +} +GET_DISK_WRITE_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "DISK0": "90000", + "DISK1": "80000", + "DISK2": "70000", + "DISK3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "DISK0": "60000", + "DISK1": "70000", + "DISK2": "80000", + "DISK3": "90000" + } + } + } + } + ] +} +GET_DISK_WRITE_THR_PERF_NULL = { + "entries": [] +} +GET_DISK_READ_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "DISK0": "10000", + "DISK1": "20000", + "DISK2": "30000", + "DISK3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "DISK0": "40000", + "DISK1": "30000", + "DISK2": "20000", + "DISK3": "10000" + } + } + } + } + ] +} +GET_DISK_READ_IOPS_PERF_NULL = { + "entries": [] +} +GET_DISK_WRITE_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "DISK0": "90000", + "DISK1": "80000", + "DISK2": "70000", + "DISK3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "DISK0": "60000", + "DISK1": "70000", + "DISK2": "80000", + "DISK3": "90000" + } + } + } + } + ] +} +GET_DISK_WRITE_IOPS_PERF_NULL = { + "entries": [] +} +GET_DISK_RESPONSE_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "DISK0": "90000", + "DISK1": "80000", + "DISK2": "70000", + "DISK3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "DISK0": "60000", + "DISK1": "70000", + "DISK2": "80000", + "DISK3": "90000" + } + } + } + } + ] +} +GET_DISK_RESPONSE_PERF_NULL = { + "entries": [] +} +GET_FILE_READ_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "10000", + "FILE1": "20000", + "FILE2": "30000", + "FILE3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "40000", + "FILE1": "30000", + "FILE2": "20000", + "FILE3": "10000" + } + } + } + } + ] +} +GET_FILE_READ_THR_PERF_NULL = { + "entries": [] +} +GET_FILE_WRITE_THR_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "90000", + "FILE1": "80000", + "FILE2": "70000", + "FILE3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "60000", + "FILE1": "70000", + "FILE2": "80000", + "FILE3": "90000" + } + } + } + } + ] +} +GET_FILE_WRITE_THR_PERF_NULL = { + "entries": [] +} +GET_FILE_READ_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "10000", + "FILE1": "20000", + "FILE2": "30000", + "FILE3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "40000", + "FILE1": "30000", + "FILE2": "20000", + "FILE3": "10000" + } + } + } + } + ] +} +GET_FILE_READ_IOPS_PERF_NULL = { + "entries": [] +} +GET_FILE_WRITE_IOPS_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "90000", + "FILE1": "80000", + "FILE2": "70000", + "FILE3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "60000", + "FILE1": "70000", + "FILE2": "80000", + "FILE3": "90000" + } + } + } + } + ] +} +GET_FILE_WRITE_IOPS_PERF_NULL = { + "entries": [] +} +GET_FILE_READ_IO_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "10000", + "FILE1": "20000", + "FILE2": "30000", + "FILE3": "40000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "40000", + "FILE1": "30000", + "FILE2": "20000", + "FILE3": "10000" + } + } + } + } + ] +} +GET_FILE_READ_IO_PERF_NULL = { + "entries": [] +} +GET_FILE_WRITE_IO_PERF = { + "entries": [ + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:47:10.000Z", + "values": { + "spa": { + "FILE0": "90000", + "FILE1": "80000", + "FILE2": "70000", + "FILE3": "60000" + } + } + } + }, + { + "content": { + "queryId": 46, + "path": "sp.*.net.device.*.bytesOut", + "timestamp": "2021-07-08T06:46:10.000Z", + "values": { + "spb": { + "FILE0": "60000", + "FILE1": "70000", + "FILE2": "80000", + "FILE3": "90000" + } + } + } + } + ] +} +GET_FILE_WRITE_IO_PERF_NULL = { + "entries": [] +} +resource_metrics = { + 'volume': [ + 'iops', 'readIops', 'writeIops', + 'throughput', 'readThroughput', 'writeThroughput', + 'responseTime', + 'ioSize', 'readIoSize', 'writeIoSize', + ], + 'port': [ + 'iops', 'readIops', 'writeIops', + 'throughput', 'readThroughput', 'writeThroughput' + ], + 'disk': [ + 'iops', 'readIops', 'writeIops', + 'throughput', 'readThroughput', 'writeThroughput', + 'responseTime' + ], + 'filesystem': [ + 'iops', 'readIops', 'writeIops', + 'throughput', 'readThroughput', 'writeThroughput', + 'readIoSize', 'writeIoSize' + ] +} GET_ALL_INIT = { "entries": [ { @@ -1758,6 +2680,77 @@ def test_list_quotas(self, mock_user, mock_qtree): quota = UnityStorDriver(**ACCESS_INFO).list_quotas(context) self.assertEqual(quota, quota_result) + @mock.patch.object(RestHandler, 'get_history_metrics') + def test_collect_perf_metrics(self, mock_history): + RestHandler.login = mock.Mock(return_value=None) + start_time = 1625726770000 + end_time = 1625726830000 + storage_id = '12345' + mock_history.side_effect = [GET_VOLUME_READ_THR_PERF, + GET_VOLUME_READ_THR_PERF_NULL, + GET_VOLUME_WRITE_THR_PERF, + GET_VOLUME_WRITE_THR_PERF_NULL, + GET_VOLUME_READ_IOPS_PERF, + GET_VOLUME_READ_IOPS_PERF_NULL, + GET_VOLUME_WRITE_IOPS_PERF, + GET_VOLUME_WRITE_IOPS_PERF_NULL, + GET_VOLUME_READ_IO_PERF, + GET_VOLUME_READ_IO_PERF_NULL, + GET_VOLUME_WRITE_IO_PERF, + GET_VOLUME_WRITE_IO_PERF_NULL, + GET_VOLUME_RESPONSE_PERF, + GET_VOLUME_RESPONSE_PERF_NULL, + GET_DISK_READ_THR_PERF, + GET_DISK_READ_THR_PERF_NULL, + GET_DISK_WRITE_THR_PERF, + GET_DISK_WRITE_THR_PERF_NULL, + GET_DISK_READ_IOPS_PERF, + GET_DISK_READ_IOPS_PERF_NULL, + GET_DISK_WRITE_IOPS_PERF, + GET_DISK_WRITE_IOPS_PERF_NULL, + GET_DISK_RESPONSE_PERF, + GET_DISK_RESPONSE_PERF_NULL, + GET_ETH_PORT_READ_THR_PERF, + GET_ETH_PORT_READ_THR_PERF_NULL, + GET_ETH_PORT_WRITE_THR_PERF, + GET_ETH_PORT_WRITE_THR_PERF_NULL, + GET_FC_PORT_READ_THR_PERF, + GET_ETH_PORT_READ_THR_PERF, + GET_ETH_PORT_READ_THR_PERF_NULL, + GET_ETH_PORT_WRITE_THR_PERF, + GET_ETH_PORT_WRITE_THR_PERF_NULL, + GET_FC_PORT_READ_THR_PERF, + GET_FC_PORT_READ_THR_PERF_NULL, + GET_FC_PORT_WRITE_THR_PERF, + GET_FC_PORT_WRITE_THR_PERF_NULL, + GET_FC_PORT_READ_IOPS_PERF, + GET_FC_PORT_READ_IOPS_PERF_NULL, + GET_FC_PORT_WRITE_IOPS_PERF, + GET_FC_PORT_WRITE_IOPS_PERF_NULL, + GET_FILE_READ_THR_PERF, + GET_FILE_READ_THR_PERF_NULL, + GET_FILE_WRITE_THR_PERF, + GET_FILE_WRITE_THR_PERF_NULL, + GET_FILE_READ_IOPS_PERF, + GET_FILE_READ_IOPS_PERF_NULL, + GET_FILE_WRITE_IOPS_PERF, + GET_FILE_WRITE_IOPS_PERF_NULL, + GET_FILE_READ_IO_PERF, + GET_FILE_READ_IO_PERF_NULL, + GET_FILE_WRITE_IO_PERF, + GET_FILE_WRITE_IO_PERF_NULL] + metrics = UnityStorDriver(**ACCESS_INFO).collect_perf_metrics( + context, storage_id, resource_metrics, start_time, end_time) + self.assertEqual(metrics[0][1]['resource_id'], 'volume0') + + @mock.patch.object(RestHandler, 'get_history_metrics') + def test_latest_perf_timestamp(self, mock_history): + RestHandler.login = mock.Mock(return_value=None) + mock_history.return_value = GET_VOLUME_READ_THR_PERF + last_time = UnityStorDriver(**ACCESS_INFO).get_latest_perf_timestamp( + context) + self.assertEqual(last_time, 1625726830000) + @mock.patch.object(RestHandler, 'get_host_initiators') def test_host_initiators(self, mock_init): RestHandler.login = mock.Mock(return_value=None) From cee1edb9e5ed7e041069d5b57e33b06b3012d700 Mon Sep 17 00:00:00 2001 From: tanjy Date: Wed, 18 May 2022 17:15:45 +0800 Subject: [PATCH 2/2] unity code rebase --- delfin/drivers/dell_emc/unity/rest_handler.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/delfin/drivers/dell_emc/unity/rest_handler.py b/delfin/drivers/dell_emc/unity/rest_handler.py index 9d09765d3..d482e2fa0 100644 --- a/delfin/drivers/dell_emc/unity/rest_handler.py +++ b/delfin/drivers/dell_emc/unity/rest_handler.py @@ -302,17 +302,6 @@ def get_host_ip(self): def get_host_lun(self, page): url = '/api/types/hostLUN/instances?%s&page=%s' % \ ('fields=id,host,lun', page) - - 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