diff --git a/google/cloud/storage/_http.py b/google/cloud/storage/_http.py index 0ade1525f..8eaee23c0 100644 --- a/google/cloud/storage/_http.py +++ b/google/cloud/storage/_http.py @@ -39,7 +39,15 @@ class Connection(_http.JSONConnection): def __init__(self, client, client_info=None, api_endpoint=None): super(Connection, self).__init__(client, client_info) - self.API_BASE_URL = api_endpoint or self.DEFAULT_API_ENDPOINT + self.API_BASE_URL = ( + api_endpoint or self.DEFAULT_API_ENDPOINT + "/storage/{self.API_VERSION}" + ) + # A template for the URL of a particular API call. + self.API_URL_TEMPLATE = ( + "{api_base_url}/storage/{api_version}{path}" + if api_endpoint is None + else "{api_base_url}{path}" + ) self.API_BASE_MTLS_URL = self.DEFAULT_API_MTLS_ENDPOINT self.ALLOW_AUTO_SWITCH_TO_MTLS_URL = api_endpoint is None self._client_info.client_library_version = __version__ @@ -54,9 +62,6 @@ def __init__(self, client, client_info=None, api_endpoint=None): API_VERSION = "v1" """The version of the API, used in building the API call's URL.""" - API_URL_TEMPLATE = "{api_base_url}/storage/{api_version}{path}" - """A template for the URL of a particular API call.""" - def api_request(self, *args, **kwargs): retry = kwargs.pop("retry", None) call = functools.partial(super(Connection, self).api_request, *args, **kwargs)