/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
cloud/filestore/apps/client/lib/remove_cluster_node.cpp
54 строки
1 KB
Andrei Strelkovskii
fixing 'ythrow TServiceError' pattern which breaks exception messages - introduced STORAGE_THROW_SERVICE_ERROR macro which builds much better messages (#4888)
21 дек 2025, 16:41
Не верифицирован
21 дек 2025, 16:41
8caf308
Код
Авторство
О чём код?
#include "command.h" namespace NCloud::NFileStore::NClient { namespace { //////////////////////////////////////////////////////////////////////////////// class TRemoveClusterNodeCommand final : public TFileStoreCommand { private: TString NodeId; public: TRemoveClusterNodeCommand() { Opts.AddLongOption("node") .Required() .RequiredArgument("STR") .StoreResult(&NodeId); } bool Execute() override { auto callContext = PrepareCallContext(); auto request = std::make_shared<NProto::TRemoveClusterNodeRequest>(); request->SetFileSystemId(FileSystemId); request->SetNodeId(NodeId); auto response = WaitFor( Client->RemoveClusterNode( std::move(callContext), std::move(request))); if (HasError(response)) { STORAGE_THROW_SERVICE_ERROR(response.GetError()); } return true; } }; } // namespace //////////////////////////////////////////////////////////////////////////////// TCommandPtr NewRemoveClusterNodeCommand() { return std::make_shared<TRemoveClusterNodeCommand>(); } } // namespace NCloud::NFileStore::NClient