"""Interface to the ows-track microservice.""" from owsrequest import request from owsresponse import status from product_review.constants import error, services from product_review.util import exception as exception_util def get_tracks_on_product(product_id): """Get tracks on product.""" result = request.get(services.OWS_TRACK, f"/product/{product_id}/tracks") if result.status_code != status.OK: exception_util.raise_exception_for_ows_response( status=result.status_code, code=error.OWS_TRACK_ERROR_CODE, message=result.json(), ) return result.json()