blob: db2b33c68e8aac2c1ba8e11e486b2be93ae665f8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.staterestapi.requests;
import com.yahoo.vespa.clustercontroller.utils.staterestapi.errors.InvalidContentException;
import com.yahoo.vespa.clustercontroller.utils.staterestapi.response.UnitState;
import java.util.Map;
public interface SetUnitStateRequest extends UnitRequest {
Map<String, UnitState> getNewState();
enum Condition {
FORCE(1), // Don't check for any condition before setting unit state
SAFE(2); // Only set condition if it is deemed safe (e.g. redundancy is still ok during upgrade)
public final int value;
private Condition(int value) {
this.value = value;
}
public static Condition fromString(String value) throws InvalidContentException {
try {
return Condition.valueOf(value.toUpperCase());
} catch (IllegalArgumentException e) {
throw new InvalidContentException("Invalid value for my enum Condition: " + value);
}
}
}
Condition getCondition();
}
|