1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 Disable_jobs_api_method_list = ["jobs.create",
6 "pipeline_instances.create",
7 "pipeline_templates.create",
9 "pipeline_instances.get",
10 "pipeline_templates.get",
12 "pipeline_instances.list",
13 "pipeline_templates.list",
15 "pipeline_instances.index",
16 "pipeline_templates.index",
18 "pipeline_instances.update",
19 "pipeline_templates.update",
28 "pipeline_instances.show",
29 "pipeline_templates.show",
33 def check_enable_legacy_jobs_api
34 if Rails.configuration.enable_legacy_jobs_api == false ||
35 (Rails.configuration.enable_legacy_jobs_api == "auto" &&
36 ActiveRecord::Base.connection.exec_query("select count(*) from jobs").first["count"] == "0")
37 Rails.configuration.disable_api_methods = Disable_jobs_api_method_list