1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef RGW_REST_CONFIG_H
16 #define RGW_REST_CONFIG_H
18 class RGWOp_ZoneGroupMap_Get : public RGWRESTOp {
19 RGWZoneGroupMap zonegroup_map;
22 RGWOp_ZoneGroupMap_Get(bool _old_format):old_format(_old_format) {}
23 ~RGWOp_ZoneGroupMap_Get() override {}
25 int verify_permission() override {
28 void execute() override;
29 void send_response() override;
30 const string name() override {
32 return "get_region_map";
34 return "get_zonegroup_map";
39 class RGWOp_ZoneConfig_Get : public RGWRESTOp {
40 RGWZoneParams zone_params;
42 RGWOp_ZoneConfig_Get() {}
44 int check_caps(RGWUserCaps& caps) {
45 return caps.check_cap("admin", RGW_CAP_READ);
47 int verify_permission() {
48 return check_caps(s->user->caps);
50 void execute() {} /* store already has the info we need, just need to send response */
53 return "get_zone_config";
57 class RGWHandler_Config : public RGWHandler_Auth_S3 {
59 RGWOp *op_get() override;
61 int read_permissions(RGWOp*) override {
65 using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
66 ~RGWHandler_Config() override = default;
70 class RGWRESTMgr_Config : public RGWRESTMgr {
72 RGWRESTMgr_Config() = default;
73 ~RGWRESTMgr_Config() override = default;
75 RGWHandler_REST* get_handler(struct req_state*,
76 const rgw::auth::StrategyRegistry& auth_registry,
77 const std::string&) override {
78 return new RGWHandler_Config(auth_registry);
82 #endif /* RGW_REST_CONFIG_H */