def create(self, req, body):
        """Creates an aggregate, given its name and availability_zone."""
        context = _get_context(req)
        authorize(context)

        if len(body) != 1:
            raise exc.HTTPBadRequest()
        try:
            host_aggregate = body["aggregate"]
            name = host_aggregate["name"]
            avail_zone = host_aggregate["availability_zone"]
        except KeyError:
            raise exc.HTTPBadRequest()

        try:
            utils.check_string_length(name, "Aggregate name", 1, 255)
        except exception.InvalidInput as e:
            raise exc.HTTPBadRequest(explanation=e.format_message())

        if len(host_aggregate) != 2:
            raise exc.HTTPBadRequest()

        try:
            aggregate = self.api.create_aggregate(context, name, avail_zone)
        except exception.AggregateNameExists as e:
            LOG.info(e)
            raise exc.HTTPConflict()
        except exception.InvalidAggregateAction as e:
            LOG.info(e)
            raise
        return self._marshall_aggregate(aggregate)