Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from bcdonadio/feat/relationship
Browse files Browse the repository at this point in the history
Add transfer relationship status support
  • Loading branch information
djtaylor authored May 21, 2019
2 parents bdf80fe + e7860ff commit 5f9d4ce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netapp_ocum/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def get_volume_metrics(self, params={}):
"""
return NetApp_OCUM_Collection(self.request, 'volumes/capacity-utilization', self._set_params(params))

def get_volume_relationships(self, params={}):
"""
Return a list of mirror relationships of volumes from the OCUM.
"""
return NetApp_OCUM_Collection(self.request, 'volumes/relationships-transfer-status', self._set_params(params))

def get_ports(self, params={}):
"""
Return a list of ports from the OCUM.
Expand Down
3 changes: 3 additions & 0 deletions netapp_ocum/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from netapp_ocum.objects.event import NetApp_OCUM_Event
from netapp_ocum.objects.namespace import NetApp_OCUM_Namespace
from netapp_ocum.objects.lun import NetApp_OCUM_LUN
from netapp_ocum.objects.relationship import NetApp_OCUM_Relationship

class NetApp_OCUM_Collection(object):
"""
Expand Down Expand Up @@ -50,6 +51,7 @@ def _get_object_class(self):
'aggregates/capacity-utilization': NetApp_OCUM_AggregateMetrics,
'volumes': NetApp_OCUM_Volume,
'volumes/capacity-utilization': NetApp_OCUM_VolumeMetrics,
'volumes/relationships-transfer-status': NetApp_OCUM_Relationship,
'svms': NetApp_OCUM_SVM,
'ports': NetApp_OCUM_Port,
'lifs': NetApp_OCUM_LIF,
Expand All @@ -70,6 +72,7 @@ def _get_object_key(self):
'aggregates/capacity-utilization': 'netapp:aggregateCapacityAndUtilizationList',
'volumes': 'netapp:volumeInventoryList',
'volumes/capacity-utilization': 'netapp:volumeCapacityAndUtilizationList',
'volumes/relationships-transfer-status': 'netapp:volumeTransferStatusList',
'svms': 'netapp:svmInventoryList',
'ports': 'netapp:portInventoryList',
'lifs': 'netapp:lifInventoryList',
Expand Down
8 changes: 8 additions & 0 deletions netapp_ocum/objects/relationship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from netapp_ocum.objects.base import NetApp_OCUM_ObjectBase

class NetApp_OCUM_Relationship(NetApp_OCUM_ObjectBase):
"""
Class representing a single NetApp Volume Protection Relationship.
"""
def __init__(self, *args):
super().__init__(*args)

0 comments on commit 5f9d4ce

Please sign in to comment.