cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch master updated: CLOUDSTACK-10015: Return storage provider with response to list storage pools (#2200)
Date Thu, 27 Jul 2017 21:14:15 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 623ca0d  CLOUDSTACK-10015: Return storage provider with response to list storage
pools (#2200)
623ca0d is described below

commit 623ca0def201cd9b530d22fe409ace83917619e9
Author: Syed Mushtaq Ahmed <syed1.mushtaq@gmail.com>
AuthorDate: Thu Jul 27 17:14:11 2017 -0400

    CLOUDSTACK-10015: Return storage provider with response to list storage pools (#2200)
    
    It would be useful if we return the provider name in the list storage pools response.
This will be useful for example to identify different storages that are in use and their scope.
---
 .../api/response/StoragePoolResponse.java          | 24 +++++++++++++++-------
 .../api/query/dao/StoragePoolJoinDaoImpl.java      | 20 +++++++++---------
 2 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
index b7f7d0b..02d5c44 100644
--- a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
@@ -16,18 +16,16 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import java.util.Date;
-import java.util.Map;
-
+import com.cloud.serializer.Param;
+import com.cloud.storage.StoragePool;
+import com.cloud.storage.StoragePoolStatus;
 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.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
+import java.util.Date;
+import java.util.Map;
 
 @EntityReference(value = StoragePool.class)
 public class StoragePoolResponse extends BaseResponse {
@@ -119,6 +117,10 @@ public class StoragePoolResponse extends BaseResponse {
     @Param(description = "true if this pool is suitable to migrate a volume," + " false otherwise")
     private Boolean suitableForMigration;
 
+    @SerializedName("provider")
+    @Param(description = "Storage provider for this pool")
+    private String provider;
+
     @SerializedName(ApiConstants.STORAGE_CAPABILITIES)
     @Param(description = "the storage pool capabilities")
     private Map<String, String> caps;
@@ -317,4 +319,12 @@ public class StoragePoolResponse extends BaseResponse {
     public Boolean getSuitableForMigration() {
         return suitableForMigration;
     }
+
+    public String getProvider() {
+        return provider;
+    }
+
+    public void setProvider(String provider) {
+        this.provider = provider;
+    }
 }
diff --git a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
index f51f52e..37fdaef 100644
--- a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
@@ -16,16 +16,6 @@
 // under the License.
 package com.cloud.api.query.dao;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-import org.apache.cloudstack.api.response.StoragePoolResponse;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.query.vo.StoragePoolJoinVO;
 import com.cloud.capacity.CapacityManager;
@@ -35,6 +25,14 @@ import com.cloud.utils.StringUtils;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
+import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
 
 @Component
 public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Long>
implements StoragePoolJoinDao {
@@ -98,6 +96,7 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO,
Lo
 
         poolResponse.setClusterId(pool.getClusterUuid());
         poolResponse.setClusterName(pool.getClusterName());
+        poolResponse.setProvider(pool.getStorageProviderName());
         poolResponse.setTags(pool.getTag());
         poolResponse.setOverProvisionFactor(Double.toString(CapacityManager.StorageOverprovisioningFactor.valueIn(pool.getId())));
 
@@ -163,6 +162,7 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO,
Lo
 
         poolResponse.setClusterId(pool.getClusterUuid());
         poolResponse.setClusterName(pool.getClusterName());
+        poolResponse.setProvider(pool.getStorageProviderName());
         poolResponse.setTags(pool.getTag());
 
         // set async job

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message