Commit 15548018 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Use retrieve endpoint to download blobs

parent c4d9055d
......@@ -175,6 +175,19 @@ class GeoNode < ApplicationRecord
@internal_uri ||= URI.parse(internal_url) if internal_url.present?
end
# Geo API endpoint for retrieving a replicable item
#
# @param [String] replicable_name
# @param [Integer] replicable_id
def geo_retrieve_url(replicable_name, replicable_id)
geo_api_url("retrieve/#{replicable_name}/#{replicable_id}")
end
# Geo API endpoint for retrieving a file based on Uploads
#
# @deprecated
# @param [String] file_type
# @param [Integer] file_id
def geo_transfers_url(file_type, file_id)
geo_api_url("transfers/#{file_type}/#{file_id}")
end
......
......@@ -49,8 +49,7 @@ module Gitlab
# @return [String] URL to download the resource from
def resource_url
# TODO change to Generalized API endpoint after that is implemented
Gitlab::Geo.primary_node.geo_transfers_url(replicable_name, model_record.id.to_s)
Gitlab::Geo.primary_node.geo_retrieve_url(replicable_name, model_record.id.to_s)
end
private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment