Fixed CLI command for activate-tenant

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

Branch: refs/heads/4.1.0-beta-deployment-policy-fix
Commit: c2d41eecb14d5fa896d57d0323aaf8410e7d6dca
Parents: 2916f87
Author: Dinithi <[email protected]>
Authored: Thu Feb 19 13:23:35 2015 +0530
Committer: Imesh Gunaratne <[email protected]>
Committed: Thu Feb 19 14:13:33 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/stratos/cli/RestCommandLineService.java    | 6 +++---
 .../org/apache/stratos/rest/endpoint/api/StratosApiV41.java    | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c2d41eec/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index ff22e12..c48cc83 100644
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -592,8 +592,8 @@ public class RestCommandLineService {
     public void activateTenant(String tenantDomain) throws CommandException {
         DefaultHttpClient httpClient = new DefaultHttpClient();
         try {
-            HttpResponse response = restClient.doPost(httpClient, 
restClient.getBaseURL()
-                    + ENDPOINT_ACTIVATE_TENANT + "/" + tenantDomain, "");
+            HttpResponse response = restClient.doPut(httpClient, 
restClient.getBaseURL()
+                    + ENDPOINT_ACTIVATE_TENANT .replace("{tenantDomain}", 
tenantDomain), "");
 
             String responseCode = "" + 
response.getStatusLine().getStatusCode();
 
@@ -601,7 +601,7 @@ public class RestCommandLineService {
             Gson gson = gsonBuilder.create();
 
             if (responseCode.equals(CliConstants.RESPONSE_OK)) {
-                System.out.println("You have succesfully activated " + 
tenantDomain + " tenant");
+                System.out.println("You have successfully activated " + 
tenantDomain + " tenant");
                 return;
             } else {
                 String resultString = CliUtils.getHttpResponseString(response);

http://git-wip-us.apache.org/repos/asf/stratos/blob/c2d41eec/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 91d63fd..8e70bad 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
@@ -1397,6 +1397,7 @@ public class StratosApiV41 extends AbstractApi {
     @PUT
     @Path("/tenants/activate/{tenantDomain}")
     @Consumes("application/json")
+    @Produces("application/json")
     @AuthorizationAction("/permission/protected/manage/activateTenant")
     @SuperTenantService(true)
     public Response activateTenant(@PathParam("tenantDomain") String 
tenantDomain) throws RestAPIException {

Reply via email to