@@ -1270,6 +1270,27 @@ def volume_groups(self):
12701270 return [VolumeGroup (x ) for x in self ._rest_data ]
12711271
12721272
1273+ class ReplicationState (RESTMessageResponse ):
1274+ def __init__ (self , data ):
1275+ super (ReplicationState , self ).__init__ (data )
1276+
1277+ @property
1278+ def replication_state (self ):
1279+ """
1280+ :return: String describing the drbd replication state
1281+ :rtype: str
1282+ """
1283+ return self ._rest_data .get ("replication_state" , "" )
1284+
1285+ @property
1286+ def done_percentage (self ):
1287+ """
1288+ :return: decimal percentage of current verify/sync operation on drbd
1289+ :rtype: Optional[float]
1290+ """
1291+ return self ._rest_data .get ("done_percentage" )
1292+
1293+
12731294class VolumeState (RESTMessageResponse ):
12741295 def __init__ (self , data ):
12751296 super (VolumeState , self ).__init__ (data )
@@ -1292,20 +1313,12 @@ def disk_state(self):
12921313 return self ._rest_data .get ("disk_state" )
12931314
12941315 @property
1295- def replication_state (self ):
1316+ def replication_states (self ):
12961317 """
1297- :return: String describing the drbd replication state
1298- :rtype: str
1318+ :return: dict with peers and their replication states
1319+ :rtype: dict[ str, ReplicationState]
12991320 """
1300- return self ._rest_data .get ("replication_state" , "" )
1301-
1302- @property
1303- def done_percentage (self ):
1304- """
1305- :return: decimal percentage of current verify/sync operation on drbd
1306- :rtype: Optional[float]
1307- """
1308- return self ._rest_data .get ("done_percentage" )
1321+ return {k : ReplicationState (v ) for k , v in self ._rest_data .get ("replication_states" , {}).items ()}
13091322
13101323 @property
13111324 def data_v0 (self ):
0 commit comments