'Returns the list of volume attachments for a given instance.'

@extensions.expected_errors(404)
def index(self, req, server_id):

    context = req.environ['nova.context']
    context.can((va_policies.POLICY_ROOT % 'index'))
    instance = common.get_instance(self.compute_api, context, server_id)
    bdms = objects.BlockDeviceMappingList.get_by_instance_uuid(context, instance.uuid)
    limited_list = common.limited(bdms, req)
    results = []
    for bdm in limited_list:
        if bdm.volume_id:
            va = _translate_attachment_summary_view(bdm.volume_id, bdm.instance_uuid, bdm.device_name)
            results.append(va)
    return {'volumeAttachments': results}
