1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
5 * Ceph - scalable distributed file system
7 * Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
16 #ifndef RGW_REST_CONFIG_H
17 #define RGW_REST_CONFIG_H
21 class RGWOp_ZoneGroupMap_Get
: public RGWRESTOp
{
22 RGWZoneGroupMap zonegroup_map
;
25 explicit RGWOp_ZoneGroupMap_Get(bool _old_format
):old_format(_old_format
) {}
26 ~RGWOp_ZoneGroupMap_Get() override
{}
28 int check_caps(RGWUserCaps
& caps
) override
{
29 return caps
.check_cap("zone", RGW_CAP_READ
);
31 int verify_permission() override
{
32 return check_caps(s
->user
->caps
);
34 void execute() override
;
35 void send_response() override
;
36 const char* name() const override
{
38 return "get_region_map";
40 return "get_zonegroup_map";
45 class RGWOp_ZoneConfig_Get
: public RGWRESTOp
{
46 RGWZoneParams zone_params
;
48 RGWOp_ZoneConfig_Get() {}
50 int check_caps(RGWUserCaps
& caps
) override
{
51 return caps
.check_cap("zone", RGW_CAP_READ
);
53 int verify_permission() override
{
54 return check_caps(s
->user
->caps
);
56 void execute() override
{} /* store already has the info we need, just need to send response */
57 void send_response() override
;
58 const char* name() const override
{
59 return "get_zone_config";
63 class RGWHandler_Config
: public RGWHandler_Auth_S3
{
65 RGWOp
*op_get() override
;
67 int read_permissions(RGWOp
*) override
{
71 using RGWHandler_Auth_S3::RGWHandler_Auth_S3
;
72 ~RGWHandler_Config() override
= default;
76 class RGWRESTMgr_Config
: public RGWRESTMgr
{
78 RGWRESTMgr_Config() = default;
79 ~RGWRESTMgr_Config() override
= default;
81 RGWHandler_REST
* get_handler(struct req_state
*,
82 const rgw::auth::StrategyRegistry
& auth_registry
,
83 const std::string
&) override
{
84 return new RGWHandler_Config(auth_registry
);
88 #endif /* RGW_REST_CONFIG_H */