summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-18 12:52:14 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-18 12:52:14 -0500
commitf2a9772e8df59dfc274e84eece8e6dbf33dfdc97 (patch)
treec6a0086c606f3bde24133c8ac70658a19c2fa7b4
parenta68772146462ed5ef7e86c09b05e4c31a1930be5 (diff)
downloadmongo-f2a9772e8df59dfc274e84eece8e6dbf33dfdc97.tar.gz
SERVER-38485 Convert free_mon_options.cpp config options to IDL
-rw-r--r--src/mongo/db/free_mon/SConscript1
-rw-r--r--src/mongo/db/free_mon/free_mon_options.cpp30
-rw-r--r--src/mongo/db/free_mon/free_mon_options.idl51
3 files changed, 52 insertions, 30 deletions
diff --git a/src/mongo/db/free_mon/SConscript b/src/mongo/db/free_mon/SConscript
index 90ebd17ee78..5db73b8e36f 100644
--- a/src/mongo/db/free_mon/SConscript
+++ b/src/mongo/db/free_mon/SConscript
@@ -37,6 +37,7 @@ if free_monitoring == "on":
'free_mon_mongod.cpp',
env.Idlc('free_mon_mongod.idl')[0],
'free_mon_options.cpp',
+ env.Idlc('free_mon_options.idl')[0],
'free_mon_status.cpp',
],
LIBDEPS=[
diff --git a/src/mongo/db/free_mon/free_mon_options.cpp b/src/mongo/db/free_mon/free_mon_options.cpp
index ab461aded78..3435a76ae9d 100644
--- a/src/mongo/db/free_mon/free_mon_options.cpp
+++ b/src/mongo/db/free_mon/free_mon_options.cpp
@@ -75,32 +75,6 @@ StatusWith<EnableCloudStateEnum> EnableCloudState_parse(StringData value) {
return Status(ErrorCodes::InvalidOptions, "Unrecognized state");
}
-Status addFreeMonitoringOptions(moe::OptionSection* options) {
- moe::OptionSection freeMonitoringOptions("Free Monitoring options");
-
- // Command Line: --enableFreeMonitoring=<on|runtime|off>
- // YAML Name: cloud.monitoring.free=<on|runtime|off>
- freeMonitoringOptions.addOptionChaining("cloud.monitoring.free.state",
- "enableFreeMonitoring",
- moe::String,
- "Enable Cloud Free Monitoring (on|runtime|off)");
-
- // Command Line: --enableFreeMonitoringTag=array<string>
- // YAML Name: cloud.monitoring.free.tag=array<string>
- freeMonitoringOptions.addOptionChaining("cloud.monitoring.free.tags",
- "freeMonitoringTag",
- moe::StringVector,
- "Cloud Free Monitoring Tags");
-
- Status ret = options->addSection(freeMonitoringOptions);
- if (!ret.isOK()) {
- error() << "Failed to add free monitoring option section: " << ret.toString();
- return ret;
- }
-
- return Status::OK();
-}
-
Status storeFreeMonitoringOptions(const moe::Environment& params) {
if (params.count("cloud.monitoring.free.state")) {
@@ -120,10 +94,6 @@ Status storeFreeMonitoringOptions(const moe::Environment& params) {
return Status::OK();
}
-MONGO_MODULE_STARTUP_OPTIONS_REGISTER(FreeMonitoringOptions)(InitializerContext* /*unused*/) {
- return addFreeMonitoringOptions(&moe::startupOptions);
-}
-
MONGO_STARTUP_OPTIONS_STORE(FreeMonitoringOptions)(InitializerContext* /*unused*/) {
return storeFreeMonitoringOptions(moe::startupOptionsParsed);
}
diff --git a/src/mongo/db/free_mon/free_mon_options.idl b/src/mongo/db/free_mon/free_mon_options.idl
new file mode 100644
index 00000000000..ba7f472b467
--- /dev/null
+++ b/src/mongo/db/free_mon/free_mon_options.idl
@@ -0,0 +1,51 @@
+# Copyright (C) 2018-present MongoDB, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Server Side Public License, version 1,
+# as published by MongoDB, Inc.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# Server Side Public License for more details.
+#
+# You should have received a copy of the Server Side Public License
+# along with this program. If not, see
+# <http://www.mongodb.com/licensing/server-side-public-license>.
+#
+# As a special exception, the copyright holders give permission to link the
+# code of portions of this program with the OpenSSL library under certain
+# conditions as described in each individual source file and distribute
+# linked combinations including the program with the OpenSSL library. You
+# must comply with the Server Side Public License in all respects for
+# all of the code used other than as permitted herein. If you modify file(s)
+# with this exception, you may extend this exception to your version of the
+# file(s), but you are not obligated to do so. If you do not wish to do so,
+# delete this exception statement from your version. If you delete this
+# exception statement from all source files in the program, then also delete
+# it in the license file.
+#
+
+global:
+ cpp_namespace: "mongo"
+ configs:
+ section: "Free Monitoring Options"
+ source: [ yaml, cli]
+
+imports:
+ - "mongo/idl/basic_types.idl"
+
+configs:
+ # Command Line: --enableFreeMonitoring=<on|runtime|off>
+ # YAML Name: cloud.monitoring.free=<on|runtime|off>
+ cloud.monitoring.free.state:
+ description: "Enable Cloud Free Monitoring (on|runtime|off)"
+ short_name: enableFreeMonitoring
+ arg_vartype: String
+
+ # Command Line: --enableFreeMonitoringTag=array<string>
+ # YAML Name: cloud.monitoring.free.tag=array<string>
+ cloud.monitoring.free.tags:
+ description: "Cloud Free Monitoring Tags"
+ short_name: freeMonitoringTag
+ arg_vartype: StringVector