'Updates the name and/or availability_zone of given aggregate.'

@extensions.expected_errors((400, 404, 409))
@validation.schema(aggregates.update_v20, '2.0', '2.0')
@validation.schema(aggregates.update, '2.1')
def update(self, req, id, body):

    context = _get_context(req)
    context.can((aggr_policies.POLICY_ROOT % 'update'))
    updates = body['aggregate']
    if ('name' in updates):
        updates['name'] = common.normalize_name(updates['name'])
    try:
        aggregate = self.api.update_aggregate(context, id, updates)
    except exception.AggregateNameExists as e:
        raise exc.HTTPConflict(explanation=e.format_message())
    except exception.AggregateNotFound as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    except exception.InvalidAggregateAction as e:
        raise exc.HTTPBadRequest(explanation=e.format_message())
    return self._marshall_aggregate(req, aggregate)
