[ARVADOS] updated: ab710b74b2751f9a0d4eb5c5f950c6bb04865e79
git at public.curoverse.com
git at public.curoverse.com
Tue May 20 13:54:24 EDT 2014
Summary of changes:
doc/api/methods/keep_services.html.textile.liquid | 9 +++++++++
.../app/controllers/arvados/v1/keep_services_controller.rb | 12 +++++++++++-
services/api/config/routes.rb | 4 +++-
3 files changed, 23 insertions(+), 2 deletions(-)
via ab710b74b2751f9a0d4eb5c5f950c6bb04865e79 (commit)
from 10bcbe8343f6f91f3c8e338a4a53766f7ba26ef1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ab710b74b2751f9a0d4eb5c5f950c6bb04865e79
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue May 20 13:54:21 2014 -0400
2776: Added 'accessable' route to 'keep_services'
diff --git a/doc/api/methods/keep_services.html.textile.liquid b/doc/api/methods/keep_services.html.textile.liquid
index 016e566..321dd15 100644
--- a/doc/api/methods/keep_services.html.textile.liquid
+++ b/doc/api/methods/keep_services.html.textile.liquid
@@ -12,6 +12,15 @@ API endpoint base: @https://{{ site.arvados_api_host }}/arvados/v1/keep_services
Required arguments are displayed in %{background:#ccffcc}green%.
+h2. accessable
+
+Get a list of keep services that are accessable to the requesting client. This
+is context-sensitive, for example providing the list of actual Keep servers
+when inside the cluster, but providing a proxy service if client contacts
+Arvados from outside the cluster.
+
+Takes no arguments.
+
h2. create
Create a new KeepService.
diff --git a/services/api/app/controllers/arvados/v1/keep_services_controller.rb b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
index 5c0375f..43ce94d 100644
--- a/services/api/app/controllers/arvados/v1/keep_services_controller.rb
+++ b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
@@ -1,9 +1,19 @@
class Arvados::V1::KeepServicesController < ApplicationController
def find_objects_for_index
- # all users can list all keep disks
+ # all users can list all keep services
@objects = model_class.where('1=1')
super
end
+ def accessable
+ if request.headers['X-Keep-Proxy-Required']
+ @objects = model_class.where('service_type=?', 'proxy')
+ else
+ @objects = model_class.where('service_type=?', 'disk')
+ end
+
+ render_list
+ end
+
end
diff --git a/services/api/config/routes.rb b/services/api/config/routes.rb
index d5ef141..c1549d0 100644
--- a/services/api/config/routes.rb
+++ b/services/api/config/routes.rb
@@ -27,7 +27,9 @@ Server::Application.routes.draw do
resources :keep_disks do
post 'ping', on: :collection
end
- resources :keep_services
+ resources :keep_services do
+ get 'accessable', on: :collection
+ end
resources :links
resources :logs
resources :nodes do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list