aboutsummaryrefslogtreecommitdiff
path: root/src/zennomad/nomadclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zennomad/nomadclient.cpp')
-rw-r--r--src/zennomad/nomadclient.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/zennomad/nomadclient.cpp b/src/zennomad/nomadclient.cpp
index 9edcde125..4bb09a930 100644
--- a/src/zennomad/nomadclient.cpp
+++ b/src/zennomad/nomadclient.cpp
@@ -58,7 +58,11 @@ NomadClient::Initialize()
}
std::string
-NomadClient::BuildJobJson(const std::string& JobId, const std::string& OrchestratorEndpoint) const
+NomadClient::BuildJobJson(const std::string& JobId,
+ const std::string& OrchestratorEndpoint,
+ const std::string& CoordinatorSession,
+ bool CleanStart,
+ const std::string& TraceHost) const
{
ZEN_TRACE_CPU("NomadClient::BuildJobJson");
@@ -94,6 +98,22 @@ NomadClient::BuildJobJson(const std::string& JobId, const std::string& Orchestra
IdArg << "--instance-id=nomad-" << JobId;
Args.push_back(std::string(IdArg.ToView()));
}
+ if (!CoordinatorSession.empty())
+ {
+ ExtendableStringBuilder<128> SessionArg;
+ SessionArg << "--coordinator-session=" << CoordinatorSession;
+ Args.push_back(std::string(SessionArg.ToView()));
+ }
+ if (CleanStart)
+ {
+ Args.push_back("--clean");
+ }
+ if (!TraceHost.empty())
+ {
+ ExtendableStringBuilder<128> TraceArg;
+ TraceArg << "--tracehost=" << TraceHost;
+ Args.push_back(std::string(TraceArg.ToView()));
+ }
TaskConfig["args"] = Args;
}
else
@@ -115,6 +135,22 @@ NomadClient::BuildJobJson(const std::string& JobId, const std::string& Orchestra
IdArg << "--instance-id=nomad-" << JobId;
Args.push_back(std::string(IdArg.ToView()));
}
+ if (!CoordinatorSession.empty())
+ {
+ ExtendableStringBuilder<128> SessionArg;
+ SessionArg << "--coordinator-session=" << CoordinatorSession;
+ Args.push_back(std::string(SessionArg.ToView()));
+ }
+ if (CleanStart)
+ {
+ Args.push_back("--clean");
+ }
+ if (!TraceHost.empty())
+ {
+ ExtendableStringBuilder<128> TraceArg;
+ TraceArg << "--tracehost=" << TraceHost;
+ Args.push_back(std::string(TraceArg.ToView()));
+ }
TaskConfig["args"] = Args;
}