Skip to content

Commit

Permalink
rgw: declares bucket tagging op classes
Browse files Browse the repository at this point in the history
Signed-off-by: Chang Liu <[email protected]>
  • Loading branch information
liuchang0812 committed Jun 4, 2019
1 parent 25bcddf commit f7ea2bd
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/rgw/rgw_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,46 @@ class RGWDeleteObjTags: public RGWOp {
RGWOpType get_type() override { return RGW_OP_DELETE_OBJ_TAGGING;}
};

class RGWGetBucketTags : public RGWOp {
protected:
bufferlist tags_bl;
bool has_tags{false};
public:
int verify_permission() override;
void execute() override;
void pre_exec() override;

virtual void send_response_data(bufferlist& bl) = 0;
const char* name() const override { return "get_bucket_tags"; }
virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
RGWOpType get_type() override { return RGW_OP_GET_BUCKET_TAGGING; }
};

class RGWPutBucketTags : public RGWOp {
protected:
bufferlist tags_bl;
public:
int verify_permission() override;
void execute() override;

virtual void send_response() override = 0;
virtual int get_params() = 0;
const char* name() const override { return "put_bucket_tags"; }
virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_TAGGING; }
};

class RGWDeleteBucketTags : public RGWOp {
public:
void pre_exec() override;
int verify_permission() override;
void execute() override;

const char* name() const override { return "delete_bucket_tags"; }
virtual uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET_TAGGING;}
};

class RGWBulkDelete : public RGWOp {
public:
struct acct_path_t {
Expand Down
12 changes: 12 additions & 0 deletions src/rgw/rgw_rest.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ class RGWPutObjTags_ObjStore: public RGWPutObjTags {
~RGWPutObjTags_ObjStore() {};
};

class RGWGetBucketTags_ObjStore : public RGWGetBucketTags {
public:
RGWGetBucketTags_ObjStore() = default;
virtual ~RGWGetBucketTags_ObjStore() = default;
};

class RGWPutBucketTags_ObjStore: public RGWPutBucketTags {
public:
RGWPutBucketTags_ObjStore() = default;
virtual ~RGWPutBucketTags_ObjStore() = default;
};

class RGWListBuckets_ObjStore : public RGWListBuckets {
public:
RGWListBuckets_ObjStore() {}
Expand Down
27 changes: 27 additions & 0 deletions src/rgw/rgw_rest_s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,33 @@ class RGWDeleteObjTags_ObjStore_S3 : public RGWDeleteObjTags
void send_response() override;
};

class RGWGetBucketTags_ObjStore_S3 : public RGWGetBucketTags_ObjStore
{
bufferlist tags_bl;
public:
RGWGetBucketTags_ObjStore_S3() = default;
~RGWGetBucketTags_ObjStore_S3() = default;

void send_response_data(bufferlist &bl) override;
};

class RGWPutBucketTags_ObjStore_S3 : public RGWPutBucketTags_ObjStore
{
public:
RGWPutBucketTags_ObjStore_S3() {}
~RGWPutBucketTags_ObjStore_S3() {}

int get_params() override;
void send_response() override;
};

class RGWDeleteBucketTags_ObjStore_S3 : public RGWDeleteBucketTags
{
public:
~RGWDeleteBucketTags_ObjStore_S3() override {}
void send_response() override;
};

class RGWListBuckets_ObjStore_S3 : public RGWListBuckets_ObjStore {
public:
RGWListBuckets_ObjStore_S3() {}
Expand Down

0 comments on commit f7ea2bd

Please sign in to comment.