cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master-6-17-stable to 2abca44
Date Wed, 19 Jun 2013 21:09:05 GMT
Updated Branches:
  refs/heads/master-6-17-stable afd8645f9 -> 2abca44da


CLOUDSTACK-1405: add scope type in liststoragepoolcmd


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

Branch: refs/heads/master-6-17-stable
Commit: 2abca44da62af45b0071420903dc7b6bd467c0d8
Parents: afd8645
Author: Edison Su <sudison@gmail.com>
Authored: Wed Jun 19 14:08:12 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Jun 19 14:08:12 2013 -0700

----------------------------------------------------------------------
 .../api/command/admin/storage/ListStoragePoolsCmd.java  |  8 ++++++++
 server/src/com/cloud/api/query/QueryManagerImpl.java    | 12 ++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2abca44d/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
index 85a3c22..f33b987 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
@@ -64,6 +64,10 @@ public class ListStoragePoolsCmd extends BaseListCmd {
             description="the ID of the storage pool")
     private Long id;
 
+    @Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING, entityType = StoragePoolResponse.class,
+            description="the ID of the storage pool")
+    private String scope;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -115,4 +119,8 @@ public class ListStoragePoolsCmd extends BaseListCmd {
         response.setResponseName(getCommandName());
         this.setResponseObject(response);
     }
+
+    public String getScope() {
+        return scope;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2abca44d/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index ad29cda..c851e3b 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -55,6 +55,7 @@ import org.apache.cloudstack.api.command.user.volume.ListResourceDetailsCmd;
 import org.apache.cloudstack.api.command.user.volume.ListVolumesCmd;
 import org.apache.cloudstack.api.command.user.zone.ListZonesByCmd;
 import org.apache.cloudstack.api.response.*;
+import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 import org.apache.cloudstack.query.QueryService;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
@@ -1862,6 +1863,14 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
     }
 
     private Pair<List<StoragePoolJoinVO>, Integer> searchForStoragePoolsInternal(ListStoragePoolsCmd
cmd) {
+        ScopeType scopeType = null;
+        if (cmd.getScope() != null) {
+            try {
+                scopeType = Enum.valueOf(ScopeType.class, cmd.getScope().toUpperCase());
+            } catch (Exception e) {
+                throw new InvalidParameterValueException("Invalid scope type: " + cmd.getScope());
+            }
+        }
 
         Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(),
cmd.getZoneId());       
         Object id = cmd.getId();
@@ -1922,6 +1931,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         if (cluster != null) {
             sc.setParameters("clusterId", cluster);
         }
+        if (scopeType != null) {
+            sc.setParameters("scope", scopeType.toString());
+        }
 
         // search Pool details by ids
         Pair<List<StoragePoolJoinVO>, Integer> uniquePoolPair = _poolJoinDao.searchAndCount(sc,
searchFilter);


Mime
View raw message