cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to 871e3bb
Date Thu, 01 Aug 2013 08:52:49 GMT
Updated Branches:
  refs/heads/master c713aef04 -> 871e3bb27


CLOUDSTACK-3981. ListAccounts always sets 'networkTotal' to 0.
Add vpc resource count to the response. And set the right values for network resource count.


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

Branch: refs/heads/master
Commit: 871e3bb27935c9b7a9c11db418566a596f67e085
Parents: c713aef
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Thu Aug 1 14:10:17 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Thu Aug 1 14:18:33 2013 +0530

----------------------------------------------------------------------
 .../api/response/AccountResponse.java           | 20 ++++++++++++++++--
 .../api/response/ProjectResponse.java           | 22 +++++++++++++++++---
 .../response/ResourceLimitAndCountResponse.java |  6 ++++++
 .../cloud/api/query/dao/AccountJoinDaoImpl.java |  6 +++---
 4 files changed, 46 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/871e3bb2/api/src/org/apache/cloudstack/api/response/AccountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/org/apache/cloudstack/api/response/AccountResponse.java
index 0d4f239..957936b 100644
--- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
 import java.util.List;
 import java.util.Map;
 
+import com.google.gson.annotations.SerializedName;
+
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.serializer.Param;
 import com.cloud.user.Account;
-import com.google.gson.annotations.SerializedName;
 
 @SuppressWarnings("unused")
 @EntityReference(value = Account.class)
@@ -189,7 +190,7 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
 
     @Override
     public String getObjectId() {
-        return this.id;
+        return id;
     }
 
     public void setId(String id) {
@@ -351,8 +352,23 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
     public void setNetworkAvailable(String networkAvailable) {
         this.networkAvailable = networkAvailable;
     }
+
+    @Override
+    public void setVpcLimit(String vpcLimit) {
+        this.vpcLimit = networkLimit;
+    }
+
+    @Override
+    public void setVpcTotal(Long vpcTotal) {
+        this.vpcTotal = vpcTotal;
+    }
     
     @Override
+    public void setVpcAvailable(String vpcAvailable) {
+        this.vpcAvailable = vpcAvailable;
+    }
+
+    @Override
     public void setCpuLimit(String cpuLimit) {
         this.cpuLimit = cpuLimit;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/871e3bb2/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ProjectResponse.java b/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
index 4fdd137..81b51c8 100644
--- a/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.google.gson.annotations.SerializedName;
+
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.projects.Project;
 import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
 
 @EntityReference(value=Project.class)
 @SuppressWarnings("unused")
@@ -182,7 +183,7 @@ public class ProjectResponse extends BaseResponse implements ResourceLimitAndCou
     }
 
     public void setOwner(String owner) {
-        this.ownerName = owner;
+        ownerName = owner;
     }
 
     public void setState(String state) {
@@ -194,7 +195,7 @@ public class ProjectResponse extends BaseResponse implements ResourceLimitAndCou
     }
 
     public void addTag(ResourceTagResponse tag){
-        this.tags.add(tag);
+        tags.add(tag);
     }
     
     @Override
@@ -296,8 +297,23 @@ public class ProjectResponse extends BaseResponse implements ResourceLimitAndCou
     public void setNetworkAvailable(String networkAvailable) {
         this.networkAvailable = networkAvailable;
     }
+
+    @Override
+    public void setVpcLimit(String vpcLimit) {
+        this.vpcLimit = networkLimit;
+    }
+
+    @Override
+    public void setVpcTotal(Long vpcTotal) {
+        this.vpcTotal = vpcTotal;
+    }
     
     @Override
+    public void setVpcAvailable(String vpcAvailable) {
+        this.vpcAvailable = vpcAvailable;
+    }
+
+    @Override
     public void setCpuLimit(String cpuLimit) {
         this.cpuLimit = cpuLimit;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/871e3bb2/api/src/org/apache/cloudstack/api/response/ResourceLimitAndCountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceLimitAndCountResponse.java
b/api/src/org/apache/cloudstack/api/response/ResourceLimitAndCountResponse.java
index 57aabdd..49bb4e0 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceLimitAndCountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceLimitAndCountResponse.java
@@ -29,6 +29,12 @@ public interface ResourceLimitAndCountResponse {
 
     public void setNetworkAvailable(String networkAvailable);
 
+    public void setVpcLimit(String vpcLimit);
+
+    public void setVpcTotal(Long vpcTotal);
+
+    public void setVpcAvailable(String vpcAvailable);
+
     public void setCpuLimit(String cpuLimit);
 
     public void setCpuTotal(Long cpuTotal);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/871e3bb2/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
index d83e60a..edbd3ae 100644
--- a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java
@@ -173,9 +173,9 @@ public class AccountJoinDaoImpl extends GenericDaoBase<AccountJoinVO,
Long> impl
         String vpcLimitDisplay = (accountIsAdmin || vpcLimit == -1) ? "Unlimited" : String.valueOf(vpcLimit);
         long vpcTotal = (account.getVpcTotal() == null) ? 0 : account.getVpcTotal();
         String vpcAvail = (accountIsAdmin || vpcLimit == -1) ? "Unlimited" : String.valueOf(vpcLimit
- vpcTotal);
-        response.setNetworkLimit(vpcLimitDisplay);
-        response.setNetworkTotal(vpcTotal);
-        response.setNetworkAvailable(vpcAvail);
+        response.setVpcLimit(vpcLimitDisplay);
+        response.setVpcTotal(vpcTotal);
+        response.setVpcAvailable(vpcAvail);
 
         //get resource limits for cpu cores
         long cpuLimit = ApiDBUtils.findCorrectResourceLimit(account.getCpuLimit(), account.getType(),
ResourceType.cpu);


Mime
View raw message