Skip to content

Commit 326eef3

Browse files
committed
rgw/logging: fix/remove/add bucket logging op names
Fixes: https://tracker.ceph.com/issues/71638 Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent 72482a7 commit 326eef3

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/rgw/rgw_op.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,12 @@ class RGWGetObj : public RGWOp {
481481
virtual int send_response_data(bufferlist& bl, off_t ofs, off_t len) = 0;
482482

483483
const char* name() const override { return "get_obj"; }
484-
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT", s->info.method); }
484+
std::string canonical_name() const override {
485+
if (get_torrent) {
486+
return fmt::format("REST.{}.TORRENT", s->info.method);
487+
}
488+
return fmt::format("REST.{}.OBJECT", s->info.method);
489+
}
485490
RGWOpType get_type() override { return RGW_OP_GET_OBJ; }
486491
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
487492
virtual bool need_object_expiration() { return false; }
@@ -942,7 +947,6 @@ class RGWGetUsage : public RGWOp {
942947
virtual bool should_get_stats() { return false; }
943948

944949
const char* name() const override { return "get_self_usage"; }
945-
std::string canonical_name() const override { return fmt::format("REST.{}.USER_USAGE", s->info.method); }
946950
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
947951
};
948952

@@ -959,7 +963,6 @@ class RGWStatAccount : public RGWOp {
959963

960964
void send_response() override = 0;
961965
const char* name() const override { return "stat_account"; }
962-
std::string canonical_name() const override { return fmt::format("REST.{}.ACCOUNT_STATUS", s->info.method); }
963966
RGWOpType get_type() override { return RGW_OP_STAT_ACCOUNT; }
964967
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
965968
};
@@ -1013,6 +1016,7 @@ class RGWGetBucketLocation : public RGWOp {
10131016

10141017
void send_response() override = 0;
10151018
const char* name() const override { return "get_bucket_location"; }
1019+
std::string canonical_name() const override { return fmt::format("REST.{}.LOCATION", s->info.method); }
10161020
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOCATION; }
10171021
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
10181022
};
@@ -1128,7 +1132,6 @@ class RGWStatBucket : public RGWOp {
11281132
virtual int get_params(optional_yield y) = 0;
11291133
void send_response() override = 0;
11301134
const char* name() const override { return "stat_bucket"; }
1131-
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_STATUS", s->info.method); }
11321135
RGWOpType get_type() override { return RGW_OP_STAT_BUCKET; }
11331136
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
11341137
};
@@ -1439,7 +1442,6 @@ class RGWPutMetadataAccount : public RGWOp {
14391442
const std::set<std::string>& rmattr_names,
14401443
std::map<int, std::string>& temp_url_keys);
14411444
const char* name() const override { return "put_account_metadata"; }
1442-
std::string canonical_name() const override { return fmt::format("REST.{}.ACCOUNT_METADATA", s->info.method); }
14431445
RGWOpType get_type() override { return RGW_OP_PUT_METADATA_ACCOUNT; }
14441446
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
14451447
};
@@ -1471,7 +1473,6 @@ class RGWPutMetadataBucket : public RGWOp {
14711473
virtual int get_params(optional_yield y) = 0;
14721474
void send_response() override = 0;
14731475
const char* name() const override { return "put_bucket_metadata"; }
1474-
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_METADATA", s->info.method); }
14751476
RGWOpType get_type() override { return RGW_OP_PUT_METADATA_BUCKET; }
14761477
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
14771478
};
@@ -1494,7 +1495,6 @@ class RGWPutMetadataObject : public RGWOp {
14941495
virtual int get_params(optional_yield y) = 0;
14951496
void send_response() override = 0;
14961497
const char* name() const override { return "put_obj_metadata"; }
1497-
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_METADATA", s->info.method); }
14981498
RGWOpType get_type() override { return RGW_OP_PUT_METADATA_OBJECT; }
14991499
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
15001500
virtual bool need_object_expiration() { return false; }
@@ -1515,7 +1515,7 @@ class RGWRestoreObj : public RGWOp {
15151515

15161516
void send_response() override = 0;
15171517
const char* name() const override { return "restore_obj"; }
1518-
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT", s->info.method); }
1518+
std::string canonical_name() const override { return fmt::format("REST.{}.RESTORE", s->info.method); }
15191519
RGWOpType get_type() override { return RGW_OP_RESTORE_OBJ; }
15201520
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
15211521
};
@@ -1734,6 +1734,7 @@ class RGWGetObjAttrs : public RGWGetObj {
17341734
void execute(optional_yield y) override;
17351735
void send_response() override = 0;
17361736
const char* name() const override { return "get_obj_attrs"; }
1737+
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_ATTRIBUTES", s->info.method); }
17371738
RGWOpType get_type() override { return RGW_OP_GET_OBJ_ATTRS; }
17381739
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
17391740
}; /* RGWGetObjAttrs */
@@ -2564,6 +2565,7 @@ class RGWPutBucketObjectLock : public RGWOp {
25642565
virtual void send_response() override = 0;
25652566
virtual int get_params(optional_yield y) = 0;
25662567
const char* name() const override { return "put_bucket_object_lock"; }
2568+
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_LOCK", s->info.method); }
25672569
RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_OBJ_LOCK; }
25682570
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
25692571
};
@@ -2575,6 +2577,7 @@ class RGWGetBucketObjectLock : public RGWOp {
25752577
void execute(optional_yield y) override;
25762578
virtual void send_response() override = 0;
25772579
const char* name() const override {return "get_bucket_object_lock"; }
2580+
std::string canonical_name() const override { return fmt::format("REST.{}.OBJECT_LOCK", s->info.method); }
25782581
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_OBJ_LOCK; }
25792582
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
25802583
};
@@ -2655,7 +2658,6 @@ class RGWConfigBucketMetaSearch : public RGWOp {
26552658

26562659
virtual int get_params(optional_yield y) = 0;
26572660
const char* name() const override { return "config_bucket_meta_search"; }
2658-
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
26592661
virtual RGWOpType get_type() override { return RGW_OP_CONFIG_BUCKET_META_SEARCH; }
26602662
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
26612663
};
@@ -2669,7 +2671,6 @@ class RGWGetBucketMetaSearch : public RGWOp {
26692671
void execute(optional_yield) override {}
26702672

26712673
const char* name() const override { return "get_bucket_meta_search"; }
2672-
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
26732674
virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_META_SEARCH; }
26742675
virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
26752676
};
@@ -2683,7 +2684,6 @@ class RGWDelBucketMetaSearch : public RGWOp {
26832684
void execute(optional_yield y) override;
26842685

26852686
const char* name() const override { return "delete_bucket_meta_search"; }
2686-
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_MDSEARCH", s->info.method); }
26872687
virtual RGWOpType delete_type() { return RGW_OP_DEL_BUCKET_META_SEARCH; }
26882688
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
26892689
};

src/rgw/rgw_rest_bucket_logging.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class RGWGetBucketLoggingOp : public RGWOp {
124124
rgw_flush_formatter_and_reset(s, s->formatter);
125125
}
126126
const char* name() const override { return "get_bucket_logging"; }
127+
std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
127128
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOGGING; }
128129
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
129130
};
@@ -215,6 +216,7 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp {
215216
}
216217

217218
const char* name() const override { return "put_bucket_logging"; }
219+
std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
218220
RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_LOGGING; }
219221
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
220222

@@ -373,6 +375,7 @@ class RGWPostBucketLoggingOp : public RGWDefaultResponseOp {
373375
}
374376

375377
const char* name() const override { return "post_bucket_logging"; }
378+
std::string canonical_name() const override { return fmt::format("REST.{}.LOGGING", s->info.method); }
376379
RGWOpType get_type() override { return RGW_OP_POST_BUCKET_LOGGING; }
377380
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
378381

0 commit comments

Comments
 (0)