You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/06/21 03:06:42 UTC

git commit: SLIDER-151 adding actions

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it 915320cda -> 6f5c5faf1


SLIDER-151 adding actions


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

Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it
Commit: 6f5c5faf140ea3fbb2cfe4f44ff1c27e1e635f32
Parents: 915320c
Author: Steve Loughran <st...@apache.org>
Authored: Fri Jun 20 16:08:08 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Jun 20 16:08:08 2014 -0700

----------------------------------------------------------------------
 .../web/rest/management/ManagementResource.java | 43 ++++++++++++++++++--
 1 file changed, 40 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6f5c5faf/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/management/ManagementResource.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/management/ManagementResource.java
index 02199cf..8a6b928 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/management/ManagementResource.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/management/ManagementResource.java
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.GET;
+import javax.ws.rs.*;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
@@ -46,6 +47,8 @@ import java.net.URL;
 public class ManagementResource extends AbstractSliderResource {
   protected static final Logger log =
       LoggerFactory.getLogger(ManagementResource.class);
+  public static final String CONFIG = "config";
+  public static final String APP_UNDER_MANAGEMENT = "/app";
 
   public ManagementResource(WebAppApi slider) {
     super(slider);
@@ -80,9 +83,9 @@ public class ManagementResource extends AbstractSliderResource {
   }
 
   @GET
-  @Path("/app/configurations/{config}")
+  @Path(APP_UNDER_MANAGEMENT+"/configurations/{config}")
   @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-  public ConfTreeResource getConfTreeResource(@PathParam("config") String config,
+  public ConfTreeResource getConfTreeResource(@PathParam(CONFIG) String config,
                                               @Context UriInfo uriInfo,
                                               @Context HttpServletResponse res) {
     init(res);
@@ -90,11 +93,45 @@ public class ManagementResource extends AbstractSliderResource {
         ResourceFactory.createAggregateConfResource(getAggregateConf(),
       uriInfo.getBaseUriBuilder()
       .path(RestPaths.SLIDER_CONTEXT_ROOT)
-      .path(RestPaths.MANAGEMENT + "/app"));
+      .path(RestPaths.MANAGEMENT + APP_UNDER_MANAGEMENT));
     return aggregateConf.getConfTree(config);
   }
 
   protected AggregateConf getAggregateConf() {
     return slider.getAppState().getInstanceDefinitionSnapshot();
   }
+  
+  @POST
+  @Path("actions/flex") 
+    public void actionFlex() { 
+  }
+  
+  @POST
+  @Path("actions/stop") 
+    public void actionStop() { 
+  }
+  
+    
+  @POST
+  @Path("actions/test/suicide") 
+    public void actionSuicide() { 
+  }
+    
+  @POST
+  @Path("actions/test/kill-container") 
+    public void actionKillContainer() { 
+  }
+
+
+  @GET
+  @Path("containers"+"/components" +"/{name}")
+  public void actionListContainers() {
+  }
+  
+  @GET
+  @Path("containers"+"/components" +"/{name}")
+  public void actionListContainersbyComponent() {
+  }
+
+
 }