Skip to content

Commit ad3f8f8

Browse files
committed
rgw/logging: fix canonical names
Fixes: https://tracker.ceph.com/issues/71638 Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent f768b92 commit ad3f8f8

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

src/rgw/rgw_op.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ class RGWGetBucketReplication : public RGWOp {
604604

605605
virtual void send_response_data() = 0;
606606
const char* name() const override { return "get_bucket_replication"; }
607+
std::string canonical_name() const override { return fmt::format("REST.{}.REPLICATION", s->info.method); }
607608
virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
608609
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_REPLICATION; }
609610
};
@@ -619,6 +620,7 @@ class RGWPutBucketReplication : public RGWOp {
619620
virtual void send_response() override = 0;
620621
virtual int get_params(optional_yield y) = 0;
621622
const char* name() const override { return "put_bucket_replication"; }
623+
std::string canonical_name() const override { return fmt::format("REST.{}.REPLICATION", s->info.method); }
622624
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
623625
RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_REPLICATION; }
624626
};
@@ -632,6 +634,7 @@ class RGWDeleteBucketReplication : public RGWOp {
632634
void execute(optional_yield y) override;
633635

634636
const char* name() const override { return "delete_bucket_replication"; }
637+
std::string canonical_name() const override { return fmt::format("REST.{}.REPLICATION", s->info.method); }
635638
virtual uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
636639
RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET_REPLICATION;}
637640
};
@@ -1016,6 +1019,7 @@ class RGWGetBucketVersioning : public RGWOp {
10161019

10171020
void send_response() override = 0;
10181021
const char* name() const override { return "get_bucket_versioning"; }
1022+
std::string canonical_name() const override { return fmt::format("REST.{}.VERSIONING", s->info.method); }
10191023
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_VERSIONING; }
10201024
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
10211025
};
@@ -1044,6 +1048,7 @@ class RGWSetBucketVersioning : public RGWOp {
10441048

10451049
void send_response() override = 0;
10461050
const char* name() const override { return "set_bucket_versioning"; }
1051+
std::string canonical_name() const override { return fmt::format("REST.{}.VERSIONING", s->info.method); }
10471052
RGWOpType get_type() override { return RGW_OP_SET_BUCKET_VERSIONING; }
10481053
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
10491054
};
@@ -1845,6 +1850,7 @@ class RGWPutBucketEncryption : public RGWOp {
18451850
int verify_permission(optional_yield y) override;
18461851
void execute(optional_yield y) override;
18471852
const char* name() const override { return "put_bucket_encryption"; }
1853+
std::string canonical_name() const override { return fmt::format("REST.{}.ENCRYPTION", s->info.method); }
18481854
RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_ENCRYPTION; }
18491855
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
18501856
};
@@ -1859,6 +1865,7 @@ class RGWGetBucketEncryption : public RGWOp {
18591865
int verify_permission(optional_yield y) override;
18601866
void execute(optional_yield y) override;
18611867
const char* name() const override { return "get_bucket_encryption"; }
1868+
std::string canonical_name() const override { return fmt::format("REST.{}.ENCRYPTION", s->info.method); }
18621869
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_ENCRYPTION; }
18631870
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
18641871
};
@@ -1873,6 +1880,7 @@ class RGWDeleteBucketEncryption : public RGWOp {
18731880
int verify_permission(optional_yield y) override;
18741881
void execute(optional_yield y) override;
18751882
const char* name() const override { return "delete_bucket_encryption"; }
1883+
std::string canonical_name() const override { return fmt::format("REST.{}.ENCRYPTION", s->info.method); }
18761884
RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET_ENCRYPTION; }
18771885
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
18781886
};
@@ -1890,6 +1898,7 @@ class RGWGetRequestPayment : public RGWOp {
18901898

18911899
void send_response() override = 0;
18921900
const char* name() const override { return "get_request_payment"; }
1901+
std::string canonical_name() const override { return fmt::format("REST.{}.REQUEST_PAYMENT", s->info.method); }
18931902
RGWOpType get_type() override { return RGW_OP_GET_REQUEST_PAYMENT; }
18941903
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
18951904
};
@@ -1909,6 +1918,7 @@ class RGWSetRequestPayment : public RGWOp {
19091918

19101919
void send_response() override = 0;
19111920
const char* name() const override { return "set_request_payment"; }
1921+
std::string canonical_name() const override { return fmt::format("REST.{}.REQUEST_PAYMENT", s->info.method); }
19121922
RGWOpType get_type() override { return RGW_OP_SET_REQUEST_PAYMENT; }
19131923
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
19141924
};
@@ -2457,6 +2467,7 @@ class RGWPutBucketPolicy : public RGWOp {
24572467
void execute(optional_yield y) override;
24582468
int get_params(optional_yield y);
24592469
const char* name() const override { return "put_bucket_policy"; }
2470+
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKETPOLICY", s->info.method); }
24602471
RGWOpType get_type() override {
24612472
return RGW_OP_PUT_BUCKET_POLICY;
24622473
}
@@ -2473,6 +2484,7 @@ class RGWGetBucketPolicy : public RGWOp {
24732484
}
24742485
void execute(optional_yield y) override;
24752486
const char* name() const override { return "get_bucket_policy"; }
2487+
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKETPOLICY", s->info.method); }
24762488
RGWOpType get_type() override {
24772489
return RGW_OP_GET_BUCKET_POLICY;
24782490
}
@@ -2489,6 +2501,7 @@ class RGWDeleteBucketPolicy : public RGWOp {
24892501
void execute(optional_yield y) override;
24902502
int get_params(optional_yield y);
24912503
const char* name() const override { return "delete_bucket_policy"; }
2504+
std::string canonical_name() const override { return fmt::format("REST.{}.BUCKETPOLICY", s->info.method); }
24922505
RGWOpType get_type() override {
24932506
return RGW_OP_DELETE_BUCKET_POLICY;
24942507
}
@@ -2662,6 +2675,7 @@ class RGWPutBucketPublicAccessBlock : public RGWOp {
26622675
int verify_permission(optional_yield y) override;
26632676
const char* name() const override { return "put_bucket_public_access_block";}
26642677
virtual RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_PUBLIC_ACCESS_BLOCK; }
2678+
std::string canonical_name() const override { return fmt::format("REST.{}.PUBLIC_ACCESS_BLOCK", s->info.method); }
26652679
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
26662680
int get_params(optional_yield y);
26672681
void execute(optional_yield y) override;
@@ -2674,6 +2688,7 @@ class RGWGetBucketPublicAccessBlock : public RGWOp {
26742688
public:
26752689
int verify_permission(optional_yield y) override;
26762690
const char* name() const override { return "get_bucket_public_access_block";}
2691+
std::string canonical_name() const override { return fmt::format("REST.{}.PUBLIC_ACCESS_BLOCK", s->info.method); }
26772692
virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_PUBLIC_ACCESS_BLOCK; }
26782693
virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
26792694
int get_params(optional_yield y);
@@ -2687,6 +2702,7 @@ class RGWDeleteBucketPublicAccessBlock : public RGWOp {
26872702
public:
26882703
int verify_permission(optional_yield y) override;
26892704
const char* name() const override { return "delete_bucket_public_access_block";}
2705+
std::string canonical_name() const override { return fmt::format("REST.{}.PUBLIC_ACCESS_BLOCK", s->info.method); }
26902706
virtual RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET_PUBLIC_ACCESS_BLOCK; }
26912707
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
26922708
int get_params(optional_yield y);

src/rgw/rgw_rest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ class RGWGetBucketTags_ObjStore : public RGWGetBucketTags {
153153
RGWGetBucketTags_ObjStore() = default;
154154
virtual ~RGWGetBucketTags_ObjStore() = default;
155155

156-
virtual std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_TAGGING", s->info.method); }
156+
virtual std::string canonical_name() const override { return fmt::format("REST.{}.TAGGING", s->info.method); }
157157
};
158158

159159
class RGWPutBucketTags_ObjStore: public RGWPutBucketTags {
160160
public:
161161
RGWPutBucketTags_ObjStore() = default;
162162
virtual ~RGWPutBucketTags_ObjStore() = default;
163163

164-
virtual std::string canonical_name() const override { return fmt::format("REST.{}.BUCKET_TAGGING", s->info.method); }
164+
virtual std::string canonical_name() const override { return fmt::format("REST.{}.TAGGING", s->info.method); }
165165
};
166166

167167
class RGWGetBucketReplication_ObjStore : public RGWGetBucketReplication {

src/rgw/rgw_rest_pubsub.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ class RGWPSCreateNotifOp : public RGWDefaultResponseOp {
11891189
}
11901190

11911191
const char* name() const override { return "pubsub_notification_create_s3"; }
1192+
std::string canonical_name() const override { return fmt::format("REST.{}.NOTIFICATION", s->info.method); }
11921193
RGWOpType get_type() override { return RGW_OP_PUBSUB_NOTIF_CREATE; }
11931194
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
11941195

@@ -1444,6 +1445,7 @@ class RGWPSDeleteNotifOp : public RGWDefaultResponseOp {
14441445
}
14451446

14461447
const char* name() const override { return "pubsub_notification_delete_s3"; }
1448+
std::string canonical_name() const override { return fmt::format("REST.{}.NOTIFICATION", s->info.method); }
14471449
RGWOpType get_type() override { return RGW_OP_PUBSUB_NOTIF_DELETE; }
14481450
uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
14491451

@@ -1548,6 +1550,7 @@ class RGWPSListNotifsOp : public RGWOp {
15481550
}
15491551

15501552
const char* name() const override { return "pubsub_notifications_get_s3"; }
1553+
std::string canonical_name() const override { return fmt::format("REST.{}.NOTIFICATION", s->info.method); }
15511554
RGWOpType get_type() override { return RGW_OP_PUBSUB_NOTIF_LIST; }
15521555
uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
15531556

src/rgw/rgw_rest_s3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class RGWGetBucketWebsite_ObjStore_S3 : public RGWGetBucketWebsite {
215215
~RGWGetBucketWebsite_ObjStore_S3() override {}
216216

217217
void send_response() override;
218-
virtual std::string canonical_name() const override { return fmt::format("WEBSITE.{}.BUCKET_WEBSITE", s->info.method); }
218+
virtual std::string canonical_name() const override { return fmt::format("REST.{}.WEBSITE", s->info.method); }
219219
};
220220

221221
class RGWSetBucketWebsite_ObjStore_S3 : public RGWSetBucketWebsite {
@@ -225,7 +225,7 @@ class RGWSetBucketWebsite_ObjStore_S3 : public RGWSetBucketWebsite {
225225

226226
int get_params(optional_yield y) override;
227227
void send_response() override;
228-
virtual std::string canonical_name() const override { return fmt::format("WEBSITE.{}.BUCKET_WEBSITE", s->info.method); }
228+
virtual std::string canonical_name() const override { return fmt::format("REST.{}.WEBSITE", s->info.method); }
229229
};
230230

231231
class RGWDeleteBucketWebsite_ObjStore_S3 : public RGWDeleteBucketWebsite {
@@ -234,7 +234,7 @@ class RGWDeleteBucketWebsite_ObjStore_S3 : public RGWDeleteBucketWebsite {
234234
~RGWDeleteBucketWebsite_ObjStore_S3() override {}
235235

236236
void send_response() override;
237-
virtual std::string canonical_name() const override { return fmt::format("WEBSITE.{}.BUCKET_WEBSITE", s->info.method); }
237+
virtual std::string canonical_name() const override { return fmt::format("REST.{}.WEBSITE", s->info.method); }
238238
};
239239

240240
class RGWStatBucket_ObjStore_S3 : public RGWStatBucket_ObjStore {

src/rgw/rgw_rest_s3website.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ class RGWGetObj_ObjStore_S3Website : public RGWGetObj_ObjStore_S3
9797
return RGWGetObj_ObjStore_S3::get_params(y);
9898
}
9999
}
100+
std::string canonical_name() const override { return fmt::format("WEBSITE.{}.OBJECT", s->info.method); }
100101
};

0 commit comments

Comments
 (0)