Search in sources :

Example 1 with Upgrader

use of com.yahoo.vespa.hosted.controller.maintenance.Upgrader in project vespa by vespa-engine.

the class ControllerApiHandler method configureUpgrader.

private HttpResponse configureUpgrader(HttpRequest request) {
    String upgradesPerMinuteField = "upgradesPerMinute";
    String confidenceOverrideField = "confidenceOverride";
    byte[] jsonBytes = toJsonBytes(request.getData());
    Inspector inspect = SlimeUtils.jsonToSlime(jsonBytes).get();
    Upgrader upgrader = maintenance.upgrader();
    if (inspect.field(upgradesPerMinuteField).valid()) {
        upgrader.setUpgradesPerMinute(inspect.field(upgradesPerMinuteField).asDouble());
    } else {
        return ErrorResponse.badRequest("No such modifiable field(s)");
    }
    return new UpgraderResponse(maintenance.upgrader());
}
Also used : Upgrader(com.yahoo.vespa.hosted.controller.maintenance.Upgrader) Inspector(com.yahoo.slime.Inspector)

Aggregations

Inspector (com.yahoo.slime.Inspector)1 Upgrader (com.yahoo.vespa.hosted.controller.maintenance.Upgrader)1