summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/feedback/model.py
blob: 902f182563783158a5c778251035ebbe41300b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# # -*- coding: utf-8 -*-
from enum import Enum


class Feedback:
    project_id: int
    tracker_id: int
    subject: str
    description: str
    status: int

    class Project(Enum):
        dashboard = 46
        block = 9  # rbd
        object = 10  # rgw
        file_system = 13  # cephfs
        ceph_manager = 46
        orchestrator = 42
        ceph_volume = 39
        core_ceph = 36  # rados

    class TrackerType(Enum):
        bug = 1
        feature = 2

    class Status(Enum):
        new = 1

    def __init__(self, project_id, tracker_id, subject, description):
        self.project_id = int(project_id)
        self.tracker_id = int(tracker_id)
        self.subject = subject
        self.description = description
        self.status = Feedback.Status.new.value

    def as_dict(self):
        return {
            "issue": {
                "project": {
                    "id": self.project_id
                },
                "tracker_id": self.tracker_id,
                "Status": self.status,
                "subject": self.subject,
                "description": self.description
            }
        }