cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to 48b82a6
Date Wed, 24 Apr 2013 23:36:49 GMT
Updated Branches:
  refs/heads/master 8f5d8d505 -> 48b82a6f9


CLOUDSTACK-2120: mixed zone management - (1) extend listStoragePools API to to take in zonetype.
(2) UI: populate Primary Storages list page with ones whose zonetype matches selected option
in zone type dropdown on top menu.


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

Branch: refs/heads/master
Commit: 48b82a6f91d9ef762a2a301d408ba72bc50a922a
Parents: 8f5d8d5
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed Apr 24 16:36:07 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Apr 24 16:36:07 2013 -0700

----------------------------------------------------------------------
 .../command/admin/storage/ListStoragePoolsCmd.java |    7 +++
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    5 ++
 ui/scripts/system.js                               |   33 ++++++++-------
 3 files changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48b82a6f/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 02b9803..17adb18 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
@@ -60,6 +60,9 @@ public class ListStoragePoolsCmd extends BaseListCmd {
             description="the Zone ID for the storage pool")
     private Long zoneId;
 
+    @Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network
type of the zone that the virtual machine belongs to")
+    private String zoneType;
+    
     @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class,
             description="the ID of the storage pool")
     private Long id;
@@ -92,6 +95,10 @@ public class ListStoragePoolsCmd extends BaseListCmd {
         return zoneId;
     }
 
+    public String getZoneType() {
+        return zoneType;
+    }
+    
     public Long getId() {
         return id;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48b82a6f/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 ea260c3..6690b24 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -1859,6 +1859,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
     private Pair<List<StoragePoolJoinVO>, Integer> searchForStoragePoolsInternal(ListStoragePoolsCmd
cmd) {
 
         Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(),
cmd.getZoneId());
+        String zoneType = cmd.getZoneType();
         Object id = cmd.getId();
         Object name = cmd.getStoragePoolName();
         Object path = cmd.getPath();
@@ -1878,6 +1879,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
         sb.and("path", sb.entity().getPath(), SearchCriteria.Op.EQ);
         sb.and("dataCenterId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
+        sb.and("dataCenterType", sb.entity().getZoneType(), SearchCriteria.Op.EQ);
         sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ);
         sb.and("clusterId", sb.entity().getClusterId(), SearchCriteria.Op.EQ);
         sb.and("hostAddress", sb.entity().getHostAddress(), SearchCriteria.Op.EQ);
@@ -1908,6 +1910,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         if (zoneId != null) {
             sc.setParameters("dataCenterId", zoneId);
         }
+        if (zoneType != null) {
+        	sc.setParameters("dataCenterType", zoneType);
+        }
         if (pod != null) {
             sc.setParameters("podId", pod);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48b82a6f/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 50dd66d..8f07ee4 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -258,24 +258,15 @@
           primaryStorageCount: function(data) {
             $.ajax({
               url: createURL('listStoragePools'),
-							data: {
-							  page: 1,
-								pagesize: 1  //specifying pagesize as 1 because we don't need any embedded objects
to be returned here. The only thing we need from API response is "count" property.
-							},
+	      data: {
+		page: 1,
+		pagesize: 1  //specifying pagesize as 1 because we don't need any embedded objects to be
returned here. The only thing we need from API response is "count" property.
+	      },
               success: function(json) {                
-								dataFns.secondaryStorageCount($.extend(data, {
+		dataFns.secondaryStorageCount($.extend(data, {
                   primaryStorageCount: json.liststoragepoolsresponse.count ?
                     json.liststoragepoolsresponse.count : 0
-                }));
-																
-								//comment the 4 lines above and uncomment the following 4 lines if listHosts API
still responds slowly.
-								
-								/*
-								dataFns.systemVmCount($.extend(data, {
-                  primaryStorageCount: json.liststoragepoolsresponse.count ?
-                    json.liststoragepoolsresponse.count : 0
-                }));
-								*/
+                }));		
               }
             });
           },
@@ -5585,9 +5576,19 @@
                   var searchByArgs = args.filterBy.search.value.length ?
                     '&name=' + args.filterBy.search.value : '';
 
+                  var data = { 
+                    page: args.page, 
+                    pageSize: pageSize, 
+                    listAll: true 
+                  };
+                  if(args.context.zoneType != null && args.context.zoneType.length
> 0) { //Basic type or Advanced type
+                    $.extend(data, {
+                      zonetype: args.context.zoneType
+                    });
+                  }
                   $.ajax({
                     url: createURL('listStoragePools' + searchByArgs),
-                    data: { page: args.page, pageSize: pageSize, listAll: true },
+                    data: data,
                     success: function (json) {
                       args.response.success({ data: json.liststoragepoolsresponse.storagepool
});
                     },


Mime
View raw message