w41ter commented on code in PR #61502:
URL: https://github.com/apache/doris/pull/61502#discussion_r3061885402


##########
cloud/src/common/http_helper.cpp:
##########
@@ -0,0 +1,1135 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http_helper.h"
+
+#include <brpc/controller.h>
+#include <brpc/http_status_code.h>
+#include <brpc/uri.h>
+#include <fmt/core.h>
+#include <fmt/format.h>
+#include <gen_cpp/cloud.pb.h>
+#include <glog/logging.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/service.h>
+#include <google/protobuf/util/json_util.h>
+#include <rapidjson/document.h>
+#include <rapidjson/error/en.h>
+#include <rapidjson/prettywriter.h>
+#include <rapidjson/stringbuffer.h>
+
+#include <algorithm>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+
+#include "common/metric.h"
+#include "cpp/s3_rate_limiter.h"
+#include "meta-service/meta_service.h"
+#include "meta-service/meta_service_helper.h"
+#include "meta-service/meta_service_http.h"
+#include "recycler/recycler.h"
+#include "recycler/recycler_service.h"
+namespace doris::cloud {
+
+template <typename Message>
+static google::protobuf::util::Status parse_json_message(const std::string& 
unresolved_path,
+                                                         const std::string& 
body, Message* req) {
+    static_assert(std::is_base_of_v<google::protobuf::Message, Message>);
+    auto st = google::protobuf::util::JsonStringToMessage(body, req);
+    if (!st.ok()) {
+        std::string msg = "failed to strictly parse http request for '" + 
unresolved_path +
+                          "' error: " + st.ToString();
+        LOG_WARNING(msg).tag("body", encryt_sk(hide_access_key(body)));
+
+        // ignore unknown fields
+        google::protobuf::util::JsonParseOptions json_parse_options;
+        json_parse_options.ignore_unknown_fields = true;
+        return google::protobuf::util::JsonStringToMessage(body, req, 
json_parse_options);
+    }
+    return {};
+}
+
+#define PARSE_MESSAGE_OR_RETURN(ctrl, req)                                     
                 \
+    do {                                                                       
                 \
+        std::string body = ctrl->request_attachment().to_string();             
                 \
+        auto& unresolved_path = ctrl->http_request().unresolved_path();        
                 \
+        auto st = parse_json_message(unresolved_path, body, &req);             
                 \
+        if (!st.ok()) {                                                        
                 \
+            std::string msg = "parse http request '" + unresolved_path + "': " 
+ st.ToString(); \
+            LOG_WARNING(msg).tag("body", encryt_sk(hide_access_key(body)));    
                 \
+            return http_json_reply(MetaServiceCode::PROTOBUF_PARSE_ERR, msg);  
                 \
+        }                                                                      
                 \
+    } while (0)
+
+const std::unordered_map<std::string_view, HttpHandlerInfo>& 
get_http_handlers() {
+    using MS = MetaServiceImpl;
+    using RS = RecyclerServiceImpl;
+
+    static std::unordered_map<std::string_view, HttpHandlerInfo> handlers {
+            // MetaService APIs
+            {"add_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"rename_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"update_cluster_endpoint",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"update_cluster_mysql_user_name",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"decommission_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_cluster_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"notify_decommissioned",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_vcluster_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"create_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_create_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"rename_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"enable_instance_sse",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"disable_instance_sse",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_instance_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"add_obj_info",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"legacy_update_ak_sk",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"update_ak_sk",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_update_ak_sk((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"show_storage_vaults",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_obj_store_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_hdfs_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_hdfs_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_obj_info",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+
+            {"decode_key",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_decode_key((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"encode_key",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_encode_key((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_value",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_get_value((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_value",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_set_value((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"show_meta_ranges",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_show_meta_ranges((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"txn_lazy_commit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_txn_lazy_commit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"injection_point",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_injection_point((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"fix_tablet_stats",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_fix_tablet_stats((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"fix_tablet_db_id",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_fix_tablet_db_id((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"get_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_instance_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_obj_store_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_obj_store_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_tablet_stats",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_tablet_stats((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_stage",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_get_stage((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_cluster_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_cluster_status((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"list_snapshot",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_list_snapshot((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_snapshot_property",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_set_snapshot_property((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"get_snapshot_property",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_get_snapshot_property((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"set_multi_version_status",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_set_multi_version_status((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"compact_snapshot",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_compact_snapshot((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"decouple_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_decouple_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"abort_txn",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_abort_txn((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"abort_tablet_job",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_abort_tablet_job((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_ram_user",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_ram_user((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_iam",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_alter_iam((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"adjust_rate_limit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_adjust_rate_limit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"list_rate_limit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_query_rate_limit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            // Recycler APIs
+            {"recycle_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_instance((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"statistics_recycle",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_statistics_recycle((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"recycle_copy_jobs",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_copy_jobs((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"recycle_job_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_job_info((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_check_instance((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_job_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_check_job_info((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_meta",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_check_meta((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"adjust_rate_limiter",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_adjust_rate_limiter((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+
+            // Shared APIs
+            {"show_config",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_show_config((MS*)s, c); },
+              .role = HttpRole::BOTH}},
+            {"update_config",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_update_config((MS*)s, c); },
+              .role = HttpRole::BOTH}},
+    };

Review Comment:
   It seems the version prefix hasn't been supported here yet? Maybe we'll have 
v1/v2/v3 in the future.
   Additionally, it appears the drop_snapshot API hasn't been migrated? This 
might be due to a merge order conflict in the code.



##########
cloud/src/common/http_helper.cpp:
##########
@@ -0,0 +1,1135 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http_helper.h"
+
+#include <brpc/controller.h>
+#include <brpc/http_status_code.h>
+#include <brpc/uri.h>
+#include <fmt/core.h>
+#include <fmt/format.h>
+#include <gen_cpp/cloud.pb.h>
+#include <glog/logging.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/service.h>
+#include <google/protobuf/util/json_util.h>
+#include <rapidjson/document.h>
+#include <rapidjson/error/en.h>
+#include <rapidjson/prettywriter.h>
+#include <rapidjson/stringbuffer.h>
+
+#include <algorithm>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+
+#include "common/metric.h"
+#include "cpp/s3_rate_limiter.h"
+#include "meta-service/meta_service.h"
+#include "meta-service/meta_service_helper.h"
+#include "meta-service/meta_service_http.h"
+#include "recycler/recycler.h"
+#include "recycler/recycler_service.h"
+namespace doris::cloud {
+
+template <typename Message>
+static google::protobuf::util::Status parse_json_message(const std::string& 
unresolved_path,
+                                                         const std::string& 
body, Message* req) {
+    static_assert(std::is_base_of_v<google::protobuf::Message, Message>);
+    auto st = google::protobuf::util::JsonStringToMessage(body, req);
+    if (!st.ok()) {
+        std::string msg = "failed to strictly parse http request for '" + 
unresolved_path +
+                          "' error: " + st.ToString();
+        LOG_WARNING(msg).tag("body", encryt_sk(hide_access_key(body)));
+
+        // ignore unknown fields
+        google::protobuf::util::JsonParseOptions json_parse_options;
+        json_parse_options.ignore_unknown_fields = true;
+        return google::protobuf::util::JsonStringToMessage(body, req, 
json_parse_options);
+    }
+    return {};
+}
+
+#define PARSE_MESSAGE_OR_RETURN(ctrl, req)                                     
                 \
+    do {                                                                       
                 \
+        std::string body = ctrl->request_attachment().to_string();             
                 \
+        auto& unresolved_path = ctrl->http_request().unresolved_path();        
                 \
+        auto st = parse_json_message(unresolved_path, body, &req);             
                 \
+        if (!st.ok()) {                                                        
                 \
+            std::string msg = "parse http request '" + unresolved_path + "': " 
+ st.ToString(); \
+            LOG_WARNING(msg).tag("body", encryt_sk(hide_access_key(body)));    
                 \
+            return http_json_reply(MetaServiceCode::PROTOBUF_PARSE_ERR, msg);  
                 \
+        }                                                                      
                 \
+    } while (0)
+
+const std::unordered_map<std::string_view, HttpHandlerInfo>& 
get_http_handlers() {
+    using MS = MetaServiceImpl;
+    using RS = RecyclerServiceImpl;
+
+    static std::unordered_map<std::string_view, HttpHandlerInfo> handlers {
+            // MetaService APIs
+            {"add_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"rename_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"update_cluster_endpoint",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"update_cluster_mysql_user_name",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"decommission_node",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_cluster_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"notify_decommissioned",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_vcluster_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"create_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_create_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"rename_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"enable_instance_sse",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"disable_instance_sse",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_instance_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"add_obj_info",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"legacy_update_ak_sk",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"update_ak_sk",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_update_ak_sk((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"show_storage_vaults",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_obj_store_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_hdfs_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"add_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_s3_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"drop_hdfs_vault",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_storage_vault((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_obj_info",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_alter_obj_store_info((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+
+            {"decode_key",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_decode_key((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"encode_key",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_encode_key((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_value",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_get_value((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_value",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_set_value((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"show_meta_ranges",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_show_meta_ranges((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"txn_lazy_commit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_txn_lazy_commit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"injection_point",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_injection_point((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"fix_tablet_stats",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_fix_tablet_stats((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"fix_tablet_db_id",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_fix_tablet_db_id((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"get_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_instance_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_obj_store_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_obj_store_info((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_cluster",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_cluster((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_tablet_stats",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_tablet_stats((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_stage",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_get_stage((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"get_cluster_status",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_get_cluster_status((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            {"list_snapshot",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_list_snapshot((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"set_snapshot_property",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_set_snapshot_property((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"get_snapshot_property",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_get_snapshot_property((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"set_multi_version_status",
+             {.handler =
+                      [](void* s, brpc::Controller* c) {
+                          return process_set_multi_version_status((MS*)s, c);
+                      },
+              .role = HttpRole::META_SERVICE}},
+            {"compact_snapshot",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_compact_snapshot((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"decouple_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_decouple_instance((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"abort_txn",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_abort_txn((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"abort_tablet_job",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_abort_tablet_job((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_ram_user",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_alter_ram_user((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"alter_iam",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_alter_iam((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"adjust_rate_limit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_adjust_rate_limit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+            {"list_rate_limit",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_query_rate_limit((MS*)s, c); },
+              .role = HttpRole::META_SERVICE}},
+
+            // Recycler APIs
+            {"recycle_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_instance((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"statistics_recycle",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_statistics_recycle((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"recycle_copy_jobs",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_copy_jobs((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"recycle_job_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_recycle_job_info((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_instance",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_check_instance((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_job_info",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_check_job_info((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"check_meta",
+             {.handler = [](void* s, brpc::Controller* c) { return 
process_check_meta((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+            {"adjust_rate_limiter",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_adjust_rate_limiter((RS*)s, c); },
+              .role = HttpRole::RECYCLER}},
+
+            // Shared APIs
+            {"show_config",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_show_config((MS*)s, c); },
+              .role = HttpRole::BOTH}},
+            {"update_config",
+             {.handler = [](void* s,
+                            brpc::Controller* c) { return 
process_update_config((MS*)s, c); },
+              .role = HttpRole::BOTH}},
+    };

Review Comment:
   The list_snapshot is updated too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to