]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_rest_opstate.h
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_OPSTATE_H
16 #define RGW_REST_OPSTATE_H
18 class RGWOp_Opstate_List
: public RGWRESTOp
{
21 RGWOp_Opstate_List() : sent_header(false) {}
22 ~RGWOp_Opstate_List() override
{}
24 int check_caps(RGWUserCaps
& caps
) override
{
25 return caps
.check_cap("opstate", RGW_CAP_READ
);
27 int verify_permission() override
{
28 return check_caps(s
->user
->caps
);
30 void execute() override
;
31 void send_response() override
;
32 virtual void send_response(list
<cls_statelog_entry
> entries
);
33 virtual void send_response_end();
34 const string
name() override
{
35 return "opstate_list";
39 class RGWOp_Opstate_Set
: public RGWRESTOp
{
41 RGWOp_Opstate_Set() {}
42 ~RGWOp_Opstate_Set() override
{}
44 int check_caps(RGWUserCaps
& caps
) override
{
45 return caps
.check_cap("opstate", RGW_CAP_WRITE
);
47 void execute() override
;
48 const string
name() override
{
53 class RGWOp_Opstate_Renew
: public RGWRESTOp
{
55 RGWOp_Opstate_Renew() {}
56 ~RGWOp_Opstate_Renew() override
{}
58 int check_caps(RGWUserCaps
& caps
) override
{
59 return caps
.check_cap("opstate", RGW_CAP_WRITE
);
61 void execute() override
;
62 const string
name() override
{
63 return "renew_opstate";
67 class RGWOp_Opstate_Delete
: public RGWRESTOp
{
69 RGWOp_Opstate_Delete() {}
70 ~RGWOp_Opstate_Delete() override
{}
72 int check_caps(RGWUserCaps
& caps
) override
{
73 return caps
.check_cap("opstate", RGW_CAP_WRITE
);
75 void execute() override
;
76 const string
name() override
{
77 return "delete_opstate";
81 class RGWHandler_Opstate
: public RGWHandler_Auth_S3
{
83 RGWOp
*op_get() override
{
84 return new RGWOp_Opstate_List
;
86 RGWOp
*op_delete() override
{
87 return new RGWOp_Opstate_Delete
;
89 RGWOp
*op_post() override
;
91 int read_permissions(RGWOp
*) override
{
95 using RGWHandler_Auth_S3::RGWHandler_Auth_S3
;
96 ~RGWHandler_Opstate() override
= default;
99 class RGWRESTMgr_Opstate
: public RGWRESTMgr
{
101 RGWRESTMgr_Opstate() = default;
102 ~RGWRESTMgr_Opstate() override
= default;
104 RGWHandler_REST
* get_handler(struct req_state
*,
105 const rgw::auth::StrategyRegistry
& auth_registry
,
106 const std::string
&) override
{
107 return new RGWHandler_Opstate(auth_registry
);
111 #endif /*!RGW_REST_OPSTATE_H*/