[RFE] Post-Release webhooks and generic scripts
This is an RFE for some discussions after perf/scale jam session and a continuation of some earlier ideas we had for post-release automation.
- Provide a
--webhook-urlargparse facility to--define-cloudand--mod-cloud - Provide a
--script-urlargparse facility to--define-cloudand--mod-cloud - Both of these are not mutually exclusive, e.g. we could send a webhook but also execute a script too.
- What actually happens afterwards (success/fail/thermonuclear war) with either of these workflows is beyond the scope of responsibility for QUADS.
1A) Post-Release Webhook URL
Provide a facility to push an optional post-release webhook payload to a defined URL at the time a cloud is defined (or can be added later via --mod-cloud) so upon successful release QUADS sends a webhook with a payload.
Related: https://www.redhat.com/en/topics/automation/what-is-a-webhook
e.g.
import requests
import json
import logging
from quads.config import Config
from quads.model import Host, Cloud, Schedule
webhookUrl = 'cloud.webhook.url`
webpayload = {'Cloud' : cloud.name,
' Details : ("https://wiki.example.com/%s" % cloud.name) ' ,
' Released: cloud.released',
'Some other data : 'some other data ', }
req = requests.post(webhookUrl, data=json.dumps(webpayload), headers={'Content-type' : 'application/json'})
- We'd then need to record if the webhook was sent (if defined) at the cloud level and reset that value once the environment is reclaimed.
1B) Webhook URL field on Landing Requests form for JIRA
Provide a form for this to be captured on our landing page and submitted into JIRA via something like "list an additional webhook URL's you'd like a notification sent to when your environment is released"
2A) Post-Release Generic Script Trigger
Provide a facility to copy a remote script defined in --script-url to the first host of a cloud to be executed upon environment release in a screen session.
We could likely accomplish this without too much complexity and without having to import Ansible libraries which would expand things a bit too much for a simple copy & run in screen type workflow.
- We'd then need to record if the webhook was sent (if defined) at the cloud level and reset that value once the environment is reclaimed.
2B) Generic Script field on Landing Requests form for JIRA
Provide a form for this to be captured on our landing page and submitted into JIRA via something like "list an additional HTTP location for a script to be retrieved and executed when your environment is released"