X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8051c3a14d40f0d410e4ddf54d89a084475d807e..47e59a35d5ed9b2cdb052894d741972324058505:/services/api/app/controllers/arvados/v1/schema_controller.rb diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb index 61ad02bf4a..d4be3c8093 100644 --- a/services/api/app/controllers/arvados/v1/schema_controller.rb +++ b/services/api/app/controllers/arvados/v1/schema_controller.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class Arvados::V1::SchemaController < ApplicationController skip_before_filter :catch_redirect_hint skip_before_filter :find_objects_for_index @@ -13,7 +17,13 @@ class Arvados::V1::SchemaController < ApplicationController def index expires_in 24.hours, public: true - discovery = Rails.cache.fetch 'arvados_v1_rest_discovery' do + send_json discovery_doc + end + + protected + + def discovery_doc + Rails.cache.fetch 'arvados_v1_rest_discovery' do Rails.application.eager_load! discovery = { kind: "discovery#restDescription", @@ -45,7 +55,19 @@ class Arvados::V1::SchemaController < ApplicationController crunchLogThrottleLines: Rails.application.config.crunch_log_throttle_lines, crunchLimitLogBytesPerJob: Rails.application.config.crunch_limit_log_bytes_per_job, crunchLogPartialLineThrottlePeriod: Rails.application.config.crunch_log_partial_line_throttle_period, + remoteHosts: Rails.configuration.remote_hosts, + remoteHostsViaDNS: Rails.configuration.remote_hosts_via_dns, websocketUrl: Rails.application.config.websocket_address, + workbenchUrl: Rails.application.config.workbench_address, + keepWebServiceUrl: Rails.application.config.keep_web_service_url, + gitUrl: case Rails.application.config.git_repo_https_base + when false + '' + when true + 'https://git.%s.arvadosapi.com/' % Rails.configuration.uuid_prefix + else + Rails.application.config.git_repo_https_base + end, parameters: { alt: { type: "string", @@ -375,6 +397,5 @@ class Arvados::V1::SchemaController < ApplicationController end discovery end - send_json discovery end end