brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [15/26] git commit: some notes on tidying the REST API
Date Fri, 29 Aug 2014 23:01:15 GMT
some notes on tidying the REST API


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/cbc103a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/cbc103a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/cbc103a3

Branch: refs/heads/master
Commit: cbc103a3b64cbcc7bcc9530cdd1914606e5b2520
Parents: 97eed6b
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Wed Aug 27 02:16:18 2014 -0400
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Wed Aug 27 02:17:18 2014 -0400

----------------------------------------------------------------------
 usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java   | 3 ++-
 usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java     | 1 +
 .../rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cbc103a3/usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java b/usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java
index c2ec68e..812ae2f 100644
--- a/usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java
+++ b/usage/rest-api/src/main/java/brooklyn/rest/api/EffectorApi.java
@@ -79,7 +79,8 @@ public interface EffectorApi {
       @QueryParam("timeout")
       String timeout,
       
-      @ApiParam(name = "parameters", value = "Effector parameters (as key value pairs)",
required = false)
+      @ApiParam(/* FIXME: giving a `name` in swagger @ApiParam seems wrong as this object
is the body, not a named argument */ name = "parameters",
+          value = "Effector parameters (as key value pairs)", required = false)
       @Valid 
       Map<String, Object> parameters
   ) ;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cbc103a3/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java b/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java
index 6f66965..7154ca5 100644
--- a/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java
+++ b/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyApi.java
@@ -57,6 +57,7 @@ public interface PolicyApi {
   @GET
   @Path("/current-state")
   @ApiOperation(value = "Fetch policy states in batch", notes="Returns a map of policy ID
to whether it is active")
+  // FIXME method name -- this is nothing to do with config!
   public Map<String, Boolean> batchConfigRead(
       @ApiParam(value = "Application ID or name", required = true)
       @PathParam("application") String application,

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cbc103a3/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java b/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java
index 1c53598..cfd6670 100644
--- a/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java
+++ b/usage/rest-api/src/main/java/brooklyn/rest/api/PolicyConfigApi.java
@@ -82,6 +82,9 @@ public interface PolicyConfigApi {
       @ApiParam(value = "Config key ID", required = true)
       @PathParam("config") String configKeyName
   ) ;
+  
+  // TODO support a POST directly to /{config} where the body is the value, useful e.g. when
it's a map
+  // TODO and deprecate the /set endpoint item below
 
   @POST
   @Path("/{config}/set")


Mime
View raw message