Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_get_data_service_response uses service endpoint, should use data endpoint #86

Open
JulianBriggs opened this issue Jan 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@JulianBriggs
Copy link
Collaborator

Describe the bug
_get_data_service_response incorrectly sets
api_url api_url = urljoin(self.data_service_url, "service/r2/{}.jsp".format(service))
should b
api_url api_url = urljoin(self.data_service_url, "data/r2/{}.jsp".format(service))

To Reproduce
Steps to reproduce the behavior:

  1. Set DEBUG=True
  2. call get_status(...,use_data_service=True)
  3. connectionpool _make_request 456 DEBUG https://pvoutput.org:443 "GET /service/r2/getstatus.jsp?...

Expected behavior
expect connectionpool _make_request 456 DEBUG https://pvoutput.org:443 "GET /data/r2/getstatus.jsp?

Additional context
def _get_data_service_response(self, service: str, api_params: Dict) -> requests.Response:
"""
Args:
service: string, e.g. 'getbatchstatus'
api_params: dict
"""
self._check_api_params()
if self.data_service_url is None:
raise ValueError("data_service_url must be set to use the data service!")

    headers = {"X-Rate-Limit": "1"}
    api_params = api_params.copy()
    api_params["key"] = self.api_key
    api_params["sid"] = self.system_id

    api_url = urljoin(self.data_service_url, "service/r2/{}.jsp".format(service))

    return _get_response(api_url, api_params, headers)
@JulianBriggs JulianBriggs added the bug Something isn't working label Jan 24, 2022
@peterdudfield
Copy link
Contributor

did you manage to find a fix to this?

@JulianBriggs
Copy link
Collaborator Author

JulianBriggs commented Feb 5, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants