'Detailed view of a single volume.'

def detail(self, request, volume):

    volume_ref = {'volume': {'id': volume.get('id'), 'status': self._get_volume_status(volume), 'size': volume.get('size'), 'availability_zone': volume.get('availability_zone'), 'created_at': volume.get('created_at'), 'updated_at': volume.get('updated_at'), 'attachments': self._get_attachments(volume), 'name': volume.get('display_name'), 'description': volume.get('display_description'), 'volume_type': self._get_volume_type(volume), 'snapshot_id': volume.get('snapshot_id'), 'source_volid': volume.get('source_volid'), 'metadata': self._get_volume_metadata(volume), 'links': self._get_links(request, volume['id']), 'user_id': volume.get('user_id'), 'bootable': six.text_type(volume.get('bootable')).lower(), 'encrypted': self._is_volume_encrypted(volume), 'replication_status': volume.get('replication_status'), 'consistencygroup_id': volume.get('consistencygroup_id'), 'multiattach': volume.get('multiattach')}}
    if request.environ['cinder.context'].is_admin:
        volume_ref['volume']['migration_status'] = volume.get('migration_status')
    group_id = volume.get('group_id')
    if (group_id is not None):
        ctxt = request.environ['cinder.context']
        grp = group_api.API().get(ctxt, group_id)
        cgsnap_type = group_types.get_default_cgsnapshot_type()
        if (grp.group_type_id == cgsnap_type['id']):
            volume_ref['volume']['consistencygroup_id'] = group_id
    return volume_ref
