def detail_list(self, request, consistencygroups):
"""Detailed view of a list of consistency groups ."""
return self._list_view(self.detail, request, consistencygroups)
def detail(self, request, consistencygroup):
"""Detailed view of a single consistency group."""
if consistencygroup.volume_type_id: volume_types = consistencygroup.volume_type_id.split(",") volume_types = [type_id for type_id in volume_types if type_id]
else: volume_types = []
Right, cinder code specify that cinder consisgroup-show displays volume_type in output
if is_detail:
consistenc ygroups = self._view_ builder. detail_ list(
req, consistencygroups)
consistenc ygroups = self._view_ builder. summary_ list(
req, consistencygroups)
else:
view_buider->
def detail_list(self, request, consistencygroups): view(self. detail, request, consistencygroups)
"""Detailed view of a list of consistency groups ."""
return self._list_
def detail(self, request, consistencygroup): p.volume_ type_id:
volume_ types = consistencygrou p.volume_ type_id. split(" ,")
volume_ types = [type_id for type_id in volume_types if type_id]
volume_ types = []
"""Detailed view of a single consistency group."""
if consistencygrou
else:
return {
'consisten cygroup' : {
'id': consistencygrou p.id,
'status' : consistencygrou p.status,
'availability _zone': consistencygrou p.availability_ zone,
'created_ at': consistencygrou p.created_ at,
'name' : consistencygrou p.name,
'description' : consistencygrou p.description,
'volume_ types': volume_types,
}
}
But "cinder cgsnapshot-show" does not show snapshot-volumes and snapshot- volume- types:
def detail(self, request, cgsnapshot):
'cgsnapsho t': {
'id': cgsnapshot.id,
'consistencyg roup_id' : cgsnapshot. consistencygrou p_id,
'status' : cgsnapshot.status,
'created_ at': cgsnapshot. created_ at,
'name' : cgsnapshot.name,
'description' : cgsnapshot. description
"""Detailed view of a single cgsnapshot."""
return {
}
}