VRFS-4074 - cloud uri/storage for jamblaster
This commit is contained in:
parent
94128e7115
commit
166647d112
|
|
@ -4,7 +4,7 @@ module JamRuby
|
|||
DEFAULT_ENVIRONMENT = 'public'
|
||||
CLIENT_PREFIX = 'JamClient'
|
||||
|
||||
PRODUCTS = ["#{CLIENT_PREFIX}/Win32", "#{CLIENT_PREFIX}/MacOSX"]
|
||||
PRODUCTS = ["#{CLIENT_PREFIX}/Win32", "#{CLIENT_PREFIX}/MacOSX", "#{CLIENT_PREFIX}/JamBlaster"]
|
||||
|
||||
self.primary_key = 'id'
|
||||
attr_accessible :version, :uri, :sha1, :environment, :product, as: :admin
|
||||
|
|
|
|||
|
|
@ -6,15 +6,24 @@ class ArtifactsController < ApiController
|
|||
def client_downloads
|
||||
clients = ArtifactUpdate.where("product like '%JamClient%' and environment = '#{ArtifactUpdate::DEFAULT_ENVIRONMENT}'").order(:product)
|
||||
|
||||
if params[:type]
|
||||
cliens = clients.where("product ilike 'JamClient/#{params[:type]}'")
|
||||
end
|
||||
|
||||
result = {}
|
||||
|
||||
clients.each do |client|
|
||||
url = client.determine_url
|
||||
result[client.product] = { :uri => url, :size => client.size }
|
||||
if params[:type]
|
||||
result[params[:type]] = { :uri => url, :size => client.size, :version => client.version, :md5 => client.sha1}
|
||||
else
|
||||
result[client.product] = { :uri => url, :size => client.size, :version => client.version, :md5 => client.sha1}
|
||||
end
|
||||
end
|
||||
render :json => result, :status => :ok
|
||||
end
|
||||
|
||||
|
||||
def healthcheck
|
||||
render :json => {}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -633,6 +633,7 @@ SampleApp::Application.routes.draw do
|
|||
|
||||
# list all uris for available clients on mac, windows, linux, if available
|
||||
match '/artifacts/clients' => 'artifacts#client_downloads'
|
||||
match '/artifacts/:type' => 'artifacts#client_downloads'
|
||||
|
||||
# crash logs
|
||||
match '/crashes' => 'api_users#crash_dump', :via => :put
|
||||
|
|
|
|||
Loading…
Reference in New Issue