netbox-notices 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netbox_notices-0.1.0/CONTRIBUTING.md +116 -0
- netbox_notices-0.1.0/LICENSE +201 -0
- netbox_notices-0.1.0/MANIFEST.in +14 -0
- netbox_notices-0.1.0/PKG-INFO +365 -0
- netbox_notices-0.1.0/README.md +329 -0
- netbox_notices-0.1.0/docs/img/S3_permissions.png +0 -0
- netbox_notices-0.1.0/docs/img/S3_permissions2.png +0 -0
- netbox_notices-0.1.0/docs/img/SES_Lambda.png +0 -0
- netbox_notices-0.1.0/docs/img/SES_invoke.png +0 -0
- netbox_notices-0.1.0/docs/img/SES_ruleset.png +0 -0
- netbox_notices-0.1.0/docs/img/circuit_maintenance.png +0 -0
- netbox_notices-0.1.0/docs/img/iam_permissions.png +0 -0
- netbox_notices-0.1.0/docs/img/lambda_create.png +0 -0
- netbox_notices-0.1.0/docs/img/maintenance.png +0 -0
- netbox_notices-0.1.0/docs/img/provider_maintenance.png +0 -0
- netbox_notices-0.1.0/netbox_notices.egg-info/PKG-INFO +365 -0
- netbox_notices-0.1.0/netbox_notices.egg-info/SOURCES.txt +74 -0
- netbox_notices-0.1.0/netbox_notices.egg-info/dependency_links.txt +1 -0
- netbox_notices-0.1.0/netbox_notices.egg-info/requires.txt +15 -0
- netbox_notices-0.1.0/netbox_notices.egg-info/top_level.txt +1 -0
- netbox_notices-0.1.0/notices/__init__.py +37 -0
- netbox_notices-0.1.0/notices/api/__init__.py +1 -0
- netbox_notices-0.1.0/notices/api/serializers.py +409 -0
- netbox_notices-0.1.0/notices/api/urls.py +13 -0
- netbox_notices-0.1.0/notices/api/views.py +33 -0
- netbox_notices-0.1.0/notices/choices.py +211 -0
- netbox_notices-0.1.0/notices/constants.py +10 -0
- netbox_notices-0.1.0/notices/filtersets.py +152 -0
- netbox_notices-0.1.0/notices/forms.py +497 -0
- netbox_notices-0.1.0/notices/ical_utils.py +136 -0
- netbox_notices-0.1.0/notices/migrations/0001_initial.py +255 -0
- netbox_notices-0.1.0/notices/migrations/0002_maintenance_impact_outage_impact.py +23 -0
- netbox_notices-0.1.0/notices/migrations/0003_alter_outage_start.py +19 -0
- netbox_notices-0.1.0/notices/migrations/0004_outage_reported_at.py +19 -0
- netbox_notices-0.1.0/notices/migrations/__init__.py +0 -0
- netbox_notices-0.1.0/notices/models.py +433 -0
- netbox_notices-0.1.0/notices/navigation.py +62 -0
- netbox_notices-0.1.0/notices/signals.py +21 -0
- netbox_notices-0.1.0/notices/tables.py +240 -0
- netbox_notices-0.1.0/notices/template_content.py +104 -0
- netbox_notices-0.1.0/notices/timeline_utils.py +325 -0
- netbox_notices-0.1.0/notices/urls.py +120 -0
- netbox_notices-0.1.0/notices/utils.py +19 -0
- netbox_notices-0.1.0/notices/views.py +439 -0
- netbox_notices-0.1.0/notices/widgets.py +55 -0
- netbox_notices-0.1.0/pyproject.toml +115 -0
- netbox_notices-0.1.0/setup.cfg +4 -0
- netbox_notices-0.1.0/tests/__init__.py +1 -0
- netbox_notices-0.1.0/tests/conftest.py +86 -0
- netbox_notices-0.1.0/tests/test_configuration.py +33 -0
- netbox_notices-0.1.0/tests/test_filtersets.py +423 -0
- netbox_notices-0.1.0/tests/test_ical_download.py +80 -0
- netbox_notices-0.1.0/tests/test_ical_settings.py +27 -0
- netbox_notices-0.1.0/tests/test_ical_utils.py +153 -0
- netbox_notices-0.1.0/tests/test_ical_view.py +258 -0
- netbox_notices-0.1.0/tests/test_impact_forms.py +282 -0
- netbox_notices-0.1.0/tests/test_impact_model.py +329 -0
- netbox_notices-0.1.0/tests/test_maintenance_model.py +105 -0
- netbox_notices-0.1.0/tests/test_maintenance_serializers.py +237 -0
- netbox_notices-0.1.0/tests/test_navigation.py +189 -0
- netbox_notices-0.1.0/tests/test_netbox_circuitmaintenance.py +3 -0
- netbox_notices-0.1.0/tests/test_outage_forms.py +44 -0
- netbox_notices-0.1.0/tests/test_outage_models.py +199 -0
- netbox_notices-0.1.0/tests/test_outage_serializers.py +493 -0
- netbox_notices-0.1.0/tests/test_outage_views.py +83 -0
- netbox_notices-0.1.0/tests/test_permissions.py +328 -0
- netbox_notices-0.1.0/tests/test_reschedule_api.py +82 -0
- netbox_notices-0.1.0/tests/test_reschedule_form.py +70 -0
- netbox_notices-0.1.0/tests/test_reschedule_model.py +110 -0
- netbox_notices-0.1.0/tests/test_reschedule_view.py +179 -0
- netbox_notices-0.1.0/tests/test_tables.py +424 -0
- netbox_notices-0.1.0/tests/test_templates.py +242 -0
- netbox_notices-0.1.0/tests/test_timeline_utils.py +221 -0
- netbox_notices-0.1.0/tests/test_timezone_logic.py +209 -0
- netbox_notices-0.1.0/tests/test_url_patterns.py +327 -0
- netbox_notices-0.1.0/tests/test_views.py +312 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit
|
|
4
|
+
helps, and credit will always be given.
|
|
5
|
+
|
|
6
|
+
You can contribute in many ways:
|
|
7
|
+
|
|
8
|
+
## Types of Contributions
|
|
9
|
+
|
|
10
|
+
### Report Bugs
|
|
11
|
+
|
|
12
|
+
Report bugs at https://github.com/jsenecal/netbox-notices/issues.
|
|
13
|
+
|
|
14
|
+
If you are reporting a bug, please include:
|
|
15
|
+
|
|
16
|
+
* Your operating system name and version.
|
|
17
|
+
* Any details about your local setup that might be helpful in troubleshooting.
|
|
18
|
+
* Detailed steps to reproduce the bug.
|
|
19
|
+
|
|
20
|
+
### Fix Bugs
|
|
21
|
+
|
|
22
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
|
|
23
|
+
wanted" is open to whoever wants to implement it.
|
|
24
|
+
|
|
25
|
+
### Implement Features
|
|
26
|
+
|
|
27
|
+
Look through the GitHub issues for features. Anything tagged with "enhancement"
|
|
28
|
+
and "help wanted" is open to whoever wants to implement it.
|
|
29
|
+
|
|
30
|
+
### Write Documentation
|
|
31
|
+
|
|
32
|
+
NetBox Vendor Notification Plugin could always use more documentation, whether as part of the
|
|
33
|
+
official NetBox Vendor Notification Plugin docs, in docstrings, or even on the web in blog posts,
|
|
34
|
+
articles, and such.
|
|
35
|
+
|
|
36
|
+
### Submit Feedback
|
|
37
|
+
|
|
38
|
+
The best way to send feedback is to file an issue at https://github.com/jsenecal/netbox-notices/issues.
|
|
39
|
+
|
|
40
|
+
If you are proposing a feature:
|
|
41
|
+
|
|
42
|
+
* Explain in detail how it would work.
|
|
43
|
+
* Keep the scope as narrow as possible, to make it easier to implement.
|
|
44
|
+
* Remember that contributions are welcome :)
|
|
45
|
+
|
|
46
|
+
## Get Started!
|
|
47
|
+
|
|
48
|
+
Ready to contribute? Here's how to set up `netbox-notices` for local development.
|
|
49
|
+
|
|
50
|
+
1. Fork the `netbox-notices` repo on GitHub.
|
|
51
|
+
2. Clone your fork locally
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
$ git clone git@github.com:your_name_here/netbox-notices.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. Install dependencies and start your virtualenv:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
$ python3 -m venv venv
|
|
61
|
+
$ source venv/bin/activate
|
|
62
|
+
$ pip install -e ".[dev]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
4. Create a branch for local development:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
$ git checkout -b name-of-your-bugfix-or-feature
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Now you can make your changes locally.
|
|
72
|
+
|
|
73
|
+
5. When you're done making changes, check that your changes pass the
|
|
74
|
+
tests and linting:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
$ ./venv/bin/pytest tests/ -v
|
|
78
|
+
$ ./venv/bin/ruff format notices/ tests/
|
|
79
|
+
$ ./venv/bin/ruff check --fix notices/ tests/
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
6. Commit your changes and push your branch to GitHub:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
$ git add .
|
|
86
|
+
$ git commit -m "Your detailed description of your changes."
|
|
87
|
+
$ git push origin name-of-your-bugfix-or-feature
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
7. Submit a pull request through the GitHub website.
|
|
91
|
+
|
|
92
|
+
## Pull Request Guidelines
|
|
93
|
+
|
|
94
|
+
Before you submit a pull request, check that it meets these guidelines:
|
|
95
|
+
|
|
96
|
+
1. The pull request should include tests.
|
|
97
|
+
2. If the pull request adds functionality, the docs should be updated. Put
|
|
98
|
+
your new functionality into a function with a docstring, and add the
|
|
99
|
+
feature to the list in README.md.
|
|
100
|
+
3. The pull request should work for Python 3.10, 3.11, and 3.12. Check
|
|
101
|
+
https://github.com/jsenecal/netbox-notices/actions
|
|
102
|
+
and make sure that the tests pass for all supported Python versions.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Deploying
|
|
106
|
+
|
|
107
|
+
A reminder for the maintainers on how to deploy.
|
|
108
|
+
Make sure all your changes are committed (including an entry in CHANGELOG.md).
|
|
109
|
+
Then run:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
$ pip install bumpver build twine
|
|
113
|
+
$ bumpver update --patch # or --minor, --major
|
|
114
|
+
$ python -m build
|
|
115
|
+
$ twine upload dist/*
|
|
116
|
+
```
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
include CONTRIBUTING.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include README.md
|
|
4
|
+
|
|
5
|
+
recursive-include vendor_notification/templates *
|
|
6
|
+
recursive-include vendor_notification/api *
|
|
7
|
+
|
|
8
|
+
recursive-include tests *
|
|
9
|
+
recursive-exclude * __pycache__
|
|
10
|
+
recursive-exclude * *.py[co]
|
|
11
|
+
|
|
12
|
+
recursive-exclude parsers/*
|
|
13
|
+
|
|
14
|
+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netbox-notices
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Track maintenance and outage events across various NetBox models from vendors and internal sources.
|
|
5
|
+
Author-email: Jonathan Senecal <contact@jonathansenecal.com>, Jason Yates <me@jasonyates.co.uk>
|
|
6
|
+
Project-URL: Homepage, https://github.com/jsenecal/netbox-vendor-notification
|
|
7
|
+
Project-URL: Documentation, https://github.com/jsenecal/netbox-vendor-notification
|
|
8
|
+
Project-URL: Source, https://github.com/jsenecal/netbox-vendor-notification
|
|
9
|
+
Project-URL: Tracker, https://github.com/jsenecal/netbox-vendor-notification/issues
|
|
10
|
+
Keywords: notices
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.10.0
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: icalendar>=5.0.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: black==25.1.0; extra == "dev"
|
|
24
|
+
Requires-Dist: bumpver; extra == "dev"
|
|
25
|
+
Requires-Dist: isort==6.0.1; extra == "dev"
|
|
26
|
+
Requires-Dist: pip-tools; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: flake8>=7.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pyproject-flake8>=7.0.0; extra == "dev"
|
|
32
|
+
Requires-Dist: twine==6.1.0; extra == "dev"
|
|
33
|
+
Requires-Dist: Sphinx==8.2.3; extra == "dev"
|
|
34
|
+
Requires-Dist: watchdog==6.0.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# NetBox Notices
|
|
38
|
+
|
|
39
|
+
**Repository:** [github.com/jsenecal/netbox-notices](https://github.com/jsenecal/netbox-notices)
|
|
40
|
+
|
|
41
|
+
**Original Project:** Forked and inspired from [jasonyates/netbox-circuitmaintenance](https://github.com/jasonyates/netbox-circuitmaintenance), differs in the ability to track more than just maintenances, and circuits.
|
|
42
|
+
|
|
43
|
+
A NetBox plugin built to track maintenance and outage events across various NetBox models. This plugin is agnostic in that it is only built to store data surrounding maintenance/outage events and provide an overview of historical, active and upcoming events. The plugin tracks events at the provider level and associates impact across multiple NetBox object types (circuits, devices, virtual machines, power feeds, sites, etc.).
|
|
44
|
+
|
|
45
|
+
The plugin does not directly provide an automated approach to ingesting provider notifications, instead it extends NetBox's extensive REST API and provides GET/POST/PUT/PATCH methods to manage events. The plugin is intended to be coupled with an automated parser to handle the parsing of provider notifications and the delivery of the events to the plugin's REST API. Several example parsers have been [documented in the upstream project](https://jasonyates.github.io/netbox-circuitmaintenance/parsers/).
|
|
46
|
+
|
|
47
|
+
**Important Note:** This is a significant refactoring from the original `netbox-circuitmaintenance` plugin. **There is no upgrade path** from the original plugin. If you are using the original plugin, you will need to migrate your data manually.
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- Track provider maintenance events
|
|
52
|
+
- Track impact from provider maintenance across multiple NetBox object types
|
|
53
|
+
- Configurable allowed object types (circuits, devices, virtual machines, power feeds, sites, etc.)
|
|
54
|
+
- Provides a consolidated view of active, upcoming and historical maintenance events at the provider and object level
|
|
55
|
+
- Track unplanned outage events with optional end times and ETR tracking
|
|
56
|
+
- Unified event notification tracking
|
|
57
|
+
- Maintenance overlap detection (coming soon)
|
|
58
|
+
|
|
59
|
+
## Compatibility
|
|
60
|
+
|
|
61
|
+
This plugin requires NetBox 4.4.1 or higher.
|
|
62
|
+
|
|
63
|
+
| NetBox Version | Plugin Version |
|
|
64
|
+
| -------------- | -------------- |
|
|
65
|
+
| 4.4.1+ | 0.1.0 |
|
|
66
|
+
|
|
67
|
+
## Installing
|
|
68
|
+
|
|
69
|
+
A working installation of Netbox 4.4.1+ is required - [see official documentation](https://netbox.readthedocs.io/en/stable/plugins/).
|
|
70
|
+
|
|
71
|
+
### Package Installation
|
|
72
|
+
|
|
73
|
+
Activate your virtual env and install via pip:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
$ source /opt/netbox/venv/bin/activate
|
|
77
|
+
(venv) $ pip install netbox-notices
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
To ensure the plugin is automatically re-installed during future upgrades, add the package to your `local_requirements.txt`:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# echo netbox-notices >> local_requirements.txt
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Enable the Plugin
|
|
87
|
+
|
|
88
|
+
In the Netbox `configuration.py` configuration file add or update the PLUGINS parameter, adding `vendor_notification`:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
PLUGINS = [
|
|
92
|
+
'notices'
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
PLUGINS_CONFIG = {
|
|
96
|
+
"notices": {},
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Configuration
|
|
101
|
+
|
|
102
|
+
The plugin supports configuration of which NetBox object types can be linked to maintenance and outage events. By default, the plugin allows linking to circuits, power feeds, and sites.
|
|
103
|
+
|
|
104
|
+
#### Default Configuration
|
|
105
|
+
|
|
106
|
+
If you don't specify any configuration, the plugin uses these defaults:
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
PLUGINS_CONFIG = {
|
|
110
|
+
"notices": {
|
|
111
|
+
"allowed_content_types": [
|
|
112
|
+
"circuits.Circuit",
|
|
113
|
+
"dcim.PowerFeed",
|
|
114
|
+
"dcim.Site",
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Custom Configuration
|
|
121
|
+
|
|
122
|
+
You can customize which object types are allowed by specifying the `allowed_content_types` setting. Content types are specified in the format `app_label.model_name`.
|
|
123
|
+
|
|
124
|
+
##### Example: Add Devices and Virtual Machines
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
PLUGINS_CONFIG = {
|
|
128
|
+
"notices": {
|
|
129
|
+
"allowed_content_types": [
|
|
130
|
+
"circuits.Circuit",
|
|
131
|
+
"dcim.Device",
|
|
132
|
+
"dcim.PowerFeed",
|
|
133
|
+
"dcim.Site",
|
|
134
|
+
"virtualization.VirtualMachine",
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
##### Example: Minimal Configuration (Circuits Only)
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
PLUGINS_CONFIG = {
|
|
144
|
+
"notices": {
|
|
145
|
+
"allowed_content_types": [
|
|
146
|
+
"circuits.Circuit",
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
##### Example: Extended Configuration
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
PLUGINS_CONFIG = {
|
|
156
|
+
"notices": {
|
|
157
|
+
"allowed_content_types": [
|
|
158
|
+
"circuits.Circuit",
|
|
159
|
+
"dcim.Device",
|
|
160
|
+
"dcim.Interface",
|
|
161
|
+
"dcim.PowerFeed",
|
|
162
|
+
"dcim.Rack",
|
|
163
|
+
"dcim.Site",
|
|
164
|
+
"ipam.IPAddress",
|
|
165
|
+
"ipam.Prefix",
|
|
166
|
+
"virtualization.VirtualMachine",
|
|
167
|
+
"virtualization.VMInterface",
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
##### How Configuration Affects Behavior
|
|
174
|
+
|
|
175
|
+
- Only object types listed in `allowed_content_types` will appear in the Impact creation forms
|
|
176
|
+
- The API will reject attempts to create impacts for non-allowed object types
|
|
177
|
+
- Changing the configuration requires a NetBox restart
|
|
178
|
+
- This setting controls which objects can be linked via the `Impact` model to maintenance and outage events
|
|
179
|
+
|
|
180
|
+
##### Common NetBox Object Types
|
|
181
|
+
|
|
182
|
+
| Content Type | Description |
|
|
183
|
+
| ------------------------------- | ------------------------- |
|
|
184
|
+
| `circuits.Circuit` | Network circuits |
|
|
185
|
+
| `circuits.Provider` | Service providers |
|
|
186
|
+
| `dcim.Device` | Physical network devices |
|
|
187
|
+
| `dcim.Interface` | Device network interfaces |
|
|
188
|
+
| `dcim.PowerFeed` | Power supply connections |
|
|
189
|
+
| `dcim.PowerPanel` | Power distribution panels |
|
|
190
|
+
| `dcim.Rack` | Equipment racks |
|
|
191
|
+
| `dcim.Site` | Physical locations |
|
|
192
|
+
| `ipam.IPAddress` | IP addresses |
|
|
193
|
+
| `ipam.Prefix` | IP prefixes/subnets |
|
|
194
|
+
| `virtualization.VirtualMachine` | Virtual machines |
|
|
195
|
+
| `virtualization.VMInterface` | VM network interfaces |
|
|
196
|
+
|
|
197
|
+
### Apply Database Migrations
|
|
198
|
+
|
|
199
|
+
Apply database migrations with Netbox `manage.py`:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
(venv) $ python manage.py migrate
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Restart Netbox
|
|
206
|
+
|
|
207
|
+
Restart the Netbox service to apply changes:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
sudo systemctl restart netbox
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Outage Tracking
|
|
214
|
+
|
|
215
|
+
In addition to planned maintenance, this plugin supports tracking unplanned outage events:
|
|
216
|
+
|
|
217
|
+
### Key Features
|
|
218
|
+
|
|
219
|
+
- **Optional End Time**: Outages can be created without an end time, which becomes required when marking as resolved
|
|
220
|
+
- **ETR Tracking**: Track Estimated Time to Repair with full revision history via NetBox's changelog
|
|
221
|
+
- **Outage Status Workflow**:
|
|
222
|
+
- REPORTED: Initial state when outage is reported
|
|
223
|
+
- INVESTIGATING: Team is investigating root cause
|
|
224
|
+
- IDENTIFIED: Root cause identified, working on fix
|
|
225
|
+
- MONITORING: Fix applied, monitoring for stability
|
|
226
|
+
- RESOLVED: Outage fully resolved (requires end time)
|
|
227
|
+
- **Shared Impact Model**: Uses the same impact tracking as maintenance events (Impact model)
|
|
228
|
+
- **Unified View**: View both maintenance and outages together in a single interface
|
|
229
|
+
- **Flexible Object Support**: Link outages to any configured NetBox object type
|
|
230
|
+
|
|
231
|
+
### API Endpoints
|
|
232
|
+
|
|
233
|
+
**Maintenance Events:**
|
|
234
|
+
|
|
235
|
+
```text
|
|
236
|
+
GET /api/plugins/notices/maintenance/
|
|
237
|
+
POST /api/plugins/notices/maintenance/
|
|
238
|
+
GET /api/plugins/notices/maintenance/{id}/
|
|
239
|
+
PATCH /api/plugins/notices/maintenance/{id}/
|
|
240
|
+
DELETE /api/plugins/notices/maintenance/{id}/
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Outage Events:**
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
GET /api/plugins/notices/outage/
|
|
247
|
+
POST /api/plugins/notices/outage/
|
|
248
|
+
GET /api/plugins/notices/outage/{id}/
|
|
249
|
+
PATCH /api/plugins/notices/outage/{id}/
|
|
250
|
+
DELETE /api/plugins/notices/outage/{id}/
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Impact Tracking:**
|
|
254
|
+
|
|
255
|
+
```text
|
|
256
|
+
GET /api/plugins/notices/impact/
|
|
257
|
+
POST /api/plugins/notices/impact/
|
|
258
|
+
GET /api/plugins/notices/impact/{id}/
|
|
259
|
+
PATCH /api/plugins/notices/impact/{id}/
|
|
260
|
+
DELETE /api/plugins/notices/impact/{id}/
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Example: Creating an Outage
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
POST /api/plugins/notices/outage/
|
|
267
|
+
{
|
|
268
|
+
"name": "OUT-2024-001",
|
|
269
|
+
"summary": "Fiber cut on Main Street",
|
|
270
|
+
"provider": 1,
|
|
271
|
+
"start": "2024-10-29T14:30:00Z",
|
|
272
|
+
"estimated_time_to_repair": "2024-10-29T18:00:00Z",
|
|
273
|
+
"status": "INVESTIGATING"
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Example: Creating Impact for a Circuit
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
POST /api/plugins/notices/impact/
|
|
281
|
+
{
|
|
282
|
+
"maintenance": 1,
|
|
283
|
+
"content_type": "circuits.circuit",
|
|
284
|
+
"object_id": 42,
|
|
285
|
+
"impact": "OUTAGE"
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Example: Creating Impact for a Device
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
POST /api/plugins/notices/impact/
|
|
293
|
+
{
|
|
294
|
+
"outage": 1,
|
|
295
|
+
"content_type": "dcim.device",
|
|
296
|
+
"object_id": 123,
|
|
297
|
+
"impact": "DEGRADED"
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Data Models
|
|
302
|
+
|
|
303
|
+
The plugin uses four main models to track maintenance and outage events:
|
|
304
|
+
|
|
305
|
+
### Maintenance
|
|
306
|
+
|
|
307
|
+
Represents a planned maintenance event from a provider. Key fields:
|
|
308
|
+
|
|
309
|
+
- `name`: Event identifier
|
|
310
|
+
- `summary`: Description of the maintenance
|
|
311
|
+
- `provider`: Foreign key to NetBox Provider
|
|
312
|
+
- `start`, `end`: Maintenance window times
|
|
313
|
+
- `status`: TENTATIVE, CONFIRMED, CANCELLED, IN-PROCESS, COMPLETED, RE-SCHEDULED, UNKNOWN
|
|
314
|
+
- `internal_ticket`: Your organization's tracking ticket reference
|
|
315
|
+
- `acknowledged`: Whether the event has been acknowledged
|
|
316
|
+
|
|
317
|
+
### Outage
|
|
318
|
+
|
|
319
|
+
Represents an unplanned outage event from a provider. Key fields:
|
|
320
|
+
|
|
321
|
+
- `name`: Event identifier
|
|
322
|
+
- `summary`: Description of the outage
|
|
323
|
+
- `provider`: Foreign key to NetBox Provider
|
|
324
|
+
- `start`, `end`: Outage window times (end is optional until resolved)
|
|
325
|
+
- `status`: REPORTED, INVESTIGATING, IDENTIFIED, MONITORING, RESOLVED
|
|
326
|
+
- `estimated_time_to_repair`: ETR timestamp (tracked with changelog history)
|
|
327
|
+
- `internal_ticket`: Your organization's tracking ticket reference
|
|
328
|
+
- `acknowledged`: Whether the event has been acknowledged
|
|
329
|
+
|
|
330
|
+
### Impact
|
|
331
|
+
|
|
332
|
+
Links maintenance or outage events to affected NetBox objects using Django's Generic Foreign Key pattern:
|
|
333
|
+
|
|
334
|
+
- `maintenance` or `outage`: Foreign key to the event (mutually exclusive)
|
|
335
|
+
- `content_type`: The type of affected object (e.g., "circuits.circuit", "dcim.device")
|
|
336
|
+
- `object_id`: The ID of the affected object
|
|
337
|
+
- `impact`: Impact level - NO-IMPACT, REDUCED-REDUNDANCY, DEGRADED, OUTAGE
|
|
338
|
+
|
|
339
|
+
The Impact model allows linking events to **any NetBox object type** configured in `allowed_content_types`.
|
|
340
|
+
|
|
341
|
+
### EventNotification
|
|
342
|
+
|
|
343
|
+
Stores raw email notifications received from providers:
|
|
344
|
+
|
|
345
|
+
- `maintenance` or `outage`: Foreign key to the associated event
|
|
346
|
+
- `email`: Binary email data
|
|
347
|
+
- `email_body`: Extracted body text
|
|
348
|
+
- `subject`: Email subject line
|
|
349
|
+
- `email_from`: Sender address
|
|
350
|
+
- `email_received`: Receipt timestamp
|
|
351
|
+
|
|
352
|
+
## Screenshots
|
|
353
|
+
|
|
354
|
+

|
|
355
|
+

|
|
356
|
+

|
|
357
|
+
|
|
358
|
+
## Credits
|
|
359
|
+
|
|
360
|
+
Based on the NetBox plugin tutorial:
|
|
361
|
+
|
|
362
|
+
- [demo repository](https://github.com/netbox-community/netbox-plugin-demo)
|
|
363
|
+
- [tutorial](https://github.com/netbox-community/netbox-plugin-tutorial)
|
|
364
|
+
|
|
365
|
+
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`netbox-community/cookiecutter-netbox-plugin`](https://github.com/netbox-community/cookiecutter-netbox-plugin) project template.
|