]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_cr_tools.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / rgw / rgw_cr_tools.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
3
4 #ifndef CEPH_RGW_CR_TOOLS_H
5 #define CEPH_RGW_CR_TOOLS_H
6
7 #include "rgw_cr_rados.h"
8 #include "rgw_tools.h"
9 #include "rgw_lc.h"
10
11 #include "services/svc_bucket_sync.h"
12
13 struct rgw_user_create_params {
14 rgw_user user;
15 std::string display_name;
16 std::string email;
17 std::string access_key;
18 std::string secret_key;
19 std::string key_type; /* "swift" or "s3" */
20 std::string caps;
21
22 bool generate_key{true};
23 bool suspended{false};
24 std::optional<int32_t> max_buckets;
25 bool system{false};
26 bool exclusive{false};
27 bool apply_quota{true};
28 };
29
30 using RGWUserCreateCR = RGWSimpleWriteOnlyAsyncCR<rgw_user_create_params>;
31
32 struct rgw_get_user_info_params {
33 rgw_user user;
34 };
35
36 using RGWGetUserInfoCR = RGWSimpleAsyncCR<rgw_get_user_info_params, RGWUserInfo>;
37
38 struct rgw_get_bucket_info_params {
39 string tenant;
40 string bucket_name;
41 };
42
43 struct rgw_get_bucket_info_result {
44 ceph::real_time mtime;
45 RGWBucketInfo bucket_info;
46 map<string, bufferlist> attrs;
47 };
48
49 using RGWGetBucketInfoCR = RGWSimpleAsyncCR<rgw_get_bucket_info_params, rgw_get_bucket_info_result>;
50
51 struct rgw_bucket_create_local_params {
52 shared_ptr<RGWUserInfo> user_info;
53 std::string bucket_name;
54 rgw_placement_rule placement_rule;
55 };
56
57 using RGWBucketCreateLocalCR = RGWSimpleWriteOnlyAsyncCR<rgw_bucket_create_local_params>;
58
59 struct rgw_object_simple_put_params {
60 RGWDataAccess::BucketRef bucket;
61 rgw_obj_key key;
62 bufferlist data;
63 map<string, bufferlist> attrs;
64 std::optional<string> user_data;
65 };
66
67 using RGWObjectSimplePutCR = RGWSimpleWriteOnlyAsyncCR<rgw_object_simple_put_params>;
68
69
70 struct rgw_bucket_lifecycle_config_params {
71 RGWBucketInfo bucket_info;
72 map<string, bufferlist> bucket_attrs;
73 RGWLifecycleConfiguration config;
74 };
75
76 using RGWBucketLifecycleConfigCR = RGWSimpleWriteOnlyAsyncCR<rgw_bucket_lifecycle_config_params>;
77
78 struct rgw_bucket_get_sync_policy_params {
79 std::optional<rgw_zone_id> zone;
80 std::optional<rgw_bucket> bucket;
81 };
82
83 struct rgw_bucket_get_sync_policy_result {
84 RGWBucketSyncPolicyHandlerRef policy_handler;
85 };
86
87 using RGWBucketGetSyncPolicyHandlerCR = RGWSimpleAsyncCR<rgw_bucket_get_sync_policy_params, rgw_bucket_get_sync_policy_result>;
88
89 #endif