summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_rest_config.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2017-01-05 22:47:24 +0100
committerYehuda Sadeh <yehuda@redhat.com>2017-01-13 23:33:33 +0100
commita220a2efbfd675e6abf14ae33c21005bcbf6dadf (patch)
treeb922f6d1e38ab59de1ea842db6009a80ddca7c1d /src/rgw/rgw_rest_config.cc
parentMerge pull request #12924 from dillaman/wip-librbd-test-header (diff)
downloadceph-a220a2efbfd675e6abf14ae33c21005bcbf6dadf.tar.xz
ceph-a220a2efbfd675e6abf14ae33c21005bcbf6dadf.zip
rgw: rest api to read zone config params
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/rgw/rgw_rest_config.cc')
-rw-r--r--src/rgw/rgw_rest_config.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rgw/rgw_rest_config.cc b/src/rgw/rgw_rest_config.cc
index 645d4b855fe..3770cec15de 100644
--- a/src/rgw/rgw_rest_config.cc
+++ b/src/rgw/rgw_rest_config.cc
@@ -53,12 +53,28 @@ void RGWOp_ZoneGroupMap_Get::send_response() {
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);
}