From b6178e0a85311ed41b92c2f4e4e8e45b73d41a7a Mon Sep 17 00:00:00 2001 From: Tao He Date: Wed, 13 Aug 2025 07:56:37 +0000 Subject: [PATCH] Remove query metrics from snapshot_policy --- PyPowerFlex/objects/gen2/snapshot_policy.py | 10 ---------- tests/gen2/test_snapshot_policy.py | 20 -------------------- 2 files changed, 30 deletions(-) diff --git a/PyPowerFlex/objects/gen2/snapshot_policy.py b/PyPowerFlex/objects/gen2/snapshot_policy.py index 1de8351..ac9b1fe 100644 --- a/PyPowerFlex/objects/gen2/snapshot_policy.py +++ b/PyPowerFlex/objects/gen2/snapshot_policy.py @@ -107,16 +107,6 @@ def remove_source_volume(self, return self.get(entity_id=snapshot_policy_id) - def query_snapshot_policy_metrics(self, snapshot_policy_id, metrics=None): - """Query PowerFlex Metrics for snapshot policy. - TODO TTHE make sure this API is valid after new dev build is ready - - :type snapshot_policy_id: str - :type metrics: list|tuple - :rtype: dict - """ - return self.query_metrics('snapshot_policy', [snapshot_policy_id], metrics) - def get_statistics(self, snapshot_policy_id, fields=None): """Get PowerFlex Snapshot Policy Statistics not supported in PowerFlex 5.x. diff --git a/tests/gen2/test_snapshot_policy.py b/tests/gen2/test_snapshot_policy.py index 142cb36..98de031 100644 --- a/tests/gen2/test_snapshot_policy.py +++ b/tests/gen2/test_snapshot_policy.py @@ -56,9 +56,6 @@ def setUp(self): {}, f'/instances/SnapshotPolicy::{self.fake_policy_id}/action/resumeSnapshotPolicy': {}, - '/dtapi/rest/v1/metrics/query': { - self.fake_policy_id: {'numOfpypowerflexVols': 1} - }, }, self.RESPONSE_MODE.Invalid: { '/types/SnapshotPolicy/instances': @@ -222,23 +219,6 @@ def test_snapshot_policy_resume_bad_status(self): self.client.snapshot_policy.resume, self.fake_policy_id) - def test_snapshot_policy_query_metrics(self): - """ - Test snapshot policy query selected metrics. - """ - ret = self.client.snapshot_policy.query_snapshot_policy_metrics(self.fake_policy_id) - assert ret.get(self.fake_policy_id).get("numOfpypowerflexVols") == 1 - - def test_snapshot_policy_query_metrics_bad_status(self): - """ - Test snapshot policy query selected metrics with bad status. - """ - with self.http_response_mode(self.RESPONSE_MODE.BadStatus): - self.assertRaises( - exceptions.PowerFlexClientException, - self.client.snapshot_policy.query_snapshot_policy_metrics, - self.fake_policy_id) - def test_snapshot_policy_query_selected_statistics_not_supported(self): """ Tests the behavior of the query_selected_statistics method.