You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/10/08 16:23:52 UTC

[PATCH core] Core: Expand API features in entrypoint

From: Michal Fojtik <mf...@redhat.com>

* Added :rel attribute to describe what operation given feature extend
* Added list of params, so clients can discover them

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/views/api/show.xml.haml |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/server/views/api/show.xml.haml b/server/views/api/show.xml.haml
index c9d970e..f21f69b 100644
--- a/server/views/api/show.xml.haml
+++ b/server/views/api/show.xml.haml
@@ -2,6 +2,9 @@
   - @collections.each do |c|
     %link{ :rel => c.collection_name, :href => self.send(:"#{c.collection_name}_url")}
       - c.features.select { |f| driver.class.has_feature?(c.collection_name, f.name) }.each do |f|
-        %feature{ :name => f.name }
-          - driver.class.constraints(:collection => c.collection_name, :feature => f.name).each do |name, value|
-            %constraint{ :name => name }=value
+        - f.operations.each do |operation|
+          %feature{ :name => f.name, :rel => operation.name }
+            - operation.params_array.each do |param|
+              %param{ :name => param.name}
+            - driver.class.constraints(:collection => c.collection_name, :feature => f.name).each do |name, value|
+              %constraint{ :name => name }=value
-- 
1.7.10.2