mirror of
https://github.com/ansible/awx.git
synced 2026-04-19 00:40:18 -02:30
Update the Insights API urls to use the new url structure
This commit is contained in:
@@ -1694,14 +1694,14 @@ class HostInsights(GenericAPIView):
|
||||
|
||||
(username, password) = self._extract_insights_creds(cred)
|
||||
|
||||
host_url = '{}/r/insights/platform/inventory/api/v1/hosts?insights_id={}'.format(
|
||||
host_url = '{}/api/inventory/v1/hosts?insights_id={}'.format(
|
||||
settings.INSIGHTS_URL_BASE, host.insights_system_id)
|
||||
res = self._call_insights_api(host_url, username, password)
|
||||
if isinstance(res, tuple): # This value was constructed based on a bad response from the API.
|
||||
return Response(res[0], status=res[1])
|
||||
platform_id = res.json()['results'][0]['id']
|
||||
|
||||
reports_url = '{}/r/insights/platform/advisor/v1/system/{}/reports/'.format(
|
||||
reports_url = '{}/api/insights/v1/system/{}/reports/'.format(
|
||||
settings.INSIGHTS_URL_BASE, platform_id)
|
||||
(msg, err_code) = self.get_insights(reports_url, username, password)
|
||||
return Response(msg, status=err_code)
|
||||
|
||||
Reference in New Issue
Block a user