mirror of
https://github.com/ansible/awx.git
synced 2026-07-09 07:18:05 -02:30
Notification endpoints and url expositions
Also some changes to the footprint of the notification handler classes
This commit is contained in:
@@ -7,5 +7,10 @@ from django.core.mail.backends.smtp import EmailBackend
|
||||
|
||||
class CustomEmailBackend(EmailBackend):
|
||||
|
||||
init_parameters = ("host", "port", "username", "password",
|
||||
"use_tls", "use_ssl")
|
||||
init_parameters = {"host": {"label": "Host", "type": "string"},
|
||||
"port": {"label": "Port", "type": "int"},
|
||||
"username": {"label": "Username", "type": "string"},
|
||||
"password": {"label": "Password", "type": "password"},
|
||||
"use_tls": {"label": "Use TLS", "type": "bool"},
|
||||
"use_ssl": {"label": "Use SSL", "type": "bool"}}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ logger = logging.getLogger('awx.main.notifications.slack_backend')
|
||||
|
||||
class SlackBackend(BaseEmailBackend):
|
||||
|
||||
init_parameters = ('token',)
|
||||
init_parameters = {"token": {"label": "Token", "type": "password"}}
|
||||
|
||||
def __init__(self, token, fail_silently=False, **kwargs):
|
||||
super(SlackBackend, self).__init__(fail_silently=fail_silently)
|
||||
|
||||
@@ -11,7 +11,9 @@ logger = logging.getLogger('awx.main.notifications.twilio_backend')
|
||||
|
||||
class TwilioBackend(BaseEmailBackend):
|
||||
|
||||
init_parameters = ('account_sid', 'account_token', 'from_phone',)
|
||||
init_parameters = {"account_sid": {"label": "Account SID", "type": "string"},
|
||||
"account_token": {"label": "Account Token", "type": "password"},
|
||||
"from_phone": {"label": "Source Phone Number", "type": "string"}}
|
||||
|
||||
def __init__(self, account_sid, account_token, from_phone, fail_silently=False, **kwargs):
|
||||
super(TwilioBackend, self).__init__(fail_silently=fail_silently)
|
||||
|
||||
Reference in New Issue
Block a user