diff options
author | Valerij Fredriksen <valerijf@oath.com> | 2018-02-08 14:22:22 +0100 |
---|---|---|
committer | Valerij Fredriksen <valerijf@oath.com> | 2018-02-08 14:22:22 +0100 |
commit | 179c617d0abfd047bab78d35ded61ca35c550b39 (patch) | |
tree | ef1e34d28ee847127fe196ce716641fd61333527 /node-repository | |
parent | 03748e2a058eb09b7311e3e15a97fea39c94e66e (diff) |
Make wantToDeprovision recursive
Diffstat (limited to 'node-repository')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java index b04990928ba..85322ae1c91 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java @@ -33,6 +33,7 @@ public class NodePatcher { private static final String HARDWARE_FAILURE_DESCRIPTION = "hardwareFailureDescription"; private static final String WANT_TO_RETIRE = "wantToRetire"; + private static final String WANT_TO_DEPROVISION = "wantToDeprovision"; private final NodeFlavors nodeFlavors; private final Inspector inspector; @@ -94,6 +95,12 @@ public class NodePatcher { return childNodes.stream() .map(child -> child.with(child.status().withWantToRetire(asBoolean(value)))) .collect(Collectors.toList()); + + case WANT_TO_DEPROVISION: + return childNodes.stream() + .map(child -> child.with(child.status().withWantToDeprovision(asBoolean(value)))) + .collect(Collectors.toList()); + default : throw new IllegalArgumentException("Field " + name + " is not recursive"); } @@ -132,7 +139,7 @@ public class NodePatcher { return node.withAdditionalIpAddresses(asStringSet(value)); case WANT_TO_RETIRE : return node.with(node.status().withWantToRetire(asBoolean(value))); - case "wantToDeprovision" : + case WANT_TO_DEPROVISION : return node.with(node.status().withWantToDeprovision(asBoolean(value))); case "hardwareDivergence" : return node.with(node.status().withHardwareDivergence(removeQuotedNulls(asOptionalString(value)))); |