warn about endpoint deprecation in the CLI

This commit is contained in:
Ryan Petrello
2019-10-16 12:03:16 -04:00
parent 1376b8a149
commit c8a29bac66
3 changed files with 18 additions and 3 deletions

View File

@@ -205,6 +205,9 @@ class APIView(views.APIView):
response['X-API-Query-Count'] = len(q_times)
response['X-API-Query-Time'] = '%0.3fs' % sum(q_times)
if getattr(self, 'deprecated', False):
response['Warning'] = '299 awx "This resource has been deprecated and will be removed in a future release."' # noqa
return response
def get_authenticate_header(self, request):