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 <[email protected]> Authored: Wed Dec 10 13:20:08 2014 +0530 Committer: Shiro <[email protected]> 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 {
