1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
4 #ifndef CEPH_RGW_CR_TOOLS_H
5 #define CEPH_RGW_CR_TOOLS_H
7 #include "rgw_cr_rados.h"
11 #include "services/svc_bucket_sync.h"
13 struct rgw_user_create_params
{
15 std::string display_name
;
17 std::string access_key
;
18 std::string secret_key
;
19 std::string key_type
; /* "swift" or "s3" */
22 bool generate_key
{true};
23 bool suspended
{false};
24 std::optional
<int32_t> max_buckets
;
26 bool exclusive
{false};
27 bool apply_quota
{true};
30 using RGWUserCreateCR
= RGWSimpleWriteOnlyAsyncCR
<rgw_user_create_params
>;
32 struct rgw_get_user_info_params
{
36 using RGWGetUserInfoCR
= RGWSimpleAsyncCR
<rgw_get_user_info_params
, RGWUserInfo
>;
38 struct rgw_get_bucket_info_params
{
43 struct rgw_get_bucket_info_result
{
44 ceph::real_time mtime
;
45 RGWBucketInfo bucket_info
;
46 map
<string
, bufferlist
> attrs
;
49 using RGWGetBucketInfoCR
= RGWSimpleAsyncCR
<rgw_get_bucket_info_params
, rgw_get_bucket_info_result
>;
51 struct rgw_bucket_create_local_params
{
52 shared_ptr
<RGWUserInfo
> user_info
;
53 std::string bucket_name
;
54 rgw_placement_rule placement_rule
;
57 using RGWBucketCreateLocalCR
= RGWSimpleWriteOnlyAsyncCR
<rgw_bucket_create_local_params
>;
59 struct rgw_object_simple_put_params
{
60 RGWDataAccess::BucketRef bucket
;
63 map
<string
, bufferlist
> attrs
;
64 std::optional
<string
> user_data
;
67 using RGWObjectSimplePutCR
= RGWSimpleWriteOnlyAsyncCR
<rgw_object_simple_put_params
>;
70 struct rgw_bucket_lifecycle_config_params
{
71 RGWBucketInfo bucket_info
;
72 map
<string
, bufferlist
> bucket_attrs
;
73 RGWLifecycleConfiguration config
;
76 using RGWBucketLifecycleConfigCR
= RGWSimpleWriteOnlyAsyncCR
<rgw_bucket_lifecycle_config_params
>;
78 struct rgw_bucket_get_sync_policy_params
{
79 std::optional
<rgw_zone_id
> zone
;
80 std::optional
<rgw_bucket
> bucket
;
83 struct rgw_bucket_get_sync_policy_result
{
84 RGWBucketSyncPolicyHandlerRef policy_handler
;
87 using RGWBucketGetSyncPolicyHandlerCR
= RGWSimpleAsyncCR
<rgw_bucket_get_sync_policy_params
, rgw_bucket_get_sync_policy_result
>;