diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 679d23aeee..a46788362b 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -2081,6 +2081,7 @@ class AdHocCommandSerializer(UnifiedJobSerializer): res.update(dict( events = reverse('api:ad_hoc_command_ad_hoc_command_events_list', args=(obj.pk,)), activity_stream = reverse('api:ad_hoc_command_activity_stream_list', args=(obj.pk,)), + notifications = reverse('api:ad_hoc_command_notifications_list', args=(obj.pk,)), )) res['cancel'] = reverse('api:ad_hoc_command_cancel', args=(obj.pk,)) res['relaunch'] = reverse('api:ad_hoc_command_relaunch', args=(obj.pk,)) diff --git a/awx/api/urls.py b/awx/api/urls.py index 5d906a29b1..97acc317bd 100644 --- a/awx/api/urls.py +++ b/awx/api/urls.py @@ -228,6 +228,7 @@ ad_hoc_command_urls = patterns('awx.api.views', url(r'^(?P[0-9]+)/relaunch/$', 'ad_hoc_command_relaunch'), url(r'^(?P[0-9]+)/events/$', 'ad_hoc_command_ad_hoc_command_events_list'), url(r'^(?P[0-9]+)/activity_stream/$', 'ad_hoc_command_activity_stream_list'), + url(r'^(?P[0-9]+)/notifications/$', 'ad_hoc_command_notifications_list'), url(r'^(?P[0-9]+)/stdout/$', 'ad_hoc_command_stdout'), ) diff --git a/awx/api/views.py b/awx/api/views.py index ad98c02f65..042a123fbe 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -3300,6 +3300,14 @@ class AdHocCommandActivityStreamList(SubListAPIView): return super(AdHocCommandActivityStreamList, self).get(request, *args, **kwargs) +class AdHocCommandNotificationsList(SubListAPIView): + + model = Notification + serializer_class = NotificationSerializer + parent_model = AdHocCommand + relationship = 'notifications' + + class SystemJobList(ListCreateAPIView): model = SystemJob