summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/state-api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'configd/src/apps/sentinel/state-api.cpp')
-rw-r--r--configd/src/apps/sentinel/state-api.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/state-api.cpp b/configd/src/apps/sentinel/state-api.cpp
new file mode 100644
index 00000000000..0f1a901ec6b
--- /dev/null
+++ b/configd/src/apps/sentinel/state-api.cpp
@@ -0,0 +1,31 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/fastos/fastos.h>
+#include "state-api.h"
+#include <vespa/vespalib/util/host_name.h>
+#include <vespa/vespalib/util/stringfmt.h>
+
+namespace {
+
+std::map<vespalib::string, vespalib::string> noParams;
+
+} // namespace <unnamed>
+
+
+namespace config {
+namespace sentinel {
+
+vespalib::string
+StateApi::get(const char *path) const
+{
+ return myStateApi.get(host_and_port, path, noParams);
+}
+
+void
+StateApi::bound(int port)
+{
+ host_and_port = vespalib::make_string("%s:%d", vespalib::HostName::get().c_str(), port);
+}
+
+} // namespace config::sentinel
+} // namespace config