]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_otp.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / rgw / services / svc_otp.h
1
2 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
3 // vim: ts=8 sw=2 smarttab ft=cpp
4
5 /*
6 * Ceph - scalable distributed file system
7 *
8 * Copyright (C) 2019 Red Hat, Inc.
9 *
10 * This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License version 2.1, as published by the Free Software
13 * Foundation. See file COPYING.
14 *
15 */
16
17
18 #pragma once
19
20 #include "cls/otp/cls_otp_types.h"
21
22 #include "rgw/rgw_service.h"
23
24 #include "svc_otp_types.h"
25 #include "svc_meta_be_otp.h"
26
27 class RGWSI_Zone;
28
29 class RGWSI_OTP : public RGWServiceInstance
30 {
31 RGWSI_OTP_BE_Handler be_handler;
32 std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
33
34 int do_start() override;
35
36 public:
37 struct Svc {
38 RGWSI_OTP *otp{nullptr};
39 RGWSI_Zone *zone{nullptr};
40 RGWSI_Meta *meta{nullptr};
41 RGWSI_MetaBackend *meta_be{nullptr};
42 } svc;
43
44 RGWSI_OTP(CephContext *cct);
45 ~RGWSI_OTP();
46
47 RGWSI_OTP_BE_Handler& get_be_handler() {
48 return be_handler;
49 }
50
51 void init(RGWSI_Zone *_zone_svc,
52 RGWSI_Meta *_meta_svc,
53 RGWSI_MetaBackend *_meta_be_svc);
54
55 int read_all(RGWSI_OTP_BE_Ctx& ctx,
56 const string& key,
57 otp_devices_list_t *devices,
58 real_time *pmtime,
59 RGWObjVersionTracker *objv_tracker,
60 optional_yield y);
61 int read_all(RGWSI_OTP_BE_Ctx& ctx,
62 const rgw_user& uid,
63 otp_devices_list_t *devices,
64 real_time *pmtime,
65 RGWObjVersionTracker *objv_tracker,
66 optional_yield y);
67 int store_all(RGWSI_OTP_BE_Ctx& ctx,
68 const string& key,
69 const otp_devices_list_t& devices,
70 real_time mtime,
71 RGWObjVersionTracker *objv_tracker,
72 optional_yield y);
73 int store_all(RGWSI_OTP_BE_Ctx& ctx,
74 const rgw_user& uid,
75 const otp_devices_list_t& devices,
76 real_time mtime,
77 RGWObjVersionTracker *objv_tracker,
78 optional_yield y);
79 int remove_all(RGWSI_OTP_BE_Ctx& ctx,
80 const string& key,
81 RGWObjVersionTracker *objv_tracker,
82 optional_yield y);
83 int remove_all(RGWSI_OTP_BE_Ctx& ctx,
84 const rgw_user& uid,
85 RGWObjVersionTracker *objv_tracker,
86 optional_yield y);
87 };
88
89