Skip to content

Commit

Permalink
adding bundles and event_type
Browse files Browse the repository at this point in the history
  • Loading branch information
larrymou9 committed Feb 8, 2024
1 parent 97ee338 commit a97e9cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions opl/generators/notifications_ingres_template.json.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "1.0.0",
"bundle": "console",
"application": "integrations",
"event_type": "integration-disabled",
"bundle": "{{ bundle }}",
"application": "{{ application }}",
"event_type": "{{ event_type }}",
"timestamp": "{{ nowz }}",
"org_id": "12345",
"events": [{
Expand Down
9 changes: 8 additions & 1 deletion opl/generators/notifications_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@


class NotificationsMessagesGenerator(opl.generators.generic.GenericGenerator):
def __init__(self, count=1, template="notifications_ingres_template.json.j2"):
def __init__(self, count=1, template="notifications_ingres_template.json.j2", event_type="integration-failed",
bundle="console", application="integrations"):
self.event_type = event_type
self.bundle = bundle
self.application = application
super().__init__(count=count, template=template, dump_message=False)

def _data(self):
account = self._get_account()

return {
"application": self.application,
"bundle": self.bundle,
"event_type": self.event_type,
"notifications_id": self._get_uuid(),
"account": account,
"fqdn": self._get_hostname(),
Expand Down

0 comments on commit a97e9cf

Please sign in to comment.