/
constants.py
135 lines (131 loc) · 3.22 KB
/
constants.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Events
EVENT_CREATE = 'create'
EVENT_UPDATE = 'update'
EVENT_DELETE = 'delete'
EVENT_JOB_START = 'job_start'
EVENT_JOB_END = 'job_end'
# Webhooks
HTTP_CONTENT_TYPE_JSON = 'application/json'
WEBHOOK_EVENT_TYPES = {
EVENT_CREATE: 'created',
EVENT_UPDATE: 'updated',
EVENT_DELETE: 'deleted',
EVENT_JOB_START: 'job_started',
EVENT_JOB_END: 'job_ended',
}
# Dashboard
DEFAULT_DASHBOARD = [
{
'widget': 'extras.BookmarksWidget',
'width': 4,
'height': 5,
'title': 'Bookmarks',
'color': 'orange',
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 2,
'title': 'Organization',
'config': {
'models': [
'dcim.site',
'tenancy.tenant',
'tenancy.contact',
]
}
},
{
'widget': 'extras.NoteWidget',
'width': 4,
'height': 2,
'title': 'Welcome!',
'color': 'green',
'config': {
'content': (
'This is your personal dashboard. Feel free to customize it by rearranging, resizing, or removing '
'widgets. You can also add new widgets using the "add widget" button below. Any changes affect only '
'_your_ dashboard, so feel free to experiment!'
)
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 3,
'title': 'IPAM',
'config': {
'models': [
'ipam.vrf',
'ipam.aggregate',
'ipam.prefix',
'ipam.iprange',
'ipam.ipaddress',
'ipam.vlan',
]
}
},
{
'widget': 'extras.RSSFeedWidget',
'width': 4,
'height': 4,
'title': 'NetBox News',
'config': {
'feed_url': 'http://netbox.dev/rss/',
'max_entries': 10,
'cache_timeout': 14400,
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 3,
'title': 'Circuits',
'config': {
'models': [
'circuits.provider',
'circuits.circuit',
'circuits.providernetwork',
'circuits.provideraccount',
]
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 3,
'title': 'DCIM',
'config': {
'models': [
'dcim.site',
'dcim.rack',
'dcim.devicetype',
'dcim.device',
'dcim.cable',
],
}
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
'height': 2,
'title': 'Virtualization',
'config': {
'models': [
'virtualization.cluster',
'virtualization.virtualmachine',
]
}
},
{
'widget': 'extras.ObjectListWidget',
'width': 12,
'height': 5,
'title': 'Change Log',
'color': 'blue',
'config': {
'model': 'extras.objectchange',
'page_size': 25,
}
},
]