From 49e18f8c16bda6b6bf56c301b440c9d56d9bcb72 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 20 Sep 2018 13:55:19 -0400 Subject: [PATCH] 10865: Update documentation, replace disable_api_methods with enable_legacy_jobs_api Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../install-api-server.html.textile.liquid | 39 +++++-------------- .../config/initializers/legacy_jobs_api.rb | 4 +- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/doc/install/install-api-server.html.textile.liquid b/doc/install/install-api-server.html.textile.liquid index a25942fe24..a6b843b160 100644 --- a/doc/install/install-api-server.html.textile.liquid +++ b/doc/install/install-api-server.html.textile.liquid @@ -158,39 +158,18 @@ Example @application.yml@: -h3(#disable_api_methods). disable_api_methods +h3(#enable_legacy_jobs_api). enable_legacy_jobs_api -Set the @disable_api_methods@ configuration option to disable the deprecated @jobs@ API. This will prevent users from accidentally submitting jobs that won't run. "All new installations should use the containers API.":crunch2-slurm/install-prerequisites.html +Enable the legacy "Jobs API":install-crunch-dispatch.html . Note: new installations should use the "Containers API":crunch2-slurm/install-prerequisites.html + +Disabling the jobs API means methods involving @jobs@, @job_tasks@, @pipeline_templates@ and @pipeline_instances@ are disabled. This functionality is superceded by the containers API which consists of @container_requests@, @containers@ and @workflows@. Arvados clients (such as @arvados-cwl-runner@) detect which APIs are available and adjust behavior accordingly. + +* auto -- (default) enable the Jobs API only if it has been used before (i.e., there are job records in the database), otherwise disable jobs API . +* true -- enable the Jobs API even if there are no existing job records. +* false -- disable the Jobs API even in the presence of existing job records. -

-  disable_api_methods:
-    - jobs.create
-    - pipeline_instances.create
-    - pipeline_templates.create
-    - jobs.get
-    - pipeline_instances.get
-    - pipeline_templates.get
-    - jobs.list
-    - pipeline_instances.list
-    - pipeline_templates.list
-    - jobs.index
-    - pipeline_instances.index
-    - pipeline_templates.index
-    - jobs.update
-    - pipeline_instances.update
-    - pipeline_templates.update
-    - jobs.queue
-    - jobs.queue_size
-    - job_tasks.create
-    - job_tasks.get
-    - job_tasks.list
-    - job_tasks.index
-    - job_tasks.update
-    - jobs.show
-    - pipeline_instances.show
-    - pipeline_templates.show
-    - job_tasks.show
+
  enable_legacy_jobs_api: auto
 
diff --git a/services/api/config/initializers/legacy_jobs_api.rb b/services/api/config/initializers/legacy_jobs_api.rb index ae98a3d130..9ea6b28843 100644 --- a/services/api/config/initializers/legacy_jobs_api.rb +++ b/services/api/config/initializers/legacy_jobs_api.rb @@ -10,5 +10,7 @@ require_relative 'load_config.rb' require 'enable_jobs_api' Server::Application.configure do - check_enable_legacy_jobs_api + if ActiveRecord::Base.connection.tables.include?('jobs') + check_enable_legacy_jobs_api + end end -- 2.30.2