You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2014/12/10 10:38:38 UTC

[1/5] stratos git commit: Removed create and update of deployment policy

Repository: stratos
Updated Branches:
  refs/heads/4.1.0-test 0844105cd -> 0e689fcd1


Removed create and update of deployment policy


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/31d49914
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/31d49914
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/31d49914

Branch: refs/heads/4.1.0-test
Commit: 31d499141582268adeda4572c269bc718ff6fb6f
Parents: 0e54055
Author: Shiro <sh...@wso2.com>
Authored: Wed Dec 10 13:20:08 2014 +0530
Committer: Shiro <sh...@wso2.com>
Committed: Wed Dec 10 13:22:08 2014 +0530

----------------------------------------------------------------------
 .../rest/endpoint/api/StratosApiV41.java        | 38 -------------
 .../rest/endpoint/api/StratosApiV41Utils.java   | 60 --------------------
 2 files changed, 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/31d49914/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 93c2460..9f055f2 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -355,44 +355,6 @@ public class StratosApiV41 extends AbstractApi {
     }
     
     // API methods for deployment policies
-    
-    /**
-     * Creates the deployment policy.
-     *
-     * @param deploymentPolicy the deployment policy
-     * @return the response
-     * @throws RestAPIException the rest api exception
-     */
-    @POST
-    @Path("/deploymentPolicies")
-    @Produces("application/json")
-    @Consumes("application/json")
-    @AuthorizationAction("/permission/admin/manage/add/deploymentPolicy")
-    public Response createDeploymentPolicyDefinition(DeploymentPolicy deploymentPolicy)
-            throws RestAPIException {
-        String policyId = StratosApiV41Utils.createDeploymentPolicy(deploymentPolicy);
-        //URI url = uriInfo.getAbsolutePathBuilder().path(policyId).build();
-        return Response.accepted().build();
-    }
-    
-    /**
-     * Update deployment policy definition.
-     *
-     * @param deploymentPolicy the deployment policy
-     * @return the response
-     * @throws RestAPIException the rest api exception
-     */
-    @PUT
-    @Path("/deploymentPolicies")
-    @Produces("application/json")
-    @Consumes("application/json")
-    @AuthorizationAction("/permission/admin/manage/add/deploymentPolicy")
-    public Response updateDeploymentPolicyDefinition(DeploymentPolicy deploymentPolicy)
-            throws RestAPIException {
-
-        StratosApiV41Utils.updateDeploymentPolicy(deploymentPolicy);
-        return Response.ok().build();
-    }
 
     /**
      * Gets the deployment policies.

http://git-wip-us.apache.org/repos/asf/stratos/blob/31d49914/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 90dc62b..2698621 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -610,66 +610,6 @@ public class StratosApiV41Utils {
     
     // Util methods for Deployment policies
     
-    public static String createDeploymentPolicy(
-    		org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
-    	            throws RestAPIException {
-    	String policyId = null;
-
-        if (log.isDebugEnabled()) {
-            log.debug("Starting to create a deployment policy of application: "
-                    + deploymentPolicyBean.applicationPolicy.applicationId);
-        }
-        
-        AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient();
-        if (autoscalerServiceClient != null) {
-
-            org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy deploymentPolicy =
-                    PojoConverter.convetToASDeploymentPolicyPojo(deploymentPolicyBean);
-
-            try {
-                policyId = autoscalerServiceClient.addDeploymentPolicy(deploymentPolicy);
-            } catch (RemoteException e) {
-                log.error(e.getMessage(), e);
-                throw new RestAPIException(e.getMessage(), e);
-            } catch (AutoScalerServiceInvalidPolicyExceptionException e) {
-                String message = e.getFaultMessage().getInvalidPolicyException().getMessage();
-                log.error(message, e);
-                throw new RestAPIException(message, e);
-            }
-
-            log.info(String.format("Created deployment policy: [id] %s", policyId));
-        }
-        
-        return policyId;
-    }
-    
-    public static void updateDeploymentPolicy(
-            org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean)
-            throws RestAPIException {
-
-        //FIXME we do not have any use-case now?? - Nirmal
-//        log.info(String.format("Updating deployment policy: [id] %s", deploymentPolicyBean.id));
-//
-//        AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient();
-//        if (autoscalerServiceClient != null) {
-//
-//            org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy deploymentPolicy =
-//                    PojoConverter.convetToASDeploymentPolicyPojo(deploymentPolicyBean);
-//
-//
-//            try {
-//                autoscalerServiceClient.updateDeploymentPolicy(deploymentPolicy);
-//            } catch (RemoteException e) {
-//                log.error(e.getMessage(), e);
-//                throw new RestAPIException(e.getMessage(), e);
-//            } catch (AutoScalerServiceInvalidPolicyExceptionException e) {
-//                String message = e.getFaultMessage().getInvalidPolicyException().getMessage();
-//                log.error(message, e);
-//                throw new RestAPIException(message, e);
-//            }
-//        }
-    }
-
     public static org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy[]
     getDeploymentPolicies() throws RestAPIException {
 


[5/5] stratos git commit: This closes #146

Posted by re...@apache.org.
  This closes #146

Merge branch 'api-test-bugfix' of https://github.com/shirolk/stratos into 4.1.0-test


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0e689fcd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0e689fcd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0e689fcd

Branch: refs/heads/4.1.0-test
Commit: 0e689fcd1906a129ab38d02676c7beed843d95f4
Parents: 0844105 effca0c
Author: reka <rt...@gmail.com>
Authored: Wed Dec 10 15:07:33 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Wed Dec 10 15:07:33 2014 +0530

----------------------------------------------------------------------
 .../rest/endpoint/api/StratosApiV41.java        | 54 ++----------
 .../rest/endpoint/api/StratosApiV41Utils.java   | 87 ++------------------
 2 files changed, 15 insertions(+), 126 deletions(-)
----------------------------------------------------------------------



[3/5] stratos git commit: Removed unused imports

Posted by re...@apache.org.
Removed unused imports


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3111bbb9
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3111bbb9
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3111bbb9

Branch: refs/heads/4.1.0-test
Commit: 3111bbb91fe61c4cef4af85e5d00a30100efe903
Parents: 3d66f88
Author: Shiro <sh...@wso2.com>
Authored: Wed Dec 10 13:34:14 2014 +0530
Committer: Shiro <sh...@wso2.com>
Committed: Wed Dec 10 13:34:14 2014 +0530

----------------------------------------------------------------------
 .../stratos/rest/endpoint/api/StratosApiV41Utils.java  | 13 -------------
 1 file changed, 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3111bbb9/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 08ebd2b..3dc0130 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -36,18 +36,14 @@ import org.apache.stratos.manager.deploy.cartridge.CartridgeDeploymentManager;
 import org.apache.stratos.manager.deploy.service.Service;
 import org.apache.stratos.manager.deploy.service.ServiceDeploymentManager;
 import org.apache.stratos.manager.dto.Cartridge;
-import org.apache.stratos.manager.dto.SubscriptionInfo;
 import org.apache.stratos.manager.exception.*;
 import org.apache.stratos.manager.grouping.definitions.ServiceGroupDefinition;
 import org.apache.stratos.manager.grouping.manager.ServiceGroupingManager;
 import org.apache.stratos.manager.manager.CartridgeSubscriptionManager;
-import org.apache.stratos.manager.persistence.PersistenceManager;
-import org.apache.stratos.manager.persistence.RegistryBasedPersistenceManager;
 import org.apache.stratos.manager.repository.RepositoryNotification;
 import org.apache.stratos.manager.subscription.ApplicationSubscription;
 import org.apache.stratos.manager.subscription.CartridgeSubscription;
 import org.apache.stratos.manager.subscription.DataCartridgeSubscription;
-import org.apache.stratos.manager.subscription.SubscriptionData;
 import org.apache.stratos.manager.topology.model.TopologyClusterInformationModel;
 import org.apache.stratos.manager.utils.ApplicationManagementUtil;
 import org.apache.stratos.manager.utils.CartridgeConstants;
@@ -56,30 +52,21 @@ import org.apache.stratos.messaging.domain.applications.ClusterDataHolder;
 import org.apache.stratos.messaging.domain.applications.Group;
 import org.apache.stratos.messaging.domain.topology.Cluster;
 import org.apache.stratos.messaging.domain.topology.Member;
-import org.apache.stratos.messaging.domain.topology.MemberStatus;
 import org.apache.stratos.messaging.message.receiver.applications.ApplicationManager;
 import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 import org.apache.stratos.rest.endpoint.bean.ApplicationBean;
-import org.apache.stratos.rest.endpoint.bean.CartridgeInfoBean;
 import org.apache.stratos.rest.endpoint.bean.GroupBean;
-import org.apache.stratos.rest.endpoint.bean.SubscriptionDomainRequest;
 import org.apache.stratos.rest.endpoint.bean.autoscaler.partition.ApplicationLevelNetworkPartition;
 import org.apache.stratos.rest.endpoint.bean.autoscaler.policy.autoscale.AutoscalePolicy;
 import org.apache.stratos.rest.endpoint.bean.cartridge.definition.CartridgeDefinitionBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PersistenceBean;
 import org.apache.stratos.rest.endpoint.bean.cartridge.definition.PropertyBean;
-import org.apache.stratos.rest.endpoint.bean.cartridge.definition.ServiceDefinitionBean;
 import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesGroup;
 import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesHost;
 import org.apache.stratos.rest.endpoint.bean.kubernetes.KubernetesMaster;
 import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payload;
-import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
 import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
 import org.apache.stratos.rest.endpoint.exception.RestAPIException;
 
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
 import java.rmi.RemoteException;
 import java.util.*;
 import java.util.regex.Pattern;


[4/5] stratos git commit: minor change

Posted by re...@apache.org.
minor change


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

Branch: refs/heads/4.1.0-test
Commit: effca0c557c13cc5c78be0e85c2e61e2d4b55665
Parents: 3111bbb
Author: Shiro <sh...@wso2.com>
Authored: Wed Dec 10 14:45:26 2014 +0530
Committer: Shiro <sh...@wso2.com>
Committed: Wed Dec 10 14:45:26 2014 +0530

----------------------------------------------------------------------
 .../java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/effca0c5/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 3f839aa..32f83c1 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -613,11 +613,11 @@ public class StratosApiV41 extends AbstractApi {
      * @throws RestAPIException the rest api exception
      */
     @GET
-    @Path("/subscriptions/cartridges/groups/{serviceGroup}")
+    @Path("/subscriptions/cartridges/groups/{serviceGroupId}")
     @Produces("application/json")
     @Consumes("application/json")
     @AuthorizationAction("/permission/admin/manage/view/cartridge")
-    public Response getSubscribedCartridgesForServiceGroup(@PathParam("serviceGroup") String serviceGroup) throws RestAPIException {
+    public Response getSubscribedCartridgesForServiceGroup(@PathParam("serviceGroupId") String serviceGroup) throws RestAPIException {
         List<Cartridge> cartridgeList = StratosApiV41Utils.getSubscriptions(null, serviceGroup, getConfigContext());
         // Following is very important when working with axis2
         ResponseBuilder rb = Response.ok();


[2/5] stratos git commit: Renamed category to filter in cartridge filter methods

Posted by re...@apache.org.
Renamed category to filter in cartridge filter methods


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3d66f88d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3d66f88d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3d66f88d

Branch: refs/heads/4.1.0-test
Commit: 3d66f88dbae55403d2b85e8d5f9f371ace5e54e2
Parents: 31d4991
Author: Shiro <sh...@wso2.com>
Authored: Wed Dec 10 13:30:39 2014 +0530
Committer: Shiro <sh...@wso2.com>
Committed: Wed Dec 10 13:30:39 2014 +0530

----------------------------------------------------------------------
 .../stratos/rest/endpoint/api/StratosApiV41.java      | 12 ++++++------
 .../stratos/rest/endpoint/api/StratosApiV41Utils.java | 14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3d66f88d/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 9f055f2..3f839aa 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -177,12 +177,12 @@ public class StratosApiV41 extends AbstractApi {
      * @throws RestAPIException the rest api exception
      */
     @GET
-    @Path("/cartridges/{category}")
+    @Path("/cartridges/{filter}")
     @Produces("application/json")
     @Consumes("application/json")
     @AuthorizationAction("/permission/admin/manage/view/cartridge")
-    public Response getCartridgesByCategory(@DefaultValue("") @PathParam("category") String category, @QueryParam("criteria") String criteria) throws RestAPIException {
-        List<Cartridge> cartridges = StratosApiV41Utils.getCartridgesByCategory(category, criteria, getConfigContext());
+    public Response getCartridgesByFilter(@DefaultValue("") @PathParam("filter") String filter, @QueryParam("criteria") String criteria) throws RestAPIException {
+        List<Cartridge> cartridges = StratosApiV41Utils.getCartridgesByFilter(filter, criteria, getConfigContext());
         ResponseBuilder rb = Response.ok();
         rb.entity(cartridges.isEmpty() ? new Cartridge[0] : cartridges.toArray(new Cartridge[cartridges.size()]));
         return rb.build();
@@ -197,12 +197,12 @@ public class StratosApiV41 extends AbstractApi {
      * @throws RestAPIException the rest api exception
      */
     @GET
-    @Path("/cartridges/{category}/{cartridgeType}")
+    @Path("/cartridges/{filter}/{cartridgeType}")
     @Produces("application/json")
     @Consumes("application/json")
     @AuthorizationAction("/permission/admin/manage/view/cartridge")
-    public Response getCartridgeByCategory(@DefaultValue("") @PathParam("category") String category, @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
-        Cartridge cartridge = StratosApiV41Utils.getCartridgeByCategory(category, cartridgeType, getConfigContext());
+    public Response getCartridgeByFilter(@DefaultValue("") @PathParam("filter") String filter, @PathParam("cartridgeType") String cartridgeType) throws RestAPIException {
+        Cartridge cartridge = StratosApiV41Utils.getCartridgeByFilter(filter, cartridgeType, getConfigContext());
         ResponseBuilder rb = Response.ok();
         rb.entity(cartridge);
         return rb.build();

http://git-wip-us.apache.org/repos/asf/stratos/blob/3d66f88d/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 2698621..08ebd2b 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -194,26 +194,26 @@ public class StratosApiV41Utils {
         }
     }
     
-    public static List<Cartridge> getCartridgesByCategory(String category, String criteria, ConfigurationContext configurationContext) 
+    public static List<Cartridge> getCartridgesByFilter(String filter, String criteria, ConfigurationContext configurationContext) 
 			throws RestAPIException {
 		List<Cartridge> cartridges = null;
 		
-		if (category.equals("singleTenant")) {
+		if (filter.equals("singleTenant")) {
 			cartridges = getAvailableCartridges(null, false, configurationContext);
-		} else if (category.equals("multiTenant")) {
+		} else if (filter.equals("multiTenant")) {
 			cartridges = getAvailableCartridges(null, true, configurationContext);
-		} else if (category.equals("loadBalancer")) {
+		} else if (filter.equals("loadBalancer")) {
 			cartridges = getAvailableLbCartridges(false, configurationContext);
-		} else if (category.equals("provider")) {
+		} else if (filter.equals("provider")) {
 			cartridges = getAvailableCartridgesByProvider(criteria, configurationContext);
 		}
 		
 		return cartridges;
 	}
 	
-	public static Cartridge getCartridgeByCategory(String category, String cartridgeType, ConfigurationContext configurationContext) 
+	public static Cartridge getCartridgeByFilter(String filter, String cartridgeType, ConfigurationContext configurationContext) 
 	throws RestAPIException {
-		List<Cartridge> cartridges = getCartridgesByCategory(category, null, configurationContext);
+		List<Cartridge> cartridges = getCartridgesByFilter(filter, null, configurationContext);
 		
 		for (Cartridge cartridge : cartridges) {
 			if (cartridge.getCartridgeType().equals(cartridgeType)) {