mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #3226 from jangsutsr/3048_add_notifications_to_ad_hoc_cmd_list
Add notifications link to ad_hoc command details.
This commit is contained in:
commit
65ac7f8470
@ -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,))
|
||||
|
@ -228,6 +228,7 @@ ad_hoc_command_urls = patterns('awx.api.views',
|
||||
url(r'^(?P<pk>[0-9]+)/relaunch/$', 'ad_hoc_command_relaunch'),
|
||||
url(r'^(?P<pk>[0-9]+)/events/$', 'ad_hoc_command_ad_hoc_command_events_list'),
|
||||
url(r'^(?P<pk>[0-9]+)/activity_stream/$', 'ad_hoc_command_activity_stream_list'),
|
||||
url(r'^(?P<pk>[0-9]+)/notifications/$', 'ad_hoc_command_notifications_list'),
|
||||
url(r'^(?P<pk>[0-9]+)/stdout/$', 'ad_hoc_command_stdout'),
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user