python cli for opsgenie
python cli for opsgenie
- Documentation: https://opsgeniecli.readthedocs.org/en/latest
The workflow supports the following steps
These actions are supported out of the box by the corresponding scripts under _CI/scripts directory with sane defaults based on best practices. Sourcing setup_aliases.ps1 for windows powershell or setup_aliases.sh in bash on Mac or Linux will provide with handy aliases for the shell of all those commands prepended with an underscore.
The bootstrap script creates a .venv directory inside the project directory hosting the virtual environment. It uses pipenv for that. It is called by all other scripts before they do anything. So one could simple start by calling _lint and that would set up everything before it tried to actually lint the project
Once the code is ready to be delivered the _tag script should be called accepting one of three arguments, patch, minor, major following the semantic versioning scheme. So for the initial delivery one would call
$ _tag –minor
which would bump the version of the project to 0.1.0 tag it in git and do a push and also ask for the change and automagically update HISTORY.rst with the version and the change provided.
So the full workflow after git is initialized is:
- repeat as necessary (of course it could be test - code - lint :) ) * code * lint * test
- commit and push
- develop more through the code-lint-test cycle
- tag (with the appropriate argument)
- upload (if you want to host your package in pypi)
- document (of course this could be run at any point)
This template is based on pipenv. In order to be compatible with requirements.txt so the actual created package can be used by any part of the existing python ecosystem some hacks were needed. So when building a package out of this do not simple call
$ python setup.py sdist bdist_egg
as this will produce an unusable artifact with files missing. Instead use the provided build and upload scripts that create all the necessary files in the artifact.
- First code creation
- testing release
- added functions
- maintenance policies - list functions - are now teambased
- all functions now rely on opsgenielib
- docs added to: INSTALLATION.rst
- ‘added functionality: adding more than 1 policy to a set_maintenance_policy’
- for multiple functions: using the config teamid when no –teamid is given.
- Removed cls=DefaultHelp from policy_maintenance_list
- Docstrings for every function, plus other linting errors
- bug fix for: policy-alerts list
- try to resolve autocompletion for powershell
- 2nd try to get powershell autocomplete to work
- Reverting back to autocomplete without click-completion
- Cleaning (mainly consistency in the naming format, read: snake_case everywhere)
- adjustments to use opsgenielib 0.0.18
- Adding: policy_alerts_enable
- Using the latest opsgenielib
- Adding the option to give multiple alert notification ID’s to enable
- added: function to disable alert policies
- Checking on the string ‘Disabled’ instead of ‘Enabled’
- Added functions to enable and disable notification policies
- ID variable could be a string or list in the enable/disable policies functions. Now it will always be a list.
- Copy paste error. Changed enabled to disabled for the policy_notificatio_policy.
- Changing to the filtering of the maintenance policy set.
- Small changes to policy-maintenance set.
- adding the option to add multiple –filter to policy-maintenance set
- Maintenance policy set - output now includes the names of the policies that are enabled
- Adding –filter functionality to cancel_maintenance_policy
- Fixes to policy_maintenance_cancel after testing
- Added argument –filter for function policy_maintenance_delete
- Added –filter to policy_alerts_delete
- Alert policy enable/disable: no longer –team_id a requirement and optimised –filter
- policy-notifications delete: Added –filter functionality
- policy_notifications_disable: added –filter functionality
- Using the latest opsgenielib version
- Added function ‘policy_alerts_get’
- Added function ‘policy_alerts_get’
- Removed ‘cls=DefaultHelp’ from the function ‘policy_alerts_list’. The effect is that no –team_id has to be specified to run the command.
- Fixing the time for maintenance set –start_date & –end_date
- Added the param –team_name to a lot of functions which uses regex to find the teamname or teamid
- Fix to ‘alerts_list’ by removing the default help class. Parameter options no longer conflict with builtin functions. Parameter options now use a dash instead of an underscore (team-name instead of team_name). Added function ‘schedules_timeline’
- Added the requirement to give a team-name for the function schedules_timeline
- the all option parameter had two dashes twice, the last one should be without any dashes to representation the internal variable
- Adding users endpoint and the function list users
- Added the functionality to close 1 or all alerts that are acknowledged but not closed
- Removed the team-id from policy_maintenance_list since it does not accept the parameter and added more docs to the function
- added prompt when using –all for the function alerts_close
- alerts_close - bug fix - was referencing to a non existing key in the variable result
- Function name was changed to list_maintenance_policy so had to update functions that used it
- Small fix for policy_maintenance_cancel
- Quicker results when trying to acknowledge all alerts
- naming changes, opsgenielib class was renamed plus maintenance functions.
- Added function policy_alerts_set
- policy_alerts_set parameter enabled to flag
- Maintenance policy set now notifies when no alert policies were found
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size opsgeniecli-0.0.55-py3.7.egg (42.0 kB)||File type Egg||Python version 3.7||Upload date||Hashes View|
|Filename, size opsgeniecli-0.0.55.tar.gz (63.3 kB)||File type Source||Python version None||Upload date||Hashes View|