]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_notify_event_type.h
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / rgw / rgw_notify_event_type.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5 #include <string>
6 #include <vector>
7
8 namespace rgw::notify {
9 enum EventType {
10 ObjectCreated = 0xF,
11 ObjectCreatedPut = 0x1,
12 ObjectCreatedPost = 0x2,
13 ObjectCreatedCopy = 0x4,
14 ObjectCreatedCompleteMultipartUpload = 0x8,
15 ObjectRemoved = 0xF0,
16 ObjectRemovedDelete = 0x10,
17 ObjectRemovedDeleteMarkerCreated = 0x20,
18 // lifecycle events (RGW extension)
19 ObjectLifecycle = 0xFF00,
20 ObjectExpiration = 0xF00,
21 ObjectExpirationCurrent = 0x100,
22 ObjectExpirationNoncurrent = 0x200,
23 ObjectExpirationDeleteMarker = 0x400,
24 ObjectExpirationAbortMPU = 0x800,
25 ObjectTransition = 0xF000,
26 ObjectTransitionCurrent = 0x1000,
27 ObjectTransitionNoncurrent = 0x2000,
28 ObjectSynced = 0xF0000,
29 ObjectSyncedCreate = 0x10000,
30 ObjectSyncedDelete = 0x20000,
31 ObjectSyncedDeletionMarkerCreated = 0x40000,
32 UnknownEvent = 0x100000
33 };
34
35 using EventTypeList = std::vector<EventType>;
36
37 // two event types are considered equal if their bits intersect
38 bool operator==(EventType lhs, EventType rhs);
39
40 std::string to_string(EventType t);
41
42 std::string to_event_string(EventType t);
43
44 EventType from_string(const std::string& s);
45
46 // create a vector of event types from comma separated list of event types
47 void from_string_list(const std::string& string_list, EventTypeList& event_list);
48 }
49