def get(endpoint, parameters={}): """ Query the Insights API (admin.insights.ubuntu.com) using the cache """ return feeds.cached_request( helpers.build_url(API_URL, endpoint, parameters))
def feed(type=None, slug=None): # noqa feed_url = ''.join([INSIGHTS_ADMIN_URL, flask.request.full_path]) feed_text = feeds.cached_request(feed_url).text feed_text = feed_text.replace('admin.insights.ubuntu.com', 'insights.ubuntu.com') return flask.Response(feed_text, mimetype='text/xml')