Skip to content

Commit c31c3bc

Browse files
authored
Remove query metrics from snapshot_policy (#48)
1 parent 2e77e47 commit c31c3bc

2 files changed

Lines changed: 0 additions & 30 deletions

File tree

PyPowerFlex/objects/gen2/snapshot_policy.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,6 @@ def remove_source_volume(self,
107107

108108
return self.get(entity_id=snapshot_policy_id)
109109

110-
def query_snapshot_policy_metrics(self, snapshot_policy_id, metrics=None):
111-
"""Query PowerFlex Metrics for snapshot policy.
112-
TODO TTHE make sure this API is valid after new dev build is ready
113-
114-
:type snapshot_policy_id: str
115-
:type metrics: list|tuple
116-
:rtype: dict
117-
"""
118-
return self.query_metrics('snapshot_policy', [snapshot_policy_id], metrics)
119-
120110
def get_statistics(self, snapshot_policy_id, fields=None):
121111
"""Get PowerFlex Snapshot Policy Statistics not supported in PowerFlex 5.x.
122112

tests/gen2/test_snapshot_policy.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ def setUp(self):
5656
{},
5757
f'/instances/SnapshotPolicy::{self.fake_policy_id}/action/resumeSnapshotPolicy':
5858
{},
59-
'/dtapi/rest/v1/metrics/query': {
60-
self.fake_policy_id: {'numOfpypowerflexVols': 1}
61-
},
6259
},
6360
self.RESPONSE_MODE.Invalid: {
6461
'/types/SnapshotPolicy/instances':
@@ -222,23 +219,6 @@ def test_snapshot_policy_resume_bad_status(self):
222219
self.client.snapshot_policy.resume,
223220
self.fake_policy_id)
224221

225-
def test_snapshot_policy_query_metrics(self):
226-
"""
227-
Test snapshot policy query selected metrics.
228-
"""
229-
ret = self.client.snapshot_policy.query_snapshot_policy_metrics(self.fake_policy_id)
230-
assert ret.get(self.fake_policy_id).get("numOfpypowerflexVols") == 1
231-
232-
def test_snapshot_policy_query_metrics_bad_status(self):
233-
"""
234-
Test snapshot policy query selected metrics with bad status.
235-
"""
236-
with self.http_response_mode(self.RESPONSE_MODE.BadStatus):
237-
self.assertRaises(
238-
exceptions.PowerFlexClientException,
239-
self.client.snapshot_policy.query_snapshot_policy_metrics,
240-
self.fake_policy_id)
241-
242222
def test_snapshot_policy_query_selected_statistics_not_supported(self):
243223
"""
244224
Tests the behavior of the query_selected_statistics method.

0 commit comments

Comments
 (0)