]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_notify_event_type.h
import quincy beta 17.1.0
[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 UnknownEvent = 0x10000
29 };
30
31 using EventTypeList = std::vector<EventType>;
32
33 // two event types are considered equal if their bits intersect
34 bool operator==(EventType lhs, EventType rhs);
35
36 std::string to_string(EventType t);
37
38 std::string to_ceph_string(EventType t);
39
40 std::string to_event_string(EventType t);
41
42 EventType from_string(const std::string& s);
43
44 // create a vector of event types from comma separated list of event types
45 void from_string_list(const std::string& string_list, EventTypeList& event_list);
46 }
47