flusher.flush();
}
+void RGWOp_ZoneConfig_Get::send_response() {
+ const RGWZoneParams& zone_params = store->get_zone_params();
+
+ set_req_state_err(s, http_ret);
+ dump_errno(s);
+ end_header(s);
+
+ if (http_ret < 0)
+ return;
+
+ encode_json("zone_params", zone_params, s->formatter);
+ flusher.flush();
+}
+
RGWOp* RGWHandler_Config::op_get() {
bool exists;
string type = s->info.args.get("type", &exists);
if (type.compare("zonegroup-map") == 0) {
return new RGWOp_ZoneGroupMap_Get(false);
+ } else if (type.compare("zone") == 0) {
+ return new RGWOp_ZoneConfig_Get();
} else {
return new RGWOp_ZoneGroupMap_Get(true);
}
}
};
+class RGWOp_ZoneConfig_Get : public RGWRESTOp {
+ RGWZoneParams zone_params;
+public:
+ RGWOp_ZoneConfig_Get() {}
+
+ int check_caps(RGWUserCaps& caps) {
+ return caps.check_cap("admin", RGW_CAP_READ);
+ }
+ int verify_permission() {
+ return check_caps(s->user->caps);
+ }
+ void execute() {} /* store already has the info we need, just need to send response */
+ void send_response();
+ const string name() {
+ return "get_zone_config";
+ }
+};
+
class RGWHandler_Config : public RGWHandler_Auth_S3 {
protected:
RGWOp *op_get();