Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpsGenie to use their V2 API (2018.3) #51174

Merged
merged 5 commits into from Jan 15, 2019

Conversation

Projects
None yet
2 participants
@jpsv
Copy link
Contributor

commented Jan 14, 2019

What does this PR do?

Updates OpsGenie to use their V2 API.

What issues does this PR fix or reference?

OpsGenie's V1 API was deprecated in June 2018

Previous Behavior

Completely broken.

New Behavior

Able to create an alert "onfail", and close the alert when not.

Tests written?

No

Commits signed with GPG?

No

Example pillar

used_space:
  disk.status:
    - name: 'C:\'
    - maximum: 79%
    - minimum: 10%
   
opsgenie_create_action_sender:
  opsgenie.create_alert:
    - api_key: '{{ pillar['opsgenie_sysadmin_apitoken'] }}'
    - reason: 'Disk capacity is out of designated range for {{ grains['id'] }}.'
    - name: '{{ grains['id'] }}_disk.status'
    - onfail:
      - disk: used_space
 
opsgenie_close_action_sender:
  opsgenie.close_alert:
    - api_key: '{{ pillar['opsgenie_sysadmin_apitoken'] }}'
    - name: '{{ grains['id'] }}_disk.status'
    - require:
      - disk: used_space

jpsv added some commits Jan 14, 2019

Update to V2 API
* Added if/else block for creating or closing an alert
* Removed test for "action_type"
Update to from V1 API to V2
Mainly removed test for action_type
@jpsv

This comment has been minimized.

Copy link
Contributor Author

commented Jan 14, 2019

OpsGenie was introduced in 2018.3 so I only went back 1 version, not 2.

jpsv added some commits Jan 14, 2019

Update opsgenie.py
Added back "action_type" for test parameter to satisfy Python linting.

@dwoz dwoz changed the title 2018.3 Update OpsGenie to use their V2 API (2018.3) Jan 15, 2019

@dwoz

dwoz approved these changes Jan 15, 2019

@dwoz dwoz merged commit a96deed into saltstack:2018.3 Jan 15, 2019

10 checks passed

WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details

@jpsv jpsv deleted the jpsv:2018.3 branch Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.