aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/apps/vespa-configproxy-cmd/methods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config/src/apps/vespa-configproxy-cmd/methods.cpp')
-rw-r--r--config/src/apps/vespa-configproxy-cmd/methods.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/config/src/apps/vespa-configproxy-cmd/methods.cpp b/config/src/apps/vespa-configproxy-cmd/methods.cpp
new file mode 100644
index 00000000000..086ec107553
--- /dev/null
+++ b/config/src/apps/vespa-configproxy-cmd/methods.cpp
@@ -0,0 +1,45 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "methods.h"
+#include <iostream>
+
+namespace methods {
+
+const Method methods[] = {
+ { "cache", "listCachedConfig", 0 },
+ { "dumpcache", "dumpCache", 1 }, // filename
+ { "getConfig", "getConfig", 7 }, // defName defVersion defMD5 configid configMD5 timestamp timeout
+ { "getmode", "getMode", 0 },
+ { "invalidatecache", "invalidateCache", 0 },
+ { "cachefull", "listCachedConfigFull", 0 },
+ { "sources", "listSourceConnections", 0 },
+ { "statistics", "printStatistics", 0 },
+ { "setmode", "setMode", 1 }, // { default | memorycache | diskcache }
+ { "updatesources", "updateSources", 1 },
+ { 0, 0, 0}
+};
+
+const Method find(const vespalib::string &name) {
+ for (size_t i = 0; methods[i].shortName != 0; ++i) {
+ if (name == methods[i].shortName) {
+ return methods[i];
+ }
+ }
+ Method rv = { name.c_str(), name.c_str(), 0 };
+ return rv;
+}
+
+void dump() {
+ std::cerr << " ";
+ size_t i = 0;
+ for (;;) {
+ std::cerr << methods[i++].shortName;
+ if (methods[i].shortName == 0) {
+ break;
+ }
+ std::cerr << ",";
+ }
+ std::cerr << std::endl;
+}
+
+};