class ApplicationResource {

    @PUT
    @Consumes(MediaType.APPLICATION_JSON)
    @Timed
    @UserRequired
    @UnitOfWork
    @Path("{tenant}/{name}/scale")
    @ApiOperation(value = "Scales application on marathon")
    public Response scale(@PathParam("tenant") final String tenant, @PathParam("name") final String computationName,
                          @NotNull final Map<String, Integer> request) {
        final Integer instances = request.get("instances");
        Preconditions.checkNotNull(instances, "No of instances can't be null");
        Preconditions.checkArgument(instances > 0, "Num of instances should be greater than zero", computationName);
        final String appName = applicationService.name(tenant, computationName);
        applicationService.scale(appName, tenant, instances);
        return Response.noContent().build();
    }

}