aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Sadykov <sdkv.tmr@gmail.com>2022-05-06 14:10:14 +0300
committerTimur Sadykov <sdkv.tmr@gmail.com>2022-05-06 14:10:14 +0300
commit134a5db03cc7664e4230517aad5222be162aa758 (patch)
treedc0f35cc9b7c4da024b85e9a8b0db793ab2a5d87
parentc6c03ee079d245c66db80036c1aefe49668c1fd0 (diff)
downloadydb-134a5db03cc7664e4230517aad5222be162aa758.tar.gz
Added temporary-unreachable action from CMS API v1.4
ref:26325302adb7f82348bf357ac649d07252a48784
-rw-r--r--ydb/core/cms/cms_ut.cpp11
-rw-r--r--ydb/core/cms/walle_create_task_adapter.cpp6
2 files changed, 16 insertions, 1 deletions
diff --git a/ydb/core/cms/cms_ut.cpp b/ydb/core/cms/cms_ut.cpp
index 2709267cf8..67e2b46cfb 100644
--- a/ydb/core/cms/cms_ut.cpp
+++ b/ydb/core/cms/cms_ut.cpp
@@ -693,6 +693,17 @@ Y_UNIT_TEST_SUITE(TCmsTest) {
env.CheckWalleCreateTask("task-9", "reboot", false, TStatus::DISALLOW,
env.GetNodeId(0), env.GetNodeId(1));
env.CheckWalleListTasks(0);
+
+ // Create task for switchs maintenance
+ env.CheckWalleCreateTask("task-10", "temporary-unreachable", false, TStatus::ALLOW,
+ env.GetNodeId(1));
+ // Wait 30 minutes till timeout
+ env.AdvanceCurrentTime(TDuration::Minutes(30));
+ env.CheckWalleCheckTask("task-10", TStatus::ALLOW, env.GetNodeId(1));
+ // Remove Task
+ env.CheckWalleRemoveTask("task-10");
+ // Check tasks list
+ env.CheckWalleListTasks(0);
}
Y_UNIT_TEST(WalleTasksWithNodeLimit)
diff --git a/ydb/core/cms/walle_create_task_adapter.cpp b/ydb/core/cms/walle_create_task_adapter.cpp
index e6363ccdf6..687a1d6eb0 100644
--- a/ydb/core/cms/walle_create_task_adapter.cpp
+++ b/ydb/core/cms/walle_create_task_adapter.cpp
@@ -40,7 +40,8 @@ public:
&& rec.GetAction() != "repair-bmc"
&& rec.GetAction() != "repair-overheat"
&& rec.GetAction() != "repair-capping"
- && rec.GetAction() != "deactivate") {
+ && rec.GetAction() != "deactivate"
+ && rec.GetAction() != "temporary-unreachable") {
ReplyWithErrorAndDie(TStatus::WRONG_REQUEST, "Unsupported action", ctx);
return;
}
@@ -181,6 +182,9 @@ private:
} else if (task.GetAction() == "repair-capping") {
action.SetType(TAction::SHUTDOWN_HOST);
action.SetDuration(TDuration::Max().GetValue());
+ } else if (task.GetAction() == "temporary-unreachable") {
+ action.SetType(TAction::SHUTDOWN_HOST);
+ action.SetDuration(TDuration::Max().GetValue());
} else
Y_FAIL("Unknown action");