summaryrefslogtreecommitdiffstats
path: root/vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 16:01:49 +0200
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 16:01:49 +0200
commitba4d752e36eb40a82b8ac685404a4ce1de29d248 (patch)
treecf9a0d93743b859101e1de485cc7a65355060057 /vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm
parent664dc8e147928cd05a16954cbfdd6efb34dd144a (diff)
Add --no-wait option to vespa-set-node-state
If option is set, will add a response-wait: no-wait field to request JSON. If not set, controller default is used.
Diffstat (limited to 'vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm')
-rw-r--r--vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm b/vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm
index e49d00491bc..894ab7feca4 100644
--- a/vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm
+++ b/vespaclient/src/perl/lib/Yahoo/Vespa/Bin/SetNodeState.pm
@@ -21,6 +21,7 @@ our $wanted_state;
our $wanted_state_description;
our $nodes_attempted_set;
our $success;
+our $no_wait;
return 1;
@@ -58,6 +59,10 @@ EOS
. "will show up in various admin tools. (Use double quotes to "
. "give a reason with whitespace in it)");
+ setOptionHeader("Options related to operation visibility:");
+ setFlagOption(['n', 'no-wait'], \$no_wait, "Do not wait for node state "
+ . "changes to be visible in the cluster before returning.");
+
Yahoo::Vespa::ContentNodeSelection::registerCommandLineArguments();
Yahoo::Vespa::VespaModel::registerCommandLineArguments();
handleCommandLineArguments($args);
@@ -83,7 +88,7 @@ sub execute { # ()
exitApplication(1);
}
if (!$success) {
- exitApplication(1);
+ exitApplication(1);
}
}
@@ -92,6 +97,6 @@ sub setNodeStateForNode {
my ($cluster, $type, $index) = (
$$info{'cluster'}, $$info{'type'}, $$info{'index'});
$success &&= setNodeUserState($cluster, $type, $index, $wanted_state,
- $wanted_state_description);
+ $wanted_state_description, $no_wait);
++$nodes_attempted_set;
}